Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
呵呵 无聊 打个大表过了 居然还不是0ms 贴上大表#include <iostream> using namespace std; int data[5040]= { 123456,0,2103456,1,4123056,1,6123450,1,2130456,2,2013456,2,4123506,2,4120356,2,6023451,2,6123405,2,2134056,3, 2613450,3,4123560,3,4102356,3,6203451,3,6123045,3,2134506,4,134256,4,2613405,4,613452,4,4023561,4, 123564,4,4012356,4,142356,4,6230451,4,263451,4,6120345,4,123645,4,2134560,5,3104256,5,6134250,5, 2613045,5,1603452,5,4613052,5,4203561,5,2103564,5,5123064,5,4612350,5,3142056,5,6142350,5,6234051,5, 4263051,5,1263450,5,6102345,5,2103645,5,5123640,5,2034561,6,134562,6,3140256,6,3014256,6,6034251,6, 6134205,6,2610345,6,613245,6,1630452,6,1063452,6,4613502,6,4610352,6,4230561,6,243561,6,2130564,6, 2013564,6,5123604,6,5120364,6,4612305,6,612354,6,3142506,6,6042351,6,6142305,6,6234501,6,234651,6, 4263501,6,4260351,6,1263405,6,6012345,6,162345,6,2130645,6,2013645,6,5023641,6,2304561,7,3104562,7, 5134062,7,3614250,7,6304251,7,6134025,7,2601345,7,1603245,7,5613240,7,1634052,7,4613520,7,4601352,7, 4235061,7,5243061,7,1243560,7,2135064,7,2413560,7,5102364,7,4612035,7,1602354,7,3612054,7,3142560,7, 6402351,7,6142035,7,6234510,7,3204651,7,1234650,7,4263510,7,4206351,7,1263045,7,6512340,7,3162045,7, 5162340,7,2136045,7,2513640,7,5203641,7,2340561,8,324561,8,3140562,8,3014562,8,5134602,8,5130462,8, 3614205,8,614253,8,6340251,8,364251,8,6130425,8,134625,8,2061345,8,621345,8,1630245,8,1063245,8, 5013246,8,5613204,8,1634502,8,634152,8,4013526,8,613524,8,4061352,8,641352,8,4235601,8,235461,8, 5243601,8,5240361,8,1043562,8,1243506,8,2135604,8,135264,8,2413506,8,413562,8,5012364,8,152364,8, 4610235,8,612435,8,1620354,8,1062354,8,3612504,8,3610254,8,3042561,8,142563,8,6420351,8,462351,8, 6140235,8,142635,8,6034512,8,234516,8,3240651,8,3024651,8,1034652,8,1234605,8,4063512,8,263514,8, 4026351,8,246351,8,1260345,8,263145,8,6512304,8,512346,8,3162405,8,3160245,8,5062341,8,5162304,8, 2136405,8,136245,8,2513604,8,513642,8,5230641,8,253641,8,2345061,9,5324061,9,1324560,9,3145062,9, 3214560,9,5134620,9,5103462,9,3614025,9,1604253,9,2614053,9,6342051,9,2364051,9,1364250,9,6103425,9, 3104625,9,2561340,9,3621045,9,5621340,9,1632045,9,1563240,9,5103246,9,5613024,9,1634520,9,3604152,9, 2634150,9,4103526,9,1603524,9,4261350,9,3641052,9,2641350,9,4235610,9,3205461,9,1235460,9,5243610,9, 5204361,9,1403562,9,1243056,9,2135640,9,3105264,9,4135260,9,2413056,9,5413062,9,5412360,9,3152064,9, 4152360,9,4601235,9,1602435,9,5612430,9,1623054,9,1462350,9,3612540,9,3601254,9,3402561,9,4102563,9, 5142063,9,6423051,9,3462051,9,6104235,9,4102635,9,5142630,9,6304512,9,3204516,9,5234016,9,3246051,9, 3124650,9,1304652,9,1234065,9,4603512,9,6203514,9,5263014,9,4126350,9,1246350,9,1206345,9,6203145,9, 5263140,9,6512034,9,1502346,9,3512046,9,3162450,9,3106245,9,5602341,9,5162034,9,2136450,9,5136240,9, 2513064,9,1503642,9,6513042,9,5236041,9,6253041,9,1253640,9,2345601,10,345261,10,5324601,10,5320461,10, 1024563,10,1324506,10,3145602,10,145362,10,3214506,10,214563,10,5034621,10,5013462,10,153462,10,3610425,10, 614325,10,1640253,10,1064253,10,2614503,10,2610453,10,6342501,10,342651,10,2364501,10,2360451,10,1364205,10, 6013425,10,163425,10,3140625,10,3014625,10,2561304,10,561342,10,3621405,10,3620145,10,5021346,10,5621304,10, 1632405,10,632145,10,1563204,10,563241,10,5130246,10,153246,10,5610324,10,1034526,10,634521,10,3640152,10, 3064152,10,2034156,10,2634105,10,4130526,10,143526,10,1630524,10,1063524,10,4261305,10,261354,10,3641502,10, 2041356,10,2641305,10,4035612,10,235614,10,3250461,10,3025461,10,1035462,10,1235406,10,5043612,10,243615,10, 5024361,10,254361,10,1430562,10,1240356,10,243156,10,2035641,10,135642,10,3150264,10,3015264,10,4035261,10, 4135206,10,2410356,10,413256,10,5413602,10,5410362,10,5412306,10,412365,10,3152604,10,4052361,10,4152306,10, 4061235,10,641235,10,1620435,10,1062435,10,5012436,10,5612403,10,1623504,10,623154,10,1462305,10,3012546,10, 612543,10,3061254,10,631254,10,3420561,10,432561,10,4120563,10,4012563,10,5142603,10,5140263,10,6423501,10, 423651,10,3462501,10,3460251,10,6014235,10,164235,10,4120635,10,4012635,10,5042631,10,6340512,10,364512,10, 3240516,10,3024516,10,5234106,10,5230416,10,3246501,10,3124605,10,124653,10,1340652,10,314652,10,1230465,10, 234165,10,4630512,10,643512,10,6230514,10,6023514,10,5263104,10,5260314,10,4126305,10,126354,10,1046352,10, 1246305,10,1026345,10,216345,10,6230145,10,6023145,10,5063142,10,6510234,10,512634,10,1520346,10,1052346,10, 3512406,10,3510246,10,3062451,10,162453,10,3016245,10,5620341,10,652341,10,5160234,10,162534,10,2036451,10, 136452,10,5036241,10,5136204,10,2510364,10,513264,10,1530642,10,1053642,10,6513402,10,6510342,10,5236401,10, 236541,10,6253401,10,6250341,10,1253604,10,2345610,11,4305261,11,1345260,11,5324610,11,5302461,11,1204563,11, 1324056,11,3145620,11,4105362,11,2145360,11,3214056,11,5214063,11,5304621,11,5213460,11,4153062,11,2153460,11, 3601425,11,1604325,11,5614320,11,1642053,11,2614530,11,2601453,11,6342510,11,4302651,11,1342650,11,2364510,11, 2306451,11,1364025,11,6513420,11,4163025,11,5163420,11,3146025,11,3514620,11,2561034,11,6501342,11,3561042,11, 3621450,11,3602145,11,5201346,11,5621034,11,1632450,11,5632140,11,1563024,11,6503241,11,2563041,11,5132046,11, 2153046,11,6153240,11,5601324,11,1304526,11,3604521,11,5634021,11,3264150,11,2304156,11,2634015,11,4135026,11, 5143026,11,6143520,11,1635024,11,1463520,11,4261035,11,6201354,11,3261054,11,3641520,11,2401356,11,2641035,11, 4305612,11,3205614,11,6235014,11,3254061,11,3125460,11,1305462,11,1235046,11,5403612,11,4203615,11,6243015,11, 5124360,11,1254360,11,1435062,11,1204356,11,4203156,11,6243150,11,2305641,11,3105642,11,6135042,11,3415260,11, 1403256,11,6413250,11,5413620,11,5401362,11,5412036,11,1402365,11,3412065,11,3152640,11,4502361,11,4152036,11, 4561230,11,5641230,11,1624035,11,1562430,11,5102436,11,5612043,11,1623540,11,2603154,11,4623150,11,1462035,11, 3102546,11,1602543,11,3461250,11,2631054,11,4631250,11,3425061,11,5432061,11,1432560,11,4125063,11,4312560,11, 5104263,11,6423510,11,2403651,11,1423650,11,3462510,11,3406251,11,6514230,11,2164035,11,5164230,11,4126035,11, 4512630,11,5402631,11,6345012,11,5364012,11,3245016,11,3624510,11,5234160,11,5203416,11,3246510,11,3124065,11, 2104653,11,6124053,11,1346052,11,6314052,11,2314650,11,1203465,11,3204165,11,4635012,11,5643012,11,2643510,11, 5206314,11,2106354,11,3126054,11,1406352,11,1246035,11,1526340,11,3216045,11,5216340,11,6231045,11,6523140,11, 5603142,11,6501234,11,1502634,11,1523046,11,1652340,11,3512460,11,3501246,11,3602451,11,6102453,11,4162053,11, 3516240,11,5623041,11,3652041,11,5106234,11,6102534,11,4162530,11,3106452,11,4136052,11,5306241,11,5136024,11, 2501364,11,1503264,11,4513260,11,1536042,11,5236410,11,3206541,11,1236540,11,6253410,11,6205341,11,1253064,11, 2045613,12,345612,12,4350261,12,1045263,12,1345206,12,5024613,12,324615,12,5032461,12,352461,12,1240563,12, 1320456,12,324156,12,3045621,12,145623,12,4150362,12,4015362,12,2045361,12,2145306,12,3210456,12,214356,12, 5214603,12,5210463,12,5340621,12,354621,12,5213406,12,213465,12,4153602,12,2053461,12,2153406,12,3061425,12, 631425,12,1640325,12,1064325,12,5014326,12,5614302,12,1642503,12,642153,12,2014536,12,614532,12,2061453,12, 621453,12,6042513,12,342516,12,4320651,12,4032651,12,1042653,12,1342605,12,2064513,12,326451,12,1360425,12, 364125,12,513426,12,4163205,12,4160325,12,5063421,12,5163402,12,3146205,12,146325,12,3514602,12,514623,12, 2560134,12,561234,12,6051342,12,3561402,12,3560142,12,3021456,12,3062145,12,5210346,12,251346,12,5620134,12, 621534,12,1032456,12,632451,12,5032146,12,5632104,12,1560324,12,563124,12,6530241,12,6053241,12,2563401,12, 2560341,12,5132406,12,132546,12,2150346,12,6153204,12,5061324,12,651324,12,1340526,12,314526,12,3640521,12, 3064521,12,5634201,12,5630421,12,3264105,12,264153,12,2340156,12,2630415,12,634215,12,135426,12,5143206,12, 5140326,12,6043521,12,6143502,12,1635204,12,635124,12,1463502,12,463521,12,4260135,12,261435,12,6210354,12, 6021354,12,3261504,12,3260154,12,3041526,12,641523,12,421356,12,2640135,12,4350612,12,3250614,12,3025614,12, 6235104,12,3254601,12,3125406,12,125463,12,1350462,12,315462,12,1230546,12,235146,12,5430612,12,453612,12, 4230615,12,4023615,12,6243105,12,6240315,12,5124306,12,124365,12,1054362,12,1254306,12,1435602,12,435162,12, 1024356,12,4230156,12,4023156,12,6043152,12,2350641,12,325641,12,3150642,12,3015642,12,6135402,12,6130542,12, 3415206,12,415263,12,1430256,12,1043256,12,6013254,12,6413205,12,5013624,12,413625,12,5041362,12,451362,12, 5410236,12,412536,12,1420365,12,1042365,12,3412605,12,3410265,12,3052641,12,152643,12,4520361,12,542361,12, 4150236,12,152436,12,4561203,12,5041236,12,5641203,12,1624305,12,624135,12,1562403,12,562431,12,5120436,12, 5610243,12,1023546,12,623541,12,2630154,12,2063154,12,4623105,12,1460235,12,462135,12,3120546,12,1620543,12, 1062543,12,3461205,12,461253,12,2631504,12,4031256,12,4631205,12,3425601,12,425361,12,5432601,12,5430261,12, 1032564,12,1432506,12,4125603,12,4312506,12,312564,12,5014263,12,154263,12,423516,12,2430651,12,2043651,12, 1023654,12,1423605,12,3062514,12,462513,12,3046251,12,436251,12,6514203,12,514236,12,2164305,12,2160435,12, 5064231,12,5164203,12,126435,12,4512603,12,5420631,12,452631,12,6345102,12,5364102,12,5360412,12,3245106,12, 245316,12,3624501,12,624513,12,5034162,12,5023416,12,253416,12,3046512,12,246513,12,3120465,12,2140653,12, 2014653,12,6124503,12,6120453,12,1346502,12,346152,12,6314502,12,6310452,12,2314605,12,1023465,12,3240165,12, 3024165,12,4635102,12,635412,12,5643102,12,5640312,12,2043516,12,2643501,12,5026314,12,256314,12,2160354,12, 2016354,12,3126504,12,3120654,12,1460352,12,416352,12,1240635,12,246135,12,1526304,12,526341,12,3216405,12, 3210645,12,5016342,12,5216304,12,6231405,12,231645,12,6523104,12,523146,12,5630142,12,653142,12,6051234,12, 1520634,12,1052634,12,1523406,12,1652304,12,3012465,12,512463,12,3051246,12,531246,12,3620451,12,6012453,12, 4162503,12,4160253,12,3516204,12,516243,12,5623401,12,3652401,12,3650241,12,5016234,12,156234,12,6120534,12, 6012534,12,4062531,12,3160452,12,3016452,12,4136502,12,4130652,12,5360241,12,356241,12,5130624,12,136524,12, 2051364,12,521364,12,1530264,12,1053264,12,4013265,12,4513206,12,1536402,12,536142,12,5036412,12,236415,12, 3260541,12,3026541,12,1036542,12,1236504,12,6053412,12,6025341,12,265341,12,1250364,12,253164,12,2405613,13, 4352061,13,1405263,13,1345026,13,5204613,13,2304615,13,6324015,13,5132460,13,1352460,13,1245063,13,1302456,13, 6324150,13,3405621,13,4105623,13,6145023,13,4215360,13,2405361,13,2145036,13,3201456,13,6214350,13,5214630,13, 5201463,13,5346021,13,6354021,13,1354620,13,5213046,13,4213065,13,4153620,13,2503461,13,3561420,13,4631025,13, 5631420,13,1643025,13,1564320,13,5104326,13,5614032,13,1642530,13,4602153,13,3642150,13,2104536,13,1604532,13, 2361450,13,4621053,13,6402513,13,4302516,13,5342016,13,4326051,13,4132650,13,1402653,13,1342065,13,2604513,13, 1326450,13,1306425,13,6304125,13,5364120,13,1503426,13,4513026,13,4163250,13,4106325,13,5603421,13,5163042,13, 3146250,13,5146320,13,3514062,13,1504623,13,6514023,13,2506134,13,6251340,13,3506142,13,3562140,13,3251046,13, 5602134,13,2601534,13,4621530,13,4632051,13,5302146,13,5632014,13,1506324,13,6503124,13,4563120,13,6532041,13, 2563410,13,2506341,13,6132540,13,2105346,13,6153024,13,5461320,13,3651024,13,4651320,13,5314026,13,6314520,13, 3645021,13,3164520,13,5634210,13,3264015,13,6204153,13,1264053,13,2341056,13,2603415,13,3604215,13,3105426,13, 6135420,13,5143260,13,6403521,13,6143052,13,1635240,13,3605124,13,4635120,13,1463052,13,5463021,13,4206135,13, 6201435,13,5261430,13,6213054,13,6421350,13,3261540,13,3206154,13,3401526,13,4601523,13,5641023,13,3421056,13, 2604135,13,4356012,13,3256014,13,3425610,13,6235140,13,3254610,13,3125046,13,2105463,13,1354062,13,4315062,13, 2315460,13,1203546,13,3205146,13,5436012,13,6453012,13,2453610,13,4236015,13,4523610,13,6204315,13,5124036,13, 2104365,13,1504362,13,1254036,13,1435620,13,3405162,13,2435160,13,1624350,13,4231056,13,6403152,13,2356041,13, 6325041,13,1325640,13,3156042,13,3215640,13,6103542,13,3415026,13,2415063,13,1432056,13,1643250,13,6103254,13, 6413025,13,5103624,13,1403625,13,5241360,13,3451062,13,2451360,13,5401236,13,1402536,13,6412530,13,1423065,13, 1542360,13,3412650,13,3401265,13,3502641,13,5102643,13,6152043,13,4523061,13,3542061,13,4105236,13,6152430,13, 4561023,13,5624130,13,1562043,13,6502431,13,4562031,13,5601243,13,2603541,13,2463150,13,4623015,13,1406235,13, 6402135,13,5462130,13,1625043,13,1362540,13,3461025,13,6401253,13,2461053,13,2631540,13,4301256,13,1425360,13, 5432610,13,5403261,13,1302564,13,4125630,13,4312056,13,5312064,13,5314260,13,2154063,13,3154260,13,2403516,13, 5423016,13,2436051,13,2143650,13,1203654,13,3602514,13,5462013,13,1436250,13,1504236,13,2514036,13,2164350,13, 2106435,13,5604231,13,5164023,13,5126430,13,4512063,13,5426031,13,6452031,13,1452630,13,6345120,13,5306412,13, 3245160,13,4205316,13,6245310,13,3624051,13,5624013,13,5304162,13,5623410,13,4253016,13,3406512,13,4206513,13, 5246013,13,3102465,13,2146053,13,6124530,13,1346520,13,4306152,13,2346150,13,6301452,13,2314065,13,1523460,13, 3241065,13,3524160,13,3605412,13,2635410,13,5643120,13,5604312,13,2643051,13,5426310,13,4256310,13,2163054,13, 2416350,13,3126540,13,3102654,13,3416052,13,1204635,13,5246130,13,1526034,13,3526041,13,3216450,13,3201645,13, 5106342,13,5216034,13,6231450,13,5231640,13,6523014,13,2503146,13,5631042,13,1653042,13,2653140,13,6451230,13, 1652034,13,1502463,13,3651240,13,2531046,13,6531240,13,6312450,13,4106253,13,3516024,13,1506243,13,2516043,13, 3652410,13,3605241,13,5416230,13,2156034,13,4156230,13,6125034,13,4602531,13,3164052,13,4136520,13,4103652,13, 5362041,13,1356240,13,3106524,13,3521064,13,4521360,13,1532064,13,1453260,13,4103265,13,1536420,13,2536140,13, 3206415,13,3265041,13,1306542,13,1236054,13,6503412,13,6125340,13,1265340,13,1205364,13,5203164,13,4253160,13, 2450613,14,425613,14,4352601,14,1450263,14,345126,14,5240613,14,254613,14,2340615,14,2034615,14,6324105,14, 6320415,14,132465,14,1052463,14,1352406,14,1245603,14,245163,14,312456,14,6024153,14,3450621,14,435621,14, 4150623,14,4015623,14,6145203,14,6140523,14,4215306,14,215364,14,2450361,14,2140536,14,145236,14,231456,14, 6014352,14,6214305,14,5014632,14,214635,14,5021463,14,251463,14,5346201,14,346521,14,6354201,14,6350421,14, 1054623,14,1354602,14,213546,14,4213605,14,4210365,14,4053621,14,153624,14,2530461,14,523461,14,561423,14, 4630125,14,5031426,14,5631402,14,1643205,14,643125,14,1564302,14,564321,14,154326,14,5610432,14,1042536,14, 642531,14,4620153,14,4062153,14,3042156,14,3642105,14,124536,14,1640532,14,1064532,14,2361405,14,361452,14, 4621503,14,6420513,14,4320516,14,4032516,14,5342106,14,5340216,14,4326501,14,4132605,14,132654,14,1420653,14, 412653,14,1340265,14,342165,14,2640513,14,1026453,14,1326405,14,1036425,14,316425,14,6340125,14,6034125,14, 5064123,14,1530426,14,1053426,14,4510326,14,4063251,14,163254,14,4016325,14,653421,14,5160342,14,163542,14, 146253,14,5046321,14,5146302,14,3510462,14,514362,14,1540623,14,6510423,14,2056134,14,526134,14,6251304,14, 3056142,14,3562104,14,562143,14,3251406,14,3250146,14,5062134,14,652134,14,2610534,14,2061534,14,4021536,14, 4632501,14,4630251,14,5320146,14,352146,14,5630214,14,632514,14,1056324,14,516324,14,6530124,14,6053124,14, 4063125,14,4563102,14,6532401,14,532641,14,2063415,14,563412,14,2056341,14,6032541,14,6132504,14,2015346,14, 125346,14,6150324,14,5461302,14,461325,14,3651204,14,3650124,14,4051326,14,4651302,14,5314206,14,5310426,14, 6014523,14,3645201,14,645321,14,3164502,14,164523,14,5034216,14,3260415,14,264315,14,6240153,14,1264503,14, 1260453,14,2341506,14,341256,14,623415,14,3640215,14,3064215,14,3150426,14,3015426,14,6035421,14,5043261,14, 143265,14,6430521,14,6140352,14,143652,14,1035246,14,635241,14,3065124,14,4035126,14,463152,14,5463201,14, 5460321,14,4026135,14,6210435,14,6021435,14,5061432,14,5261403,14,6213504,14,213654,14,6421305,14,3061542,14, 261543,14,3026154,14,236154,14,3410526,14,431526,14,4610523,14,4061523,14,5640123,14,3421506,14,3420156,14, 2064135,14,4356102,14,356412,14,3256104,14,6035142,14,3054612,14,2150463,14,2015463,14,354162,14,4315602,14, 4310562,14,2315406,14,3025146,14,5436102,14,436512,14,6453102,14,6450312,14,2053614,14,2453601,14,4236105,14, 4523601,14,523614,14,6024315,14,2140365,14,2014365,14,1540362,14,1250436,14,254136,14,1035624,14,3450162,14, 3045162,14,2035164,14,2435106,14,624351,14,4231506,14,6430152,14,2356401,14,6325401,14,6320541,14,1025643,14, 1325604,14,3156402,14,156342,14,3215604,14,215643,14,6013542,14,415326,14,2415603,14,2410563,14,432156,14, 643251,14,6130254,14,6410325,14,1430625,14,1043625,14,5241306,14,241365,14,3451602,14,2451306,14,451236,14, 1420536,14,6412503,14,423165,14,1542306,14,3012654,14,3041265,14,431265,14,3520641,14,5120643,14,5012643,14, 6152403,14,6150243,14,3542601,14,3540261,14,4015236,14,6052431,14,4560123,14,5024136,14,5624103,14,1560243,14, 6520431,14,4562301,14,4560231,14,5061243,14,651243,14,2630541,14,2063541,14,2463105,14,4620315,14,1046235,14, 416235,14,6420135,14,6042135,14,5462103,14,1625403,14,625143,14,1362504,14,362541,14,3460125,14,6410253,14, 6041253,14,2461503,14,2460153,14,2031546,14,631542,14,4310256,14,1025364,14,1425306,14,5032614,14,432615,14, 453261,14,1320564,14,4025631,14,125634,14,5312604,14,5310264,14,314265,14,2154603,14,3054261,14,3154206,14, 2430516,14,5423106,14,5420316,14,2436501,14,2143605,14,1230654,14,3620514,14,5460213,14,1036254,14,1436205,14, 1540236,14,1054236,14,2514306,14,2510436,14,2064351,14,164352,14,2016435,14,5640231,14,654231,14,5160423,14, 5026431,14,5126403,14,4510263,14,5426301,14,426531,14,6452301,14,6450231,14,1452603,14,6045123,14,4250316,14, 4025316,14,6045312,14,6245301,14,5620413,14,5340162,14,4253106,14,3460512,14,4260513,14,4026513,14,5246103,14, 2146503,14,6024531,14,1046523,14,4360152,14,4036152,14,2046153,14,2346105,14,6031452,14,2310465,14,3241605,14, 3524106,14,524163,14,3650412,14,3065412,14,2035416,14,2635401,14,5043126,14,5064312,14,654312,14,2640351,14, 426315,14,4056312,14,4256301,14,2163504,14,2416305,14,126543,14,3416502,14,3410652,14,1024635,14,5046132,14, 3526401,14,216453,14,3021645,14,5210634,14,216534,14,5031642,14,5231604,14,6520314,14,2530146,14,2053146,14, 1653402,14,1650342,14,2653104,14,6451203,14,1650234,14,1520463,14,2531406,14,6031245,14,6531204,14,6312405,14, 4016253,14,3510624,14,1056243,14,2516403,14,2510643,14,3052416,14,652413,14,3065241,14,5416203,14,2156304,14, 2150634,14,4056231,14,4156203,14,6125304,14,4620531,14,4036521,14,4013652,14,5362401,14,1356204,14,3160524,14, 3016524,14,3521604,14,3520164,14,4021365,14,4521306,14,1532604,14,532164,14,1453206,14,4130265,14,536421,14, 2036145,14,2536104,14,3026415,14,3265401,14,1360542,14,316542,14,6530412,14,1065342,14,1265304,14,5230164,14, 5023164,14,4053162,14,2456013,15,6425013,15,4352610,15,1452063,15,4305126,15,6254013,15,2346015,15,2534610,15, 6302415,15,4132065,15,1352046,15,1245630,15,4205163,15,3456021,15,6435021,15,4156023,15,4315620,15,6145230,15, 6104523,15,4215036,15,3215064,15,2453061,15,6104352,15,6214035,15,5104632,15,5321460,15,4251063,15,3251460,15, 5346210,15,4306521,15,6354210,15,6305421,15,6213540,15,4213650,15,4201365,15,4503621,15,2534061,15,6501423,15, 4603125,15,5301426,15,1564032,15,6504321,15,3564021,15,3154026,15,6154320,15,5601432,15,5642031,15,4362150,15, 3402156,15,3642015,15,1645032,15,1264530,15,2361045,15,4361052,15,4325016,15,4632510,15,5342160,15,5304216,15, 4326510,15,6132054,15,1426053,15,6412053,15,1304265,15,4302165,15,2645013,15,1206453,15,1326045,15,4316025,15, 5316420,15,6341025,15,6534120,15,5604123,15,1534026,15,1653420,15,4501326,15,4603251,15,4516320,15,4653021,15, 2163540,15,5406321,15,5146032,15,3501462,15,2514360,15,1546023,15,2456130,15,4526130,15,6251034,15,3256140,15, 3562014,15,6502143,15,4652130,15,2615034,15,2461530,15,4201536,15,5321046,15,6352140,15,5603214,15,1456320,15, 6531024,15,6453120,15,4563012,15,6532410,15,1532640,15,2156340,15,6302541,15,2615340,15,6105324,15,5461032,15, 6401325,15,4651032,15,3645210,15,4605321,15,1645320,15,5264310,15,6241053,15,2341560,15,6341250,15,3564210,15, 3615420,15,2143065,15,1305246,15,2635041,15,3465120,15,5463210,15,6521430,15,5261043,15,6421035,15,3601542,15, 6201543,15,3426150,15,4236150,15,5431026,15,6431520,15,4615023,15,4361520,15,3421560,15,2564130,15,4356120,15, 2356410,15,6305142,15,3504612,15,2354160,15,4301562,15,2315046,15,3625140,15,5436120,15,2436510,15,6405312,15, 2503614,15,6524310,15,1543062,15,1205436,15,5204136,15,6254130,15,1305624,15,2305164,15,2435016,15,2604351,15, 4231560,15,6431052,15,6325410,15,1205643,15,1325064,15,3156420,15,6215043,15,1405326,15,6415320,15,2415630,15, 2401563,15,6432150,15,1436025,15,1543620,15,5241036,15,3451620,15,2451036,15,1425036,15,2403165,15,5423160,15, 1542036,15,3541260,15,2431065,15,5431260,15,5126043,15,5312640,15,6105243,15,3542610,15,3504261,15,4615230,15, 4506123,15,6524031,15,4562310,15,4506231,15,5361240,15,2651043,15,2463015,15,4602315,15,1546230,15,2416035,15, 6542130,15,1625430,15,2605143,15,1362054,15,3406125,15,2406153,15,2301546,15,5302614,15,3402615,15,6432015,15, 4205631,15,2105634,15,5301264,15,2154630,15,5402316,15,3625014,15,5406213,15,1306254,15,1654230,15,2501436,15, 2516430,15,2654031,15,5106423,15,5206431,15,4501263,15,2406531,15,1426530,15,6452310,15,6405231,15,6405123,15, 4625310,15,6245031,15,5602413,15,5341062,15,3465012,15,4265013,15,2146530,15,6204531,15,1406523,15,2301465,15, 3241650,15,3524016,15,2504163,15,1524063,15,3654012,15,3265410,15,2305416,15,5403126,15,2654310,15,2406315,15, 3426015,15,4506312,15,4256031,15,2106543,15,3416520,15,3401652,15,1524630,15,5406132,15,3526410,15,4216053,15, 3521640,15,5201634,15,1206534,15,4216530,15,5301642,15,5231064,15,6502314,15,1605342,15,2653014,15,6451023,15, 1605234,15,2531460,15,6301245,15,6312045,15,4316250,15,3501624,15,2501643,15,3502416,15,4652013,15,3165240,15, 5416023,15,4625031,15,5362410,15,1356024,15,3165024,15,3502164,15,4521036,15,4532160,15,1453026,15,3506421,15, 4536021,15,2306145,15,2536014,15,1365042,15,5316042,15,2316540,15,6534012,15,1265034,15,4503162,15,2456103,16, 456213,16,6425103,16,4052613,16,352614,16,452163,16,4350126,16,6254103,16,6250413,16,346215,16,2534601,16, 534612,16,6032415,16,362415,16,1350246,16,1045632,16,245631,16,4250163,16,4025163,16,3456201,16,456321,16, 6435201,16,156423,16,315624,16,6045231,16,4210536,16,215436,16,3210564,16,5140632,16,154632,16,5321406,16, 321465,16,4251603,16,3051462,16,5046213,16,4360521,16,6054213,16,354216,16,365421,16,4530621,16,543621,16, 534261,16,6051423,16,351426,16,1560432,16,564132,16,6540321,16,6054321,16,3564201,16,3560421,16,6154302,16, 651432,16,5642301,16,4362105,16,362154,16,642315,16,1645302,16,645132,16,264531,16,2360145,16,361245,16, 4361502,16,4325106,16,325416,16,5042163,16,326514,16,1426503,16,426153,16,1034265,16,4320165,16,4032165,16, 2645103,16,645213,16,1320645,16,326145,16,4316205,16,4310625,16,5016423,16,5316402,16,6341205,16,341625,16, 6534102,16,534126,16,654123,16,1534206,16,541326,16,4516302,16,4653201,16,4650321,16,146532,16,531462,16, 1546203,16,546123,16,456132,16,4526103,16,6250134,16,251634,16,256143,16,3560214,16,562314,16,6520143,16, 6052143,16,4052136,16,4652103,16,2615304,16,615234,16,461532,16,241536,16,321546,16,6352104,16,5063214,16, 653214,16,1456302,16,531624,16,453126,16,4560312,16,532416,16,1032645,16,615342,16,6015324,16,165324,16, 5460132,16,6041325,16,4650132,16,3045216,16,4065321,16,1045326,16,5264301,16,6241503,16,241653,16,2041563,16, 341562,16,564213,16,3615402,16,615423,16,315246,16,3465102,16,465123,16,463215,16,6521403,16,521436,16, 5260143,16,421635,16,3610542,16,6210543,16,6021543,16,3426105,16,5431206,16,5430126,16,6031524,16,6431502,16, 4615203,16,361524,16,3021564,16,421563,16,2564103,16,4056123,16,356124,16,2056413,16,6350142,16,365142,16, 3540612,16,2054163,16,2354106,16,4031562,16,2310546,16,3625104,16,5036124,16,436125,16,2036514,16,465312,16, 2530614,16,6524301,16,524316,16,1543602,16,543162,16,1025436,16,5240136,16,6054132,16,1350624,16,2350164,16, 325164,16,435216,16,231564,16,431652,16,6025413,16,1250643,16,3056421,16,6215403,16,1450326,16,6415302,16, 2015634,16,415632,16,6032154,16,6432105,16,3051624,16,451623,16,2450136,16,425136,16,2430165,16,2043165,16, 542136,16,3541206,16,541263,16,2431605,16,5031264,16,312645,16,6015243,16,165243,16,3042615,16,542613,16, 524631,16,4062315,16,546231,16,5361204,16,2651403,16,2650143,16,2460315,16,2410635,16,6542103,16,625431,16, 2065143,16,1360254,16,3046125,16,5320614,16,3420615,16,6430215,16,4250631,16,351264,16,2054631,16,5042316,16, 452316,16,625314,16,316254,16,1654203,16,2051436,16,516432,16,2654301,16,2650431,16,5260431,16,256431,16, 4051263,16,2460531,16,2046531,16,1026534,16,6052314,16,465231,16,6450123,16,4625301,16,6240531,16,5062413,16, 5341602,16,4265103,16,265413,16,1460523,16,416523,16,2031465,16,3041652,16,3520416,16,2540163,16,1524603,16, 3654102,16,2350416,16,2054316,16,2046315,16,546312,16,2160543,16,2016543,16,526413,16,4216503,16,4210653,16, 521643,16,5021634,16,1260534,16,4016532,16,5310642,16,351642,16,2650314,16,1065234,16,6310245,16,2051643,16, 4650213,16,3165204,16,5410623,16,3052164,16,4520136,16,4532106,16,4536201,16,536214,16,1365402,16,2316504,16, 265134,16,4530162,16,3456210,17,6425130,17,4502613,17,6352014,17,5402163,17,3452160,17,4351026,17,6205413,17, 4306215,17,4362015,17,1405632,17,4325160,17,6435210,17,6315024,17,6215430,17,3201564,17,6154032,17,4321065,17, 4251630,17,4365021,17,6504213,17,2354016,17,1365420,17,6543021,17,1534260,17,6351420,17,1506432,17,6504132,17, 2651430,17,5642310,17,6302154,17,4605132,17,2645130,17,5264031,17,2306514,17,5326014,17,4605213,17,1302645,17, 5326140,17,4301625,17,5341620,17,3504126,17,1654023,17,3654120,17,3541026,17,6541320,17,4516032,17,4653210,17, 4106532,17,4531062,17,3546120,17,1456032,17,4526013,17,6205134,17,5206143,17,1256043,17,3506214,17,6521043,17, 4502136,17,6401532,17,6241530,17,6321540,17,4531620,17,4532016,17,3615042,17,4165320,17,3405216,17,4201653,17, 2564013,17,1605423,17,6315240,17,1465023,17,6403215,17,2401635,17,5421630,17,6301524,17,5361024,17,5421063,17, 5306124,17,2506413,17,6351042,17,2365140,17,3546012,17,2465310,17,2504316,17,2543160,17,2351064,17,2431650,17, 6415032,17,5401623,17,2405136,17,2541063,17,2165043,17,6542013,17,2504631,17,2546031,17,2605431,17,4351260,17, 3452016,17,2605314,17,2316054,17,1256430,17,2465031,17,1465230,17,4265130,17,2546310,17,2351640,17,4536210,17, 3056214,18,6025134,18,4520613,18,6350214,18,5420163,18,3452106,18,4351206,18,4360215,18,4036215,18,1450632,18, 6035214,18,6315204,18,6310524,18,6015432,18,6150432,18,4321605,18,4051632,18,4365201,18,6540213,18,1065423,18, 6543201,18,6351402,18,1056432,18,6540132,18,6320154,18,4065132,18,2045136,18,2360514,18,5326104,18,4065213,18, 5026143,18,4031625,18,5041623,18,3540126,18,3054126,18,1650423,18,6541302,18,4510632,18,4053216,18,4160532,18, 4531602,18,3546102,18,1256403,18,6410532,18,6041532,18,6321504,18,4530216,18,4165302,18,3450216,18,4021653,18, 2560413,18,1465203,18,6043215,18,2041635,18,5421603,18,5360124,18,2365104,18,2065314,18,2465301,18,2540316,18, 2543106,18,2351604,18,2031654,18,2541603,18,2165403,18,2540631,18,2546301,18,2065431,18,2310654,18,6305214,19, 6105432,19,4321650,19,4501632,19,4365210,19,6543210,19,6541032,19,6321054,19,2365014,19,4503216,19,4165032,19, 2541630,19,2543016,19,2301654,19,2165430,19,365214,20,165432,20,321654,20,541632,20,543216,20 }; #include <map> int move[2521]; map <int,int> haxi; int main() { int key=1; int i; for(i=0;i<2520;i++) { haxi[data[i*2]]=key; move[key]=data[i*2+1]; key++; } int test; int a; scanf("%d",&test); while(test--) { scanf("%d",&a); int k=haxi[a]; if(k) { printf("%d\n",move[k]); } else { printf("-1\n"); } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator