├── .gitignore ├── README.md ├── hihocoder ├── 1032 │ ├── description.md │ └── main.cpp └── 1033 │ ├── description.md │ └── main.cpp ├── poj-cpp ├── 1000 │ ├── 13564208_AC_0MS_132K.c │ ├── 14323055_AC_0MS_148K.c │ └── 16285493_AC_0MS_372K.cc ├── 1001 │ ├── 13713664_OLE.c │ ├── 13713665_WA.c │ ├── 13713667_WA.c │ ├── 13713669_WA.c │ ├── 13713671_WA.c │ ├── 13713672_WA.c │ ├── 13713685_WA.c │ ├── 13713686_WA.c │ ├── 13713687_WA.c │ ├── 13713691_WA.c │ ├── 13713698_WA.c │ ├── 13713801_WA.c │ ├── 13714308_WA.c │ ├── 13714332_AC_16MS_192K.c │ ├── 13714340_AC_16MS_192K.c │ ├── 13714346_AC_16MS_148K.c │ ├── 14231035_AC_16MS_356K.cc │ ├── 15091689_WA.java │ └── 15091735_AC_141MS_3424K.java ├── 1002 │ ├── 13710643_CE.c │ ├── 13710652_CE.cpp │ ├── 13710661_CE.cpp │ ├── 13710663_CE.cpp │ ├── 13710670_CE.cpp │ ├── 13711020_CE.cpp │ └── 13711023_AC_891MS_5148K.cpp ├── 1003 │ ├── 13711096_PE.cpp │ └── 13711097_AC_0MS_148K.cpp ├── 1004 │ └── 13711057_AC_0MS_148K.cpp ├── 1005 │ └── 13715971_AC_0MS_148K.cpp ├── 1006 │ └── 13715705_AC_719MS_132K.cpp ├── 1007 │ ├── 13719237_CE.c │ ├── 13719239_CE.c │ ├── 13719240_CE.c │ ├── 13719241_AC_16MS_148K.c │ └── 13719242_AC_0MS_148K.c ├── 1008 │ ├── 13810398_WA.cpp │ ├── 13810422_WA.cpp │ ├── 13810523_WA.cpp │ ├── 13810534_WA.cpp │ ├── 13810692_WA.cpp │ └── 13810717_AC_0MS_136K.cpp ├── 1010 │ ├── 14936024_PE.cc │ └── 14936030_AC_0MS_356K.cc ├── 1011 │ ├── 13812702_TLE.cpp │ ├── 13812733_TLE.cpp │ ├── 13813217_TLE.cpp │ ├── 13813290_TLE.cpp │ ├── 13813335_TLE.cpp │ ├── 13833331_WA.cpp │ ├── 13833877_TLE.cpp │ └── 13833940_AC_16MS_104K.cpp ├── 1012 │ ├── 13890527_TLE.cpp │ ├── 13890532_TLE.cpp │ ├── 13890535_CE.cpp │ └── 13890537_AC_0MS_180K.cpp ├── 1013 │ ├── 13947061_WA.cpp │ ├── 13947321_WA.cpp │ ├── 13947330_WA.cpp │ ├── 13947394_WA.cpp │ └── 13947401_AC_0MS_132K.cpp ├── 1014 │ ├── 13863516_TLE.cpp │ ├── 13863626_WA.cpp │ ├── 13863646_TLE.cpp │ ├── 13863707_WA.cpp │ ├── 13863745_TLE.cpp │ ├── 13863778_WA.cpp │ ├── 13863810_WA.cpp │ ├── 13863814_WA.cpp │ ├── 13863844_TLE.cpp │ ├── 13863985_TLE.c │ ├── 13864000_WA.c │ ├── 13873186_TLE.c │ ├── 13873188_TLE.c │ ├── 13873192_TLE.cpp │ ├── 13873194_TLE.cpp │ ├── 13873197_TLE.cpp │ ├── 13873199_TLE.cpp │ ├── 13873215_TLE.cpp │ ├── 13873224_TLE.cpp │ ├── 13873225_AC_0MS_164K.cpp │ ├── 13873246_WA.cpp │ ├── 14259027_AC_0MS_1092K.cc │ └── 14259032_TLE.cc ├── 1015 │ ├── 14478721_WA.cc │ ├── 14478923_WA.cc │ ├── 14478937_WA.cc │ ├── 14673643_TLE.cc │ ├── 14673644_WA.cc │ └── 14674734_AC_579MS_27196K.cc ├── 1016 │ ├── 14715231_WA.cc │ ├── 14715232_WA.cc │ ├── 14715236_WA.cc │ └── 14715246_AC_782MS_728K.cc ├── 1017 │ └── 13893216_AC_16MS_180K.cpp ├── 1018 │ ├── 14281928_WA.cc │ ├── 14281955_WA.cpp │ ├── 14281969_WA.cpp │ ├── 14282409_MLE.cpp │ ├── 14284154_WA.cpp │ ├── 14284380_AC_47MS_656K.cpp │ ├── 14284382_WA.cc │ ├── 14284383_AC_63MS_656K.cpp │ └── 14284384_AC_79MS_876K.cc ├── 1019 │ ├── 14057197_WA.cpp │ └── 14057200_AC_16MS_656K.cpp ├── 1020 │ ├── 14871193_TLE.cc │ ├── 14871202_TLE.cc │ ├── 14871213_TLE.cc │ └── 14871596_AC_32MS_356K.cc ├── 1026 │ ├── 14806224_TLE.cc │ ├── 14812169_PE.cc │ ├── 14812182_WA.cc │ ├── 14812187_WA.cc │ └── 14812194_AC_47MS_332K.cc ├── 1028 │ ├── 13962551_CE.cpp │ ├── 13962554_RE.cpp │ ├── 13962558_CE.cpp │ ├── 13962560_CE.c │ └── 13962562_AC_0MS_168K.cpp ├── 1029 │ └── 14897223_AC_16MS_760K.cc ├── 1032 │ ├── 14245959_WA.cpp │ ├── 14544287_WA.cpp │ ├── 14544308_WA.cpp │ └── 14544378_AC_0MS_160K.cpp ├── 1035 │ └── 14564925_AC_282MS_544K.cc ├── 1042 │ ├── 14417628_WA.cc │ ├── 14417629_WA.cc │ ├── 14418227_WA.cc │ ├── 14418274_WA.cc │ └── 14418284_AC_79MS_356K.cc ├── 1045 │ ├── 14649675_AC_0MS_404K.cc │ └── 14649736_WA.cc ├── 1046 │ ├── 13942126_CE.cpp │ └── 13942127_AC_0MS_144K.c ├── 1047 │ ├── 14804632_WA.cc │ └── 14804640_AC_16MS_408K.cc ├── 1050 │ ├── 13827328_WA.c │ ├── 13827335_TLE.c │ ├── 13827735_WA.c │ ├── 13827741_WA.c │ ├── 13831201_WA.c │ ├── 13831217_WA.c │ ├── 13831320_CE.c │ ├── 13831324_WA.c │ ├── 13831342_WA.c │ ├── 13831461_WA.c │ ├── 13831513_WA.c │ ├── 13831768_WA.c │ └── 13831780_AC_63MS_204K.c ├── 1051 │ └── 14922127_AC_0MS_352K.cc ├── 1056 │ └── 14813882_AC_16MS_8196K.cc ├── 1061 │ ├── 13724980_TLE.cpp │ ├── 13724982_TLE.cpp │ ├── 13724987_WA.cpp │ ├── 13724988_WA.cpp │ ├── 13724989_WA.cpp │ ├── 13800316_TLE.cpp │ ├── 13870638_WA.c │ ├── 13870642_TLE.c │ ├── 13870667_CE.c │ ├── 13870670_TLE.c │ ├── 13870710_WA.c │ ├── 13873403_WA.c │ ├── 13873404_WA.c │ ├── 13873433_WA.c │ ├── 13873438_WA.c │ ├── 13873441_WA.c │ ├── 13873449_WA.cpp │ ├── 13873470_TLE.cpp │ ├── 13873500_TLE.c │ ├── 13873545_WA.cpp │ ├── 13873550_TLE.cpp │ ├── 14118640_AC_16MS_156K.cpp │ ├── 15888328_WA.cc │ └── 15888399_AC_32MS_388K.cc ├── 1062 │ ├── 14376927_WA.cpp │ └── 14377441_AC_16MS_208K.cpp ├── 1064 │ ├── 14152259_WA.cpp │ ├── 14152262_WA.cpp │ ├── 14152281_AC_157MS_252K.cpp │ ├── 14720367_WA.cc │ ├── 14720368_WA.cc │ ├── 14720369_WA.cc │ ├── 14720370_WA.cc │ └── 14720397_AC_157MS_228K.cpp ├── 1065 │ ├── 14339747_WA.cpp │ ├── 14540778_WA.cpp │ ├── 14541353_TLE.cpp │ ├── 14541404_TLE.cpp │ ├── 14541446_WA.cpp │ └── 14541561_AC_16MS_228K.cpp ├── 1067 │ └── 14675963_AC_16MS_352K.cc ├── 1068 │ ├── 14001896_WA.cpp │ └── 14001900_AC_0MS_132K.cpp ├── 1077 │ ├── 14242998_WA.cc │ ├── 14473169_RE.cc │ ├── 14473239_WA.cc │ └── 14473270_AC_547MS_3788K.cc ├── 1080 │ ├── 14270072_WA.cc │ ├── 14270079_WA.cc │ ├── 14270082_WA.cc │ ├── 14270092_CE.cc │ ├── 14270093_WA.cc │ ├── 14270176_WA.cc │ ├── 14270248_WA.cpp │ ├── 14270259_WA.cpp │ ├── 14270261_AC_0MS_308K.cpp │ ├── 14270279_WA.cpp │ ├── 14270284_OLE.cpp │ ├── 14270286_AC_0MS_184K.cpp │ ├── 14270294_OLE.cpp │ └── 14270295_AC_0MS_184K.cpp ├── 1083 │ ├── 14260736_WA.cc │ ├── 14260752_WA.cc │ ├── 14260843_WA.cc │ └── 14260852_AC_0MS_356K.cc ├── 1087 │ ├── 14919971_WA.cc │ └── 14919979_AC_0MS_632K.cc ├── 1088 │ ├── 13799874_TLE.cpp │ ├── 13800055_AC_16MS_236K.cpp │ ├── 15011008_RE.cc │ └── 15011018_AC_641MS_1164K.cc ├── 1094 │ ├── 14539620_WA.cpp │ ├── 14539642_WA.cpp │ ├── 14539686_WA.cpp │ ├── 14539706_WA.cpp │ └── 14540048_AC_16MS_160K.cpp ├── 1102 │ ├── 14815254_PE.cc │ └── 14815256_AC_16MS_356K.cc ├── 1111 │ ├── 14854467_WA.cc │ ├── 14854470_WA.cc │ ├── 14854474_WA.cc │ └── 14854499_AC_0MS_396K.cc ├── 1113 │ ├── 14614003_WA.cc │ ├── 14614037_WA.cc │ ├── 14614065_WA.cc │ ├── 14614069_WA.cc │ ├── 14614074_AC_47MS_400K.cc │ └── 14614165_AC_16MS_408K.cc ├── 1118 │ ├── 14362507_WA.cpp │ ├── 14362508_CE.cpp │ ├── 14362509_WA.cpp │ ├── 14362512_AC_172MS_2112K.cpp │ └── 14362514_AC_172MS_2112K.cpp ├── 1125 │ └── 14231204_AC_0MS_400K.cc ├── 1129 │ ├── 14702488_WA.cc │ ├── 14702498_WA.cc │ └── 14703054_AC_0MS_400K.cc ├── 1141 │ ├── 14318661_WA.cpp │ ├── 14318663_WA.cpp │ ├── 14318668_WA.cpp │ ├── 14318760_WA.cpp │ ├── 14320723_WA.cpp │ ├── 14320729_WA.cpp │ ├── 14320735_CE.cpp │ ├── 14320740_WA.cpp │ ├── 14320792_TLE.cpp │ ├── 14321091_TLE.cpp │ ├── 14321101_TLE.cc │ └── 14321110_AC_16MS_272K.cpp ├── 1144 │ ├── 14913298_WA.cc │ └── 14913725_AC_16MS_560K.cc ├── 1149 │ └── 14507527_AC_16MS_196K.cpp ├── 1151 │ ├── 14684491_PE.cc │ └── 14684492_AC_0MS_404K.cc ├── 1157 │ ├── 14296012_WA.cc │ ├── 14296021_WA.cc │ ├── 14296209_WA.cc │ ├── 14296239_AC_0MS_468K.cc │ └── 14894240_WA.cc ├── 1159 │ ├── 13975884_MLE.cpp │ ├── 13975886_MLE.cpp │ ├── 13975891_RE.cpp │ ├── 13975892_RE.cpp │ ├── 13975933_RE.cpp │ ├── 13975935_RE.cpp │ ├── 13975939_MLE.cpp │ ├── 13975959_MLE.c │ ├── 13975985_RE.c │ └── 13975987_AC_704MS_49168K.c ├── 1160 │ └── 14646099_AC_719MS_428K.cc ├── 1163 │ ├── 13818593_TLE.cpp │ └── 13824911_AC_32MS_212K.c ├── 1166 │ ├── 14764642_TLE.cc │ ├── 14764646_TLE.cc │ ├── 14764651_TLE.cpp │ └── 14764660_AC_610MS_388K.cc ├── 1177 │ ├── 14775214_RE.cc │ ├── 14775221_RE.cc │ ├── 14775227_RE.cc │ ├── 14775236_MLE.cc │ ├── 14775251_RE.cpp │ ├── 14775290_AC_32MS_576K.cpp │ └── 14776828_AC_47MS_1052K.cc ├── 1182 │ ├── 13926534_WA.cpp │ ├── 13926539_WA.cpp │ ├── 13926704_WA.cpp │ ├── 13927220_WA.cpp │ ├── 14135986_CE.cpp │ ├── 14135993_WA.cpp │ └── 14136005_AC_250MS_712K.cpp ├── 1183 │ ├── 14818746_WA.cc │ ├── 14818754_WA.cc │ ├── 14818759_WA.cc │ ├── 14818766_TLE.cc │ └── 14818864_AC_32MS_352K.cc ├── 1185 │ ├── 14456195_RE.cc │ ├── 14456197_RE.cpp │ ├── 14456231_WA.cpp │ ├── 14457093_WA.cpp │ ├── 14457141_WA.cpp │ ├── 14457178_WA.cc │ └── 14457870_AC_579MS_4664K.cc ├── 1190 │ ├── 14437720_TLE.cc │ ├── 14437803_WA.cc │ ├── 14437809_WA.cc │ ├── 14437863_WA.cc │ ├── 14437935_CE.cc │ ├── 14437937_CE.cpp │ ├── 14437939_WA.cpp │ ├── 14437954_WA.cpp │ ├── 14438173_CE.cpp │ └── 14438176_AC_47MS_356K.cc ├── 1195 │ ├── 14245380_RE.cc │ ├── 14245382_AC_1000MS_4668K.cc │ └── 14481871_AC_1032MS_5108K.cc ├── 1200 │ ├── 14651404_AC_172MS_38628K.cc │ └── 14651469_AC_172MS_38628K.cc ├── 1201 │ ├── 14519272_RE.cpp │ ├── 14519320_RE.cpp │ ├── 14519323_AC_250MS_7860K.cpp │ └── 14519336_AC_250MS_2568K.cpp ├── 1207 │ ├── 13860487_WA.cpp │ ├── 13860812_WA.cpp │ ├── 13860821_WA.cpp │ └── 13860910_AC_0MS_2936K.cpp ├── 1218 │ └── 13943396_AC_0MS_132K.c ├── 1222 │ └── 14818915_AC_0MS_356K.cc ├── 1236 │ ├── 14911117_WA.cc │ └── 14911120_AC_32MS_580K.cc ├── 1247 │ └── 14819731_AC_0MS_356K.cc ├── 1251 │ └── 14275334_AC_0MS_136K.cpp ├── 1256 │ ├── 14554330_TLE.cc │ └── 14554346_AC_0MS_352K.cc ├── 1258 │ ├── 13881088_CE.cpp │ ├── 13881094_RE.cpp │ └── 13881097_AC_32MS_384K.cpp ├── 1269 │ ├── 14823260_WA.cc │ └── 14823281_AC_0MS_372K.cc ├── 1273 │ ├── 14055450_WA.cpp │ ├── 14055454_WA.cpp │ ├── 14055469_WA.cpp │ ├── 14055470_WA.cpp │ ├── 14055472_WA.cpp │ ├── 14055474_WA.cpp │ ├── 14055480_WA.cpp │ ├── 14055501_WA.cpp │ ├── 14055517_WA.cpp │ ├── 14055523_WA.cpp │ ├── 14055527_AC_47MS_3684K.cpp │ ├── 14196498_CE.cpp │ ├── 14196500_TLE.cc │ ├── 14196555_TLE.cpp │ ├── 14196583_TLE.cpp │ ├── 14196671_TLE.cpp │ ├── 14196677_WA.cpp │ ├── 14196685_WA.cpp │ ├── 14196697_WA.cpp │ ├── 14196713_AC_16MS_192K.cpp │ ├── 14196722_AC_16MS_192K.cpp │ ├── 14196727_AC_16MS_172K.cpp │ ├── 14386381_CE.cpp │ ├── 14386384_CE.cpp │ └── 14386388_WA.cc ├── 1274 │ ├── 14280335_TLE.cpp │ ├── 14280347_RE.cpp │ ├── 14280349_AC_0MS_252K.cpp │ └── 14386447_AC_0MS_668K.cc ├── 1276 │ └── 14060873_AC_47MS_580K.cpp ├── 1298 │ ├── 13984233_WA.cpp │ └── 13984235_AC_0MS_140K.cpp ├── 1308 │ ├── 14318436_WA.cpp │ ├── 14318443_WA.cpp │ ├── 14318452_WA.cpp │ ├── 14318465_WA.cpp │ ├── 14318468_WA.cpp │ ├── 14318508_AC_0MS_228K.cpp │ └── 14318510_WA.cpp ├── 1316 │ ├── 13997622_TLE.cpp │ └── 13997645_AC_0MS_132K.cpp ├── 1321 │ ├── 14018767_WA.cpp │ ├── 14241956_WA.cc │ ├── 14242147_AC_0MS_356K.cc │ └── 14553784_TLE.cc ├── 1323 │ ├── 14901622_WA.cc │ ├── 14901826_WA.cc │ └── 14901828_AC_0MS_364K.cc ├── 1325 │ ├── 14825562_TLE.cc │ ├── 14825585_RE.cc │ ├── 14825588_TLE.cc │ └── 14825626_AC_32MS_580K.cc ├── 1326 │ ├── 14771129_WA.cc │ └── 14771131_AC_0MS_356K.cc ├── 1328 │ ├── 14165661_WA.cpp │ ├── 14165662_WA.cpp │ ├── 14176344_WA.cpp │ └── 14176461_AC_79MS_236K.cpp ├── 1330 │ ├── 14065049_AC_32MS_224K.cpp │ └── 14215366_AC_16MS_444K.cc ├── 1338 │ ├── 14230954_PE.cc │ ├── 14230956_AC_0MS_360K.cc │ ├── 14819111_MLE.cc │ ├── 14819336_WA.cc │ └── 14819347_AC_0MS_372K.cc ├── 1363 │ ├── 14059827_AC_63MS_172K.cpp │ └── 14220439_AC_63MS_592K.cc ├── 1401 │ └── 14264842_AC_344MS_356K.cc ├── 1422 │ ├── 14904976_WA.cc │ ├── 14905011_WA.cc │ └── 14905163_AC_0MS_552K.cc ├── 1423 │ ├── 14216226_TLE.cc │ ├── 14216275_MLE.cc │ ├── 14216277_WA.cc │ ├── 14216283_RE.cc │ ├── 14216288_MLE.cc │ ├── 14216290_MLE.cc │ ├── 14216294_RE.cc │ ├── 14216313_RE.cc │ └── 14216317_AC_672MS_39540K.cc ├── 1426 │ ├── 14345940_TLE.cc │ ├── 14345952_AC_16MS_360K.cc │ └── 14345955_AC_188MS_2756K.cc ├── 1450 │ ├── 14923685_WA.cc │ └── 14923690_AC_79MS_364K.cc ├── 1455 │ └── 14785926_AC_0MS_548K.cc ├── 1458 │ ├── 13948386_WA.cpp │ ├── 13949436_RE.cpp │ ├── 13949441_AC_16MS_940K.cpp │ └── 14082992_WA.cpp ├── 1459 │ ├── 14393487_TLE.cc │ ├── 14393650_WA.cc │ ├── 14393805_WA.cc │ ├── 14393899_WA.cc │ ├── 14393924_WA.cc │ ├── 14393962_WA.cc │ ├── 14394026_AC_94MS_916K.cc │ └── 14394893_AC_79MS_912K.cc ├── 1466 │ ├── 14880085_TLE.cc │ └── 14880089_AC_422MS_396K.cc ├── 1469 │ └── 14556024_AC_516MS_1712K.cc ├── 1470 │ └── 14814279_AC_625MS_364K.cc ├── 1477 │ ├── 14348300_WA.cc │ ├── 14348313_WA.cpp │ ├── 14658550_PE.cc │ └── 14658552_AC_16MS_388K.cc ├── 1488 │ └── 14865422_AC_16MS_336K.cc ├── 1503 │ └── 13984157_AC_0MS_144K.cpp ├── 1504 │ ├── 14280651_WA.cpp │ └── 14280660_AC_47MS_144K.cpp ├── 1511 │ ├── 14679426_WA.cc │ ├── 14679442_WA.cc │ ├── 14679446_TLE.cc │ └── 14679485_AC_2032MS_39724K.cc ├── 1517 │ ├── 14043421_WA.cpp │ └── 14043433_AC_0MS_152K.cpp ├── 1519 │ ├── 14264314_WA.cc │ └── 14264327_AC_0MS_356K.cc ├── 1528 │ └── 14795278_AC_0MS_628K.cc ├── 1543 │ ├── 14362395_WA.cpp │ └── 14362399_AC_16MS_132K.cpp ├── 1547 │ └── 14827192_AC_0MS_356K.cc ├── 1552 │ └── 14026391_AC_0MS_132K.cpp ├── 1562 │ └── 14552778_AC_0MS_380K.cc ├── 1565 │ └── 14564593_AC_16MS_356K.cc ├── 1569 │ └── 14519859_AC_16MS_144K.cpp ├── 1573 │ └── 14798032_AC_0MS_404K.cc ├── 1579 │ ├── 14280571_WA.cpp │ └── 14280576_AC_0MS_4044K.cpp ├── 1604 │ └── 14829181_AC_688MS_432K.cc ├── 1611 │ └── 14024947_AC_16MS_292K.cpp ├── 1631 │ └── 14712033_AC_110MS_704K.cc ├── 1651 │ ├── 14894775_WA.cc │ └── 14895468_AC_0MS_400K.cc ├── 1654 │ ├── 14906007_WA.cc │ ├── 14906009_WA.cc │ ├── 14906018_WA.cc │ ├── 14906028_WA.cc │ ├── 14906029_AC_32MS_1136K.cc │ └── 14906038_AC_0MS_356K.cc ├── 1656 │ └── 14559639_AC_0MS_412K.cc ├── 1657 │ └── 14266569_AC_0MS_356K.cc ├── 1658 │ └── 14054716_AC_16MS_148K.cpp ├── 1663 │ └── 14366244_AC_16MS_132K.cpp ├── 1664 │ ├── 13893063_AC_0MS_180K.cpp │ └── 13893064_AC_0MS_180K.cpp ├── 1665 │ └── 15091938_AC_0MS_404K.cc ├── 1674 │ └── 14802668_AC_94MS_484K.cc ├── 1679 │ ├── 14324347_WA.cpp │ └── 14324362_AC_16MS_240K.cpp ├── 1703 │ └── 14242297_AC_610MS_1140K.cc ├── 1716 │ └── 14776396_AC_141MS_1448K.cc ├── 1724 │ ├── 14438331_TLE.cc │ ├── 14438345_WA.cc │ ├── 14438352_TLE.cc │ ├── 14438379_TLE.cc │ ├── 14438383_WA.cc │ └── 14438978_AC_219MS_5032K.cc ├── 1731 │ ├── 14702045_AC_454MS_400K.cc │ ├── 14702052_PE.cc │ └── 14702054_AC_47MS_376K.cc ├── 1742 │ ├── 14041748_TLE.cpp │ ├── 14041755_TLE.cc │ ├── 14041758_TLE.cc │ ├── 14041760_CE.cc │ ├── 14041761_CE.cc │ ├── 14041763_TLE.cc │ ├── 14041766_TLE.cpp │ ├── 14041772_TLE.cpp │ ├── 14254350_AC_2922MS_784K.cc │ ├── 14269564_TLE.cc │ └── 14288106_TLE.cpp ├── 1743 │ ├── 14640714_TLE.cc │ ├── 14640759_WA.cc │ └── 14640762_AC_594MS_752K.cc ├── 1753 │ ├── 13756510_WA.cpp │ ├── 13756520_WA.cpp │ ├── 13756522_WA.cpp │ ├── 13756523_WA.cpp │ ├── 13756524_AC_63MS_132K.cpp │ ├── 13756526_AC_63MS_132K.cpp │ ├── 13944917_WA.c │ ├── 13944933_WA.c │ ├── 13945768_AC_94MS_132K.cpp │ ├── 14286363_WA.c │ └── 14286365_WA.c ├── 1775 │ ├── 14918263_TLE.cc │ ├── 14918276_WA.cc │ └── 14918287_AC_94MS_484K.cc ├── 1789 │ ├── 14658911_RE.cc │ ├── 14658924_AC_1766MS_34400K.cc │ └── 14659063_TLE.cc ├── 1797 │ ├── 14706948_WA.cc │ └── 14707990_AC_250MS_1840K.cc ├── 1799 │ └── 14721239_AC_63MS_384K.cc ├── 1804 │ ├── 14826933_PE.cc │ └── 14826934_AC_32MS_364K.cc ├── 1811 │ ├── 14675430_WA.cc │ ├── 14675497_TLE.cc │ ├── 14675499_TLE.cc │ ├── 14675502_TLE.cc │ ├── 14675512_TLE.cc │ ├── 14675518_TLE.cc │ ├── 14675540_AC_375MS_396K.cc │ └── 14675591_AC_360MS_396K.cc ├── 1833 │ ├── 14245538_TLE.cc │ ├── 14245543_TLE.cpp │ ├── 14245556_WA.cpp │ ├── 14245592_WA.cpp │ ├── 14245593_WA.cpp │ ├── 14245599_WA.cpp │ ├── 14245628_WA.cpp │ ├── 14245636_WA.cpp │ ├── 14245861_AC_454MS_136K.cpp │ ├── 14245863_WA.cpp │ └── 14245873_AC_469MS_136K.cpp ├── 1836 │ ├── 14907018_WA.cc │ ├── 14907022_WA.cc │ ├── 14907037_WA.cc │ ├── 14907061_WA.cc │ ├── 14907129_WA.cc │ ├── 14907132_WA.cc │ └── 14907150_AC_47MS_396K.cc ├── 1837 │ └── 14402377_AC_141MS_1668K.cc ├── 1840 │ ├── 14700500_WA.cc │ ├── 14700520_WA.cc │ ├── 14700542_WA.cc │ ├── 14700551_WA.cc │ ├── 14700552_WA.cc │ ├── 14700554_WA.cc │ ├── 14700557_WA.cc │ └── 14700588_AC_1032MS_436K.cc ├── 1844 │ └── 14371588_AC_0MS_132K.cpp ├── 1852 │ └── 14871055_AC_141MS_356K.cc ├── 1860 │ ├── 14507541_AC_16MS_156K.cpp │ ├── 14685236_AC_16MS_368K.cc │ └── 14685238_WA.cc ├── 1861 │ ├── 14768832_WA.cc │ └── 14768846_AC_63MS_604K.cc ├── 1862 │ ├── 14179241_AC_0MS_168K.cpp │ └── 14710605_AC_32MS_612K.cc ├── 1887 │ ├── 14742979_PE.cc │ └── 14742983_AC_63MS_564K.cc ├── 1915 │ ├── 14055105_WA.cpp │ └── 14055112_AC_63MS_556K.cpp ├── 1922 │ ├── 14299014_WA.c │ ├── 14299031_AC_16MS_168K.c │ ├── 14299033_AC_16MS_168K.c │ ├── 14299043_WA.cpp │ ├── 14299048_WA.cc │ ├── 14299050_WA.c │ └── 14299054_AC_16MS_168K.c ├── 1936 │ ├── 13972676_MLE.cpp │ ├── 13972685_WA.cpp │ └── 13972730_AC_16MS_448K.cpp ├── 1942 │ ├── 14702180_RE.cc │ ├── 14702184_RE.cc │ ├── 14702188_RE.cc │ ├── 14702195_RE.cpp │ ├── 14702208_RE.cc │ ├── 14702225_WA.cc │ ├── 14702227_WA.cc │ ├── 14702233_WA.cc │ ├── 14702239_WA.cc │ ├── 14702243_TLE.cc │ └── 14702248_AC_344MS_8228K.cc ├── 1947 │ └── 15039056_AC_32MS_800K.cc ├── 1953 │ └── 14312773_AC_0MS_148K.cpp ├── 1961 │ ├── 14684566_TLE.cc │ └── 14684689_AC_500MS_5248K.cc ├── 1969 │ └── 14723833_AC_0MS_356K.cc ├── 1979 │ └── 13965183_AC_63MS_156K.cpp ├── 1988 │ ├── 14462124_WA.cc │ └── 14462126_AC_563MS_704K.cc ├── 1990 │ └── 15017650_AC_16MS_792K.cc ├── 2000 │ └── 13954845_AC_16MS_160K.cpp ├── 2001 │ ├── 14700700_MLE.cc │ ├── 14700701_WA.cc │ ├── 14700702_WA.cc │ ├── 14700705_MLE.cc │ ├── 14700707_MLE.cc │ ├── 14700709_WA.cc │ ├── 14700710_WA.cc │ ├── 14700716_WA.cc │ ├── 14700720_WA.cc │ ├── 14700734_WA.cc │ ├── 14700739_WA.cc │ ├── 14700747_WA.cc │ └── 14702012_AC_79MS_16264K.cc ├── 2002 │ └── 14699347_AC_1313MS_796K.cc ├── 2010 │ ├── 14217979_RE.cc │ ├── 14217980_TLE.cc │ ├── 14218052_TLE.cc │ ├── 14220251_WA.cc │ ├── 14220259_WA.cc │ ├── 14220282_WA.cc │ ├── 14945774_RE.cc │ ├── 14945776_WA.cc │ └── 14945802_AC_204MS_2572K.cc ├── 2013 │ ├── 14318554_WA.cpp │ └── 14318563_AC_0MS_148K.cpp ├── 2017 │ ├── 13967918_AC_0MS_156K.cpp │ ├── 13967961_CE.cpp │ └── 13967962_AC_16MS_156K.cpp ├── 2027 │ └── 13892858_AC_0MS_180K.cpp ├── 2039 │ └── 14699356_AC_0MS_372K.cc ├── 2051 │ └── 14857565_AC_94MS_1652K.cc ├── 2070 │ └── 14734671_AC_0MS_360K.cc ├── 2080 │ ├── 14910435_RE.cc │ ├── 14910436_RE.cpp │ ├── 14910437_RE.c │ ├── 14910470_WA.cc │ └── 14910473_AC_79MS_396K.cc ├── 2081 │ └── 14105833_AC_2391MS_19140K.cpp ├── 2084 │ └── 14922356_AC_79MS_720K.cc ├── 2092 │ └── 14916962_AC_235MS_392K.cc ├── 2104 │ ├── 13943750_WA.cpp │ ├── 13943990_WA.cpp │ ├── 13944005_TLE.cpp │ ├── 13944073_TLE.cpp │ ├── 13944114_WA.cc │ ├── 13944119_TLE.cc │ ├── 13986492_AC_7000MS_920K.cpp │ ├── 14744969_AC_11594MS_1764K.cc │ ├── 14744974_AC_6641MS_1172K.cc │ ├── 14745256_AC_6297MS_17864K.cc │ ├── 14746003_AC_2454MS_7612K.cpp │ ├── 14747046_WA.cc │ ├── 14747051_WA.cc │ ├── 14747058_WA.cpp │ └── 14748040_AC_1094MS_14640K.cc ├── 2105 │ └── 14026668_AC_0MS_132K.cpp ├── 2109 │ ├── 14073190_WA.c │ └── 14073192_AC_0MS_180K.c ├── 2112 │ ├── 14861736_RE.cc │ ├── 14861737_WA.cc │ ├── 14861743_WA.cc │ └── 14861810_AC_141MS_1072K.cc ├── 2115 │ ├── 14795116_WA.cc │ ├── 14795120_WA.cc │ ├── 14795127_WA.cc │ ├── 14795135_WA.cc │ └── 14795141_AC_0MS_356K.cc ├── 2135 │ ├── 14867099_WA.cc │ ├── 14867112_WA.cc │ ├── 14867116_WA.cc │ ├── 14867139_RE.cc │ ├── 14867142_WA.cc │ ├── 14867193_WA.cc │ ├── 14867257_AC_16MS_1012K.cc │ └── 14894421_AC_16MS_1004K.cc ├── 2136 │ └── 14581075_AC_0MS_580K.cc ├── 2139 │ ├── 14221117_AC_32MS_760K.cc │ ├── 14956746_WA.cc │ ├── 14956748_WA.cc │ └── 14956750_AC_16MS_556K.cc ├── 2140 │ └── 14090094_AC_610MS_356K.cc ├── 2141 │ ├── 14554775_WA.cc │ ├── 14554787_WA.cc │ └── 14554799_AC_16MS_348K.cc ├── 2155 │ └── 14482130_AC_516MS_4480K.cc ├── 2159 │ ├── 14058280_WA.cpp │ ├── 14058292_WA.cpp │ ├── 14058328_WA.cpp │ ├── 14058416_WA.cpp │ └── 14058466_AC_0MS_148K.cpp ├── 2181 │ ├── 14815963_WA.cc │ └── 14816531_AC_63MS_1476K.cc ├── 2182 │ └── 14500227_AC_47MS_216K.cpp ├── 2184 │ ├── 14942721_WA.cc │ ├── 14942727_WA.cc │ ├── 14943761_WA.cc │ └── 14943792_AC_297MS_2704K.cc ├── 2186 │ ├── 14499199_AC_782MS_3260K.cc │ ├── 14499343_CE.cpp │ ├── 14499357_AC_813MS_2932K.cpp │ └── 14501044_WA.cpp ├── 2187 │ ├── 14268221_AC_141MS_1044K.cc │ └── 14268232_AC_125MS_752K.cc ├── 2190 │ ├── 14742170_WA.cc │ ├── 14742183_WA.cc │ └── 14742185_AC_16MS_388K.cc ├── 2192 │ └── 14705171_AC_47MS_724K.cc ├── 2195 │ ├── 14099277_WA.cpp │ ├── 14099285_WA.cpp │ ├── 14645443_AC_110MS_1136K.cc │ └── 14645451_AC_63MS_1016K.cc ├── 2196 │ ├── 14684691_WA.cc │ ├── 14684699_WA.cc │ └── 14684700_AC_0MS_340K.cc ├── 2209 │ └── 14912697_AC_32MS_356K.cc ├── 2229 │ ├── 14152345_RE.cpp │ ├── 14153166_RE.cpp │ └── 14153188_AC_125MS_4068K.cpp ├── 2231 │ ├── 14699353_WA.cc │ ├── 14699426_WA.cc │ ├── 14699435_TLE.cc │ └── 14699438_AC_985MS_432K.cc ├── 2234 │ └── 14742228_AC_0MS_384K.cc ├── 2236 │ ├── 14343104_CE.cpp │ ├── 14343108_WA.cc │ ├── 14343114_WA.cc │ └── 14343130_AC_3094MS_372K.cc ├── 2239 │ ├── 14922986_RE.cc │ ├── 14922991_RE.cc │ └── 14923001_AC_16MS_676K.cc ├── 2240 │ └── 14397211_AC_219MS_596K.cc ├── 2242 │ └── 14785589_AC_0MS_372K.cc ├── 2243 │ ├── 14552255_WA.cpp │ ├── 14552262_WA.cpp │ ├── 14552263_WA.cpp │ ├── 14552270_RE.cc │ ├── 14552273_WA.cc │ ├── 14552293_RE.cc │ ├── 14552295_RE.cc │ ├── 14552298_RE.cc │ ├── 14552381_WA.cc │ ├── 14552419_WA.cc │ ├── 14552427_AC_16MS_688K.cc │ ├── 14552453_WA.cc │ ├── 14552530_WA.cc │ ├── 14552677_AC_47MS_584K.cc │ └── 14552743_AC_63MS_584K.cc ├── 2244 │ ├── 14384426_CE.cpp │ └── 14384433_AC_79MS_156K.cpp ├── 2245 │ └── 14815338_AC_32MS_356K.cc ├── 2247 │ ├── 14824206_WA.cc │ └── 14824207_AC_47MS_376K.cc ├── 2249 │ ├── 14708576_WA.cc │ └── 14708608_AC_0MS_392K.cc ├── 2251 │ └── 14561380_AC_16MS_780K.cc ├── 2253 │ ├── 14094204_CE.c │ ├── 14094208_WA.cpp │ ├── 14094216_WA.cpp │ ├── 14094259_WA.cpp │ ├── 14094261_WA.cpp │ └── 14094264_AC_16MS_648K.cpp ├── 2255 │ └── 14313596_AC_0MS_148K.cpp ├── 2260 │ ├── 14827283_PE.cc │ └── 14827284_AC_16MS_408K.cc ├── 2262 │ ├── 13923669_AC_188MS_5264K.cpp │ ├── 13942490_RE.cpp │ ├── 13942492_CE.cpp │ ├── 13942496_WA.c │ └── 13942499_AC_141MS_5236K.c ├── 2286 │ ├── 14454458_WA.cc │ ├── 14454885_TLE.cc │ └── 14454975_AC_391MS_364K.cc ├── 2291 │ └── 14900274_AC_0MS_364K.cc ├── 2299 │ ├── 13759727_TLE.cpp │ ├── 13759734_TLE.cpp │ ├── 13763613_WA.cpp │ ├── 13763617_WA.cpp │ ├── 13763620_AC_1360MS_3956K.cpp │ ├── 14802379_RE.cc │ ├── 14802383_WA.cc │ └── 14802390_AC_391MS_3928K.cc ├── 2301 │ └── 14260737_AC_0MS_356K.cc ├── 2309 │ └── 14711108_AC_0MS_396K.cc ├── 2318 │ └── 14757058_AC_235MS_604K.cc ├── 2328 │ ├── 14770796_WA.cc │ └── 14770890_AC_16MS_352K.cc ├── 2350 │ └── 14299905_AC_16MS_172K.cpp ├── 2352 │ ├── 13943261_TLE.c │ ├── 13958785_TLE.cpp │ ├── 14028456_TLE.cpp │ ├── 14028495_TLE.cpp │ ├── 14192741_CE.cpp │ ├── 14192742_RE.cpp │ ├── 14192745_WA.cpp │ ├── 14192748_WA.cpp │ ├── 14192771_WA.cpp │ ├── 14192772_WA.cpp │ ├── 14192779_WA.cpp │ ├── 14192782_WA.cpp │ ├── 14192995_WA.cpp │ ├── 14193039_AC_141MS_444K.cpp │ ├── 14193045_WA.cpp │ ├── 14193052_TLE.cpp │ └── 14193053_AC_157MS_444K.cpp ├── 2362 │ ├── 14327181_WA.cpp │ ├── 14329088_WA.cpp │ ├── 14329204_AC_157MS_160K.cpp │ ├── 14329206_AC_813MS_160K.cpp │ └── 14329208_AC_141MS_160K.cpp ├── 2371 │ ├── 14714908_RE.cc │ ├── 14714910_RE.cc │ └── 14714914_AC_47MS_784K.cc ├── 2373 │ ├── 14444813_WA.cc │ ├── 14444988_WA.cc │ ├── 14444993_WA.cc │ ├── 14446804_TLE.cc │ ├── 14446957_AC_313MS_24464K.cc │ └── 14446964_AC_266MS_8800K.cc ├── 2376 │ ├── 14158059_TLE.cpp │ ├── 14158064_WA.cpp │ ├── 14158065_WA.cpp │ ├── 14158068_TLE.cpp │ ├── 14158069_TLE.cpp │ ├── 14158070_WA.cpp │ └── 14158072_AC_79MS_348K.cpp ├── 2377 │ ├── 14817563_WA.cc │ └── 14817581_AC_16MS_676K.cc ├── 2385 │ ├── 14176091_TLE.cpp │ └── 14176100_AC_0MS_332K.cpp ├── 2386 │ └── 14026549_AC_0MS_508K.cpp ├── 2387 │ ├── 13990141_WA.cpp │ ├── 13995896_WA.cpp │ ├── 13995897_WA.cpp │ ├── 13995953_WA.cpp │ ├── 13995964_WA.cpp │ ├── 13996106_AC_110MS_17396K.cpp │ ├── 13996107_AC_79MS_17396K.cpp │ ├── 13998265_WA.cpp │ ├── 14392052_WA.cc │ ├── 14392056_WA.cc │ └── 14392069_AC_16MS_432K.cc ├── 2388 │ └── 13860498_AC_16MS_176K.cpp ├── 2389 │ ├── 14367561_AC_16MS_728K.cc │ ├── 14367567_WA.cpp │ ├── 14367568_WA.cpp │ ├── 14367570_AC_0MS_132K.cpp │ ├── 14367571_AC_0MS_132K.cpp │ └── 14367598_AC_0MS_132K.cpp ├── 2390 │ └── 14225293_AC_47MS_396K.cc ├── 2392 │ ├── 14881694_CE.cc │ ├── 14881698_WA.cc │ ├── 14881705_WA.cc │ └── 14881731_AC_688MS_676K.cc ├── 2393 │ └── 14175145_AC_235MS_292K.cpp ├── 2395 │ └── 14823173_AC_79MS_524K.cc ├── 2403 │ ├── 14815768_RE.cc │ ├── 14815824_WA.cc │ ├── 14815861_WA.cc │ ├── 14815863_WA.cc │ ├── 14815877_WA.cc │ ├── 14815881_WA.cc │ ├── 14815900_WA.cc │ ├── 14815901_CE.cc │ ├── 14815903_WA.cc │ ├── 14815907_WA.cc │ └── 14815929_AC_0MS_364K.cc ├── 2405 │ └── 14798607_AC_0MS_412K.cc ├── 2406 │ ├── 14028031_OLE.cpp │ └── 14028035_AC_641MS_1108K.cpp ├── 2407 │ └── 14712803_AC_0MS_396K.cc ├── 2409 │ ├── 14910302_TLE.cc │ ├── 14910312_TLE.cc │ ├── 14910320_WA.cc │ ├── 14910329_TLE.cc │ ├── 14910338_TLE.cc │ ├── 14910342_AC_16MS_360K.cc │ └── 14910349_AC_0MS_360K.cc ├── 2411 │ ├── 14600605_TLE.cc │ ├── 14600732_WA.cc │ ├── 14600746_WA.cc │ ├── 14600829_WA.cc │ └── 14600871_AC_63MS_2292K.cc ├── 2413 │ ├── 14917977_WA.cc │ ├── 14917985_WA.cc │ └── 14917998_AC_16MS_22084K.cc ├── 2418 │ ├── 14298400_WA.cc │ ├── 14298402_WA.cpp │ └── 14298411_AC_1485MS_352K.cpp ├── 2421 │ └── 14267271_AC_79MS_900K.cc ├── 2431 │ ├── 14224875_WA.cc │ ├── 14224955_WA.cc │ ├── 14224961_WA.cc │ └── 14224968_AC_16MS_800K.cc ├── 2441 │ ├── 14969499_TLE.cc │ ├── 14969505_MLE.cc │ └── 14969647_AC_2094MS_8792K.cc ├── 2446 │ ├── 14830171_TLE.cc │ ├── 14830176_TLE.cc │ ├── 14831192_WA.cc │ ├── 14831199_WA.cc │ ├── 14831237_WA.cc │ ├── 14831252_WA.cc │ ├── 14831286_WA.cc │ ├── 14831348_WA.cc │ ├── 14831372_WA.cc │ ├── 14831419_AC_32MS_648K.cc │ └── 14831560_AC_32MS_440K.cc ├── 2449 │ ├── 14477909_WA.cc │ ├── 14477925_CE.cc │ ├── 14477927_MLE.cc │ ├── 14477937_MLE.cc │ ├── 14477938_MLE.cc │ ├── 14477945_MLE.cc │ ├── 14477950_CE.cc │ ├── 14477954_WA.cc │ ├── 14477956_MLE.cc │ ├── 14477957_MLE.cc │ └── 14478092_AC_313MS_6940K.cc ├── 2453 │ └── 14764672_AC_0MS_388K.cc ├── 2456 │ ├── 14153769_WA.cpp │ └── 14153945_AC_110MS_548K.cpp ├── 2470 │ └── 14886888_AC_266MS_716K.cc ├── 2478 │ ├── 14798051_WA.cc │ ├── 14798123_WA.cc │ ├── 14798158_WA.cc │ ├── 14798176_WA.cc │ ├── 14798276_WA.cc │ └── 14798296_AC_110MS_12156K.cc ├── 2479 │ ├── 13983541_TLE.cpp │ ├── 13983965_TLE.cpp │ ├── 13983993_WA.cpp │ ├── 13984008_WA.cpp │ ├── 13984012_WA.cpp │ ├── 13984016_WA.cpp │ ├── 13984025_WA.cpp │ ├── 13984032_WA.cpp │ └── 13984070_AC_454MS_1076K.cpp ├── 2481 │ ├── 14861920_WA.cc │ ├── 14861923_WA.cc │ ├── 14865377_WA.cc │ ├── 14865379_WA.cc │ └── 14865402_AC_2344MS_2708K.cc ├── 2485 │ ├── 14025592_WA.cpp │ └── 14025763_AC_329MS_948K.cpp ├── 2486 │ ├── 14497847_WA.cc │ ├── 14497871_WA.cc │ └── 14497985_AC_63MS_760K.cc ├── 2487 │ └── 14923109_AC_94MS_364K.cc ├── 2488 │ ├── 13982756_TLE.cpp │ ├── 13982819_TLE.cpp │ ├── 13982956_WA.cpp │ ├── 13982981_WA.cpp │ ├── 13983024_WA.cpp │ ├── 13983027_WA.cpp │ └── 13983083_AC_63MS_424K.cpp ├── 2492 │ ├── 14037467_WA.cpp │ ├── 14037477_WA.cpp │ ├── 14037480_WA.cpp │ ├── 14037496_CE.cpp │ ├── 14037500_WA.cpp │ ├── 14037513_WA.cpp │ ├── 14037520_AC_750MS_152K.cpp │ ├── 14037523_WA.cpp │ ├── 14037531_WA.cpp │ ├── 14037538_CE.cpp │ └── 14037541_AC_735MS_160K.cpp ├── 2498 │ └── 14919687_AC_1375MS_356K.cc ├── 2503 │ └── 13929195_AC_844MS_10488K.cpp ├── 2506 │ └── 14906781_AC_16MS_416K.cc ├── 2509 │ └── 14345498_AC_0MS_356K.cc ├── 2513 │ ├── 14089319_TLE.cpp │ ├── 14089484_WA.cpp │ ├── 14089686_WA.cpp │ ├── 14089705_WA.cc │ ├── 14092828_WA.c │ ├── 14092841_RE.cpp │ ├── 14092844_RE.cpp │ ├── 14092854_AC_1329MS_73332K.cpp │ └── 14092860_AC_1360MS_73332K.c ├── 2516 │ ├── 14799210_TLE.cc │ ├── 14799228_TLE.cc │ ├── 14799281_TLE.cc │ ├── 14799302_TLE.cc │ ├── 14802012_WA.cc │ ├── 14802018_AC_500MS_552K.cc │ └── 14802019_AC_532MS_756K.cc ├── 2521 │ └── 14598751_AC_0MS_356K.cc ├── 2524 │ ├── 13962767_WA.cpp │ ├── 13962788_CE.c │ ├── 13962791_WA.cpp │ └── 13962806_AC_313MS_588K.cpp ├── 2528 │ ├── 13940690_WA.cpp │ ├── 13940742_WA.cpp │ ├── 13942069_TLE.cpp │ ├── 13942072_TLE.cpp │ ├── 13956862_RE.cpp │ ├── 13957977_RE.cpp │ ├── 13957988_RE.cpp │ ├── 13958009_RE.cpp │ ├── 13958011_RE.cc │ ├── 13958065_RE.cpp │ ├── 13958096_RE.cpp │ └── 13958106_AC_79MS_1372K.cpp ├── 2531 │ ├── 14814507_WA.cc │ ├── 14814573_TLE.cc │ └── 14814579_AC_1188MS_356K.cc ├── 2533 │ ├── 13923549_WA.cpp │ ├── 13923566_WA.cpp │ ├── 13923574_WA.cpp │ ├── 13923581_WA.cpp │ ├── 13923608_WA.cpp │ ├── 13923613_WA.cpp │ ├── 13927884_WA.cpp │ ├── 13927896_WA.cpp │ ├── 13927916_WA.cpp │ ├── 13927940_WA.cpp │ ├── 13929209_AC_0MS_192K.cpp │ ├── 13937753_AC_32MS_144K.cpp │ ├── 13968019_AC_0MS_176K.cpp │ └── 14339630_AC_0MS_356K.cc ├── 2538 │ ├── 14872447_WA.cc │ ├── 14872457_WA.cc │ └── 14872463_AC_16MS_316K.cc ├── 2551 │ └── 14244955_AC_0MS_356K.cc ├── 2553 │ └── 14927472_AC_141MS_892K.cc ├── 2559 │ ├── 14289426_WA.cpp │ ├── 14289432_CE.cpp │ ├── 14289435_CE.cc │ ├── 14289439_WA.cc │ ├── 14289443_WA.cc │ ├── 14289680_WA.cc │ └── 14289686_AC_125MS_1160K.cc ├── 2562 │ ├── 14918102_CE.cc │ ├── 14918110_WA.cc │ └── 14918120_AC_0MS_356K.cc ├── 2566 │ ├── 14988990_WA.cc │ ├── 14989015_TLE.cc │ ├── 14989199_WA.cc │ ├── 14997065_WA.cc │ ├── 14997119_WA.cc │ ├── 14997140_WA.cc │ ├── 14997158_WA.cc │ ├── 15000033_AC_94MS_1164K.cc │ ├── 15000035_WA.cc │ ├── 15000218_WA.cc │ └── 15000237_AC_188MS_1168K.cc ├── 2575 │ ├── 14766023_WA.cc │ ├── 14766024_WA.cc │ └── 14766032_AC_16MS_396K.cc ├── 2578 │ └── 14340860_AC_0MS_132K.cpp ├── 2583 │ └── 14792642_AC_0MS_356K.cc ├── 2586 │ ├── 14716929_TLE.cc │ └── 14716975_AC_16MS_384K.cc ├── 2590 │ ├── 15090820_WA.cc │ └── 15090829_AC_0MS_2440K.cc ├── 2591 │ ├── 14819032_TLE.cc │ ├── 14819041_TLE.cc │ ├── 14819042_TLE.cc │ ├── 14819113_MLE.cc │ └── 14819210_AC_141MS_39528K.cc ├── 2593 │ ├── 14373413_RE.cpp │ ├── 14373423_AC_485MS_3420K.cpp │ ├── 14373459_AC_485MS_3392K.cpp │ └── 14373512_AC_204MS_1328K.cpp ├── 2602 │ ├── 14333982_TLE.cpp │ ├── 14333986_TLE.cpp │ ├── 14333990_TLE.c │ ├── 14333994_TLE.c │ ├── 14333996_WA.c │ ├── 14333999_WA.c │ ├── 14334009_WA.c │ ├── 14334012_WA.c │ ├── 14334020_AC_1500MS_1136K.c │ ├── 14334021_AC_469MS_1360K.cc │ └── 14334024_AC_454MS_1360K.cc ├── 2606 │ └── 14902298_AC_47MS_368K.cc ├── 2608 │ └── 14795358_AC_0MS_356K.cc ├── 2623 │ ├── 14819455_WA.cc │ ├── 14819461_WA.cc │ ├── 14819471_WA.cc │ ├── 14819477_AC_250MS_2312K.cc │ └── 15027259_WA.cc ├── 2624 │ ├── 14514241_WA.cpp │ └── 14514293_AC_0MS_148K.cpp ├── 2636 │ ├── 14297641_CE.cc │ ├── 14297648_CE.cc │ └── 14297661_AC_16MS_156K.c ├── 2653 │ └── 15086692_AC_657MS_584K.cc ├── 2656 │ └── 14258359_AC_0MS_356K.cc ├── 2663 │ ├── 14817338_TLE.cc │ └── 14817341_AC_0MS_356K.cc ├── 2665 │ └── 14336512_AC_16MS_396K.cc ├── 2676 │ └── 14436233_AC_1266MS_352K.cc ├── 2696 │ └── 14902356_AC_0MS_368K.cc ├── 2707 │ └── 14806182_AC_0MS_404K.cc ├── 2718 │ ├── 14157062_TLE.cpp │ ├── 14157078_WA.cpp │ ├── 14157092_WA.cpp │ ├── 14157094_WA.cpp │ ├── 14157099_TLE.cpp │ ├── 14157118_WA.cpp │ ├── 14157129_WA.cpp │ └── 14157165_AC_438MS_152K.cpp ├── 2719 │ └── 14684513_AC_141MS_356K.cc ├── 2728 │ ├── 14564091_WA.cc │ ├── 14564114_WA.cc │ └── 14672340_AC_1266MS_16488K.cc ├── 2739 │ ├── 14019558_CE.cpp │ ├── 14019561_CE.c │ ├── 14019564_TLE.c │ ├── 14019589_TLE.c │ ├── 14019639_CE.c │ ├── 14019652_CE.cpp │ ├── 14019681_CE.cpp │ ├── 14019682_CE.cpp │ ├── 14019699_AC_0MS_144K.cpp │ └── 14829260_AC_0MS_400K.cc ├── 2752 │ ├── 14634435_WA.cc │ └── 14634441_AC_454MS_6340K.cc ├── 2761 │ ├── 14744679_TLE.cc │ ├── 14744961_TLE.cc │ ├── 14744963_TLE.cc │ ├── 14745250_TLE.cc │ ├── 14745315_TLE.cpp │ ├── 14745996_TLE.cpp │ ├── 14746014_TLE.cc │ ├── 14746360_WA.cc │ ├── 14747048_RE.cc │ ├── 14747054_RE.cc │ ├── 14747059_RE.cpp │ ├── 14748042_WA.cc │ └── 14748125_AC_2938MS_14504K.cc ├── 2762 │ ├── 14894459_WA.cc │ ├── 14894719_WA.cc │ ├── 14932964_WA.cc │ ├── 14933371_RE.cc │ ├── 14933380_RE.cc │ ├── 14933399_WA.cc │ ├── 14933426_WA.cc │ └── 14933712_AC_329MS_688K.cc ├── 2769 │ ├── 14927713_TLE.cc │ ├── 14927781_TLE.cc │ ├── 14927783_CE.c │ └── 14927817_AC_235MS_436K.cc ├── 2774 │ ├── 14611641_WA.cc │ ├── 14611679_RE.cc │ ├── 14611687_AC_1985MS_3976K.cc │ ├── 14611845_AC_1938MS_4032K.cc │ └── 14612142_WA.cc ├── 2777 │ ├── 13956097_WA.cpp │ ├── 13956103_WA.cpp │ ├── 13956105_WA.cpp │ ├── 13956116_TLE.cpp │ ├── 13959578_WA.cpp │ ├── 13959586_WA.cpp │ ├── 13959592_WA.cpp │ ├── 13959595_WA.cpp │ ├── 13962361_WA.cpp │ ├── 13962368_WA.cpp │ ├── 13962400_WA.cpp │ ├── 14232085_WA.cc │ ├── 14232109_WA.cc │ ├── 14232651_WA.cc │ ├── 14232654_WA.cc │ ├── 14232667_WA.cc │ ├── 14232684_TLE.cc │ ├── 14240205_RE.cc │ ├── 14240208_AC_469MS_3440K.cc │ ├── 14240392_RE.cc │ └── 14240398_AC_469MS_2412K.cc ├── 2778 │ ├── 14872259_WA.cc │ ├── 15083682_WA.cc │ ├── 15083689_WA.cc │ ├── 15083709_TLE.cc │ └── 15083714_AC_985MS_9248K.cc ├── 2785 │ ├── 14166660_WA.cpp │ ├── 14166661_WA.cpp │ ├── 14166664_WA.cpp │ ├── 14166668_TLE.cpp │ └── 14166686_AC_7235MS_24708K.cpp ├── 2823 │ ├── 13942291_RE.cpp │ ├── 13942292_RE.cc │ ├── 13942297_CE.c │ ├── 13942300_RE.c │ ├── 13942302_RE.cpp │ ├── 13942312_RE.cpp │ ├── 13942357_RE.cpp │ ├── 13942362_AC_9438MS_20496K.cpp │ ├── 13942366_MLE.cpp │ ├── 13942367_MLE.cpp │ ├── 14286963_RE.cc │ ├── 14286965_TLE.cc │ ├── 14286971_AC_5407MS_4056K.c │ ├── 14286973_TLE.cc │ ├── 14286975_CE.cc │ ├── 14286976_TLE.cc │ ├── 15302826_TLE.cc │ ├── 15302829_AC_9500MS_20528K.cpp │ ├── 15302837_AC_8704MS_20528K.cpp │ ├── 15302841_TLE.c │ └── 15302845_CE.c ├── 2828 │ ├── 14321324_TLE.cpp │ └── 14323425_AC_1688MS_3260K.cpp ├── 2836 │ └── 15019824_TLE.cc ├── 2840 │ ├── 14366361_WA.cpp │ └── 14366415_AC_0MS_132K.cpp ├── 2853 │ └── 14795473_AC_0MS_356K.cc ├── 2871 │ ├── 14734699_WA.cc │ ├── 14734701_WA.cc │ └── 14734703_AC_0MS_372K.cc ├── 2909 │ └── 14555048_AC_0MS_760K.cc ├── 2924 │ └── 14826064_AC_0MS_356K.cc ├── 2965 │ ├── 13779558_WA.cpp │ ├── 13779561_WA.cpp │ ├── 13779564_AC_47MS_176K.cpp │ ├── 14286283_TLE.cc │ ├── 14286292_CE.c │ ├── 14286316_TLE.c │ └── 14286470_AC_16MS_340K.cc ├── 2976 │ ├── 14986219_WA.cc │ └── 14986229_AC_110MS_400K.cc ├── 2983 │ ├── 14932004_WA.cc │ ├── 14932007_WA.cc │ ├── 14932084_WA.cc │ └── 14932088_AC_610MS_2948K.cc ├── 3006 │ └── 14264253_AC_157MS_4664K.cc ├── 3009 │ ├── 14155280_TLE.cpp │ └── 14155287_AC_172MS_160K.cpp ├── 3013 │ ├── 14723548_RE.cc │ ├── 14723554_WA.cc │ ├── 14723557_WA.cc │ ├── 14723565_WA.cc │ ├── 14723569_WA.cc │ ├── 14723573_AC_688MS_2908K.cc │ ├── 14723610_TLE.cc │ └── 14723612_TLE.cc ├── 3020 │ └── 14909250_AC_0MS_428K.cc ├── 3030 │ └── 14098714_AC_0MS_152K.cpp ├── 3032 │ ├── 14865489_WA.cc │ └── 14865491_AC_0MS_356K.cc ├── 3040 │ └── 14179502_WA.cpp ├── 3041 │ ├── 14218414_WA.cc │ ├── 14218472_WA.cc │ ├── 14220124_RE.cc │ └── 14220129_AC_63MS_636K.cc ├── 3046 │ └── 14834224_AC_188MS_1140K.cc ├── 3050 │ ├── 14157753_CE.cpp │ └── 14157755_AC_79MS_628K.cpp ├── 3061 │ ├── 14159480_WA.cpp │ ├── 14159487_WA.cpp │ └── 14159492_AC_63MS_548K.cpp ├── 3062 │ ├── 14124949_OLE.c │ ├── 14124951_PE.c │ ├── 14124953_OLE.c │ ├── 14124955_PE.c │ ├── 14124965_OLE.c │ ├── 14124978_OLE.c │ ├── 14124987_RE.c │ ├── 14125003_AC_0MS_96K.c │ └── 14125020_OLE.c ├── 3067 │ ├── 14646184_WA.cc │ ├── 14646190_TLE.cc │ ├── 14646207_WA.cc │ ├── 14646248_WA.cc │ ├── 14646249_WA.cc │ ├── 14646276_WA.cc │ ├── 14646282_WA.cc │ ├── 14646286_WA.cc │ ├── 14646292_WA.cc │ ├── 14646294_WA.cc │ └── 14649791_AC_375MS_8224K.cc ├── 3069 │ └── 14371881_AC_16MS_136K.cpp ├── 3070 │ ├── 14280803_CE.cpp │ ├── 14280804_WA.cc │ └── 14280839_AC_0MS_356K.cc ├── 3077 │ └── 14699360_AC_0MS_396K.cc ├── 3080 │ └── 14692450_AC_0MS_696K.cc ├── 3083 │ ├── 14813764_AC_16MS_580K.cc │ ├── 14813912_TLE.cc │ └── 14813915_TLE.cc ├── 3085 │ └── 14715355_AC_0MS_356K.cc ├── 3086 │ └── 14699361_AC_0MS_396K.cc ├── 3090 │ └── 14870942_AC_94MS_360K.cc ├── 3093 │ └── 13929222_WA.cpp ├── 3094 │ └── 14027811_AC_0MS_128K.cpp ├── 3096 │ └── 14769013_AC_0MS_356K.cc ├── 3100 │ ├── 14366669_CE.cpp │ ├── 14366674_AC_0MS_384K.cc │ └── 14366722_AC_0MS_388K.cc ├── 3104 │ ├── 14980569_WA.cc │ ├── 14980744_WA.cc │ ├── 14980755_WA.cc │ ├── 14980764_RE.cc │ └── 14980784_AC_1079MS_768K.cc ├── 3117 │ ├── 14779402_WA.cc │ └── 14779415_AC_0MS_356K.cc ├── 3122 │ ├── 14885739_WA.cc │ ├── 14885746_WA.cc │ ├── 14885754_WA.cc │ └── 14885756_AC_32MS_404K.cc ├── 3126 │ └── 14601596_AC_16MS_644K.cc ├── 3159 │ ├── 14317051_WA.cpp │ ├── 14317074_WA.cpp │ ├── 14317219_WA.cpp │ ├── 14317224_WA.cpp │ ├── 14317226_TLE.cpp │ ├── 14317235_TLE.cpp │ ├── 14317238_TLE.cpp │ ├── 14317245_TLE.cpp │ ├── 14317248_TLE.cc │ ├── 14317269_AC_563MS_2752K.cc │ ├── 14317275_TLE.cc │ ├── 14317340_TLE.cc │ ├── 14317990_RE.cc │ ├── 14318003_WA.cpp │ ├── 14318072_WA.cpp │ ├── 14318103_CE.cpp │ ├── 14318109_CE.cpp │ ├── 14318125_RE.cpp │ ├── 14318126_RE.cpp │ ├── 14318127_AC_563MS_3364K.cpp │ ├── 14318130_AC_563MS_2540K.cpp │ ├── 14318135_RE.cpp │ ├── 14318137_RE.cpp │ ├── 14318138_RE.cc │ ├── 14318142_RE.cc │ ├── 14318143_AC_579MS_2540K.cpp │ └── 14486500_AC_1407MS_3360K.cc ├── 3164 │ ├── 14882302_WA.cc │ ├── 14882308_WA.cc │ ├── 14882358_WA.cpp │ ├── 14882370_WA.cpp │ └── 15061753_AC_110MS_488K.cc ├── 3169 │ ├── 14932196_WA.cc │ ├── 14932217_WA.cc │ ├── 14932318_WA.cc │ ├── 14932331_WA.cc │ ├── 14932391_WA.cc │ └── 14932809_AC_32MS_740K.cc ├── 3173 │ └── 14723713_AC_32MS_356K.cc ├── 3176 │ ├── 14057550_AC_63MS_696K.cpp │ └── 14057552_AC_32MS_696K.cpp ├── 3177 │ ├── 14825961_WA.cc │ ├── 14825968_WA.cc │ ├── 14825972_WA.cc │ ├── 14825977_WA.cc │ └── 14826038_AC_16MS_408K.cc ├── 3181 │ ├── 14210927_WA.cpp │ └── 14836770_AC_204MS_1980K.cc ├── 3185 │ ├── 15003606_WA.cc │ ├── 15003617_TLE.cc │ ├── 15003679_TLE.cc │ ├── 15003689_WA.cc │ ├── 15003710_TLE.cc │ └── 15003731_AC_422MS_388K.cc ├── 3187 │ └── 14157407_AC_63MS_152K.cpp ├── 3190 │ ├── 14947207_WA.cc │ ├── 14947305_WA.cc │ ├── 14947367_WA.cc │ ├── 14947409_WA.cc │ ├── 14947419_WA.cc │ └── 14949035_AC_422MS_1548K.cc ├── 3210 │ └── 14718972_AC_0MS_356K.cc ├── 3224 │ └── 14764588_AC_16MS_388K.cc ├── 3233 │ ├── 14324746_WA.cpp │ ├── 14324749_TLE.cpp │ ├── 14324753_TLE.cpp │ ├── 14675941_AC_1110MS_1108K.cc │ └── 14675944_AC_797MS_1072K.cc ├── 3250 │ ├── 14785453_WA.cc │ ├── 14785461_WA.cc │ └── 14785468_AC_172MS_672K.cc ├── 3253 │ ├── 13917281_WA.cpp │ ├── 13917288_AC_32MS_356K.cpp │ ├── 14043744_WA.cpp │ ├── 14043811_WA.cpp │ ├── 14043913_WA.cpp │ └── 14043919_AC_32MS_456K.cpp ├── 3254 │ ├── 14758470_RE.cc │ ├── 14758473_WA.cc │ ├── 14758481_WA.cc │ ├── 14758483_WA.cc │ ├── 14758493_WA.cc │ ├── 14758532_WA.cc │ ├── 14758541_WA.cc │ ├── 14758545_WA.cc │ ├── 14758555_WA.cc │ ├── 14758559_WA.cc │ ├── 14758655_TLE.cc │ ├── 14758659_WA.cc │ ├── 14758716_MLE.cc │ ├── 14758728_MLE.cc │ ├── 14758750_MLE.cc │ ├── 14759097_WA.cc │ ├── 14759116_AC_32MS_404K.cc │ ├── 14759132_WA.cc │ └── 14759137_AC_0MS_404K.cc ├── 3255 │ ├── 14257929_WA.cc │ ├── 14257931_WA.cc │ ├── 14257934_WA.cc │ ├── 14257938_WA.cc │ ├── 14257945_WA.cc │ └── 14257986_AC_235MS_3596K.cc ├── 3258 │ ├── 14972179_WA.cc │ └── 14972213_AC_110MS_572K.cc ├── 3259 │ ├── 14231615_AC_188MS_744K.cc │ ├── 14388706_AC_94MS_448K.cc │ ├── 14392133_AC_125MS_448K.cc │ └── 14487055_AC_188MS_764K.cc ├── 3261 │ ├── 14736876_WA.cc │ ├── 14736891_CE.cc │ └── 14736900_AC_79MS_780K.cc ├── 3264 │ ├── 13891811_AC_1766MS_13320K.cpp │ └── 13895597_AC_2188MS_1400K.cpp ├── 3267 │ ├── 14820714_WA.cc │ ├── 14820725_AC_172MS_372K.cc │ └── 14820993_AC_110MS_372K.cc ├── 3268 │ └── 14478290_AC_47MS_808K.cc ├── 3273 │ ├── 14649862_MLE.cc │ ├── 14649864_TLE.cc │ ├── 14650106_TLE.cc │ ├── 14650393_WA.cc │ ├── 14650410_WA.cc │ ├── 14650413_WA.cc │ ├── 14650416_WA.cc │ ├── 14650447_WA.cc │ ├── 14650448_WA.cc │ ├── 14650456_WA.cc │ └── 14650458_AC_94MS_1168K.cc ├── 3274 │ ├── 14897510_WA.cc │ ├── 14897517_WA.cc │ ├── 14897536_WA.cc │ ├── 14898527_WA.cc │ ├── 14898553_WA.cc │ ├── 14898567_WA.cc │ ├── 14898581_WA.cc │ └── 14898590_AC_360MS_28564K.cc ├── 3276 │ └── 14164824_AC_329MS_200K.cpp ├── 3277 │ ├── 14766051_WA.cc │ ├── 14766092_WA.cc │ ├── 14766119_WA.cc │ ├── 14766827_WA.cc │ ├── 14766837_TLE.cc │ ├── 14767683_RE.cc │ ├── 14767689_WA.cc │ ├── 14768451_WA.cc │ ├── 14768655_WA.cc │ ├── 14768664_TLE.cc │ ├── 14768673_TLE.cc │ └── 14768683_AC_172MS_7684K.cc ├── 3278 │ ├── 13862961_CE.cpp │ ├── 13862969_TLE.cpp │ ├── 13863002_WA.cpp │ ├── 13863272_RE.cpp │ ├── 13863278_RE.cpp │ ├── 13863280_AC_110MS_2548K.cpp │ ├── 14339846_AC_63MS_2640K.cc │ ├── 14339848_RE.cc │ ├── 14339850_RE.cc │ ├── 14339851_WA.cc │ ├── 14339857_WA.cc │ ├── 14339859_WA.cc │ ├── 14339860_CE.cc │ └── 14339861_WA.cc ├── 3279 │ ├── 14165199_CE.cpp │ ├── 14165210_WA.cpp │ ├── 14165227_WA.cpp │ ├── 14165247_WA.cpp │ ├── 14165282_WA.cpp │ ├── 14165308_WA.cpp │ ├── 14165321_WA.cpp │ ├── 14165345_WA.cpp │ ├── 14165362_WA.cpp │ ├── 14165372_WA.cpp │ ├── 14165381_WA.cpp │ ├── 14165431_WA.cc │ ├── 14165461_AC_797MS_372K.cc │ ├── 14165487_WA.cpp │ ├── 14165545_WA.cpp │ └── 14165572_AC_1110MS_180K.cpp ├── 3280 │ ├── 14833526_WA.cc │ ├── 14833548_WA.cc │ ├── 14833563_WA.cc │ └── 14833572_AC_16MS_12476K.cc ├── 3281 │ ├── 14547968_RE.cpp │ └── 14547997_AC_79MS_248K.cpp ├── 3292 │ └── 14922265_AC_47MS_8972K.cc ├── 3295 │ ├── 14891422_TLE.cc │ ├── 14891536_WA.cc │ ├── 14891563_WA.cc │ └── 14891570_AC_0MS_356K.cc ├── 3299 │ ├── 13724837_CE.c │ ├── 13724839_WA.cpp │ ├── 13724849_WA.cpp │ ├── 13724861_WA.c │ ├── 13724866_WA.c │ └── 14350462_AC_0MS_168K.cpp ├── 3302 │ └── 14702298_AC_0MS_500K.cc ├── 3318 │ ├── 14842486_WA.cc │ ├── 14842488_WA.cc │ ├── 14842492_WA.cc │ └── 14854180_AC_641MS_3388K.cc ├── 3320 │ ├── 14159886_WA.cpp │ ├── 14160161_TLE.cpp │ ├── 14160520_WA.cpp │ └── 14160590_AC_422MS_1520K.cpp ├── 3321 │ ├── 14352513_TLE.cpp │ ├── 14352601_TLE.cpp │ ├── 14352604_TLE.cpp │ ├── 14360551_WA.cpp │ ├── 14360648_TLE.cpp │ ├── 14360685_AC_391MS_4436K.cpp │ ├── 14459004_RE.cc │ ├── 14459008_TLE.cc │ └── 14459038_AC_1282MS_12212K.cc ├── 3325 │ └── 14699344_AC_0MS_396K.cc ├── 3348 │ ├── 14917198_WA.cc │ └── 14917227_AC_0MS_680K.cc ├── 3349 │ ├── 14037948_WA.cpp │ ├── 14041599_WA.cpp │ ├── 14041664_TLE.cpp │ ├── 14092093_WA.cpp │ ├── 14092101_WA.cpp │ └── 14092240_AC_3438MS_5680K.cpp ├── 3352 │ ├── 14765282_WA.cc │ ├── 14765771_WA.cc │ ├── 14765790_WA.cc │ ├── 14765798_WA.cc │ ├── 14765811_WA.cc │ ├── 14765956_AC_16MS_448K.cc │ ├── 14765972_CE.cc │ ├── 14765974_AC_32MS_448K.cc │ ├── 14825984_AC_0MS_448K.cc │ └── 14826000_AC_0MS_432K.cc ├── 3356 │ ├── 14827221_WA.cc │ └── 14827226_AC_0MS_4376K.cc ├── 3368 │ ├── 14720336_WA.cc │ └── 14720346_AC_1547MS_9752K.cc ├── 3372 │ ├── 14885889_WA.cc │ └── 14885913_AC_16MS_352K.cc ├── 3414 │ ├── 14795634_WA.cc │ ├── 14795667_TLE.cc │ ├── 14795669_WA.cc │ ├── 14795694_WA.cc │ ├── 14795699_WA.cc │ ├── 14795896_WA.cc │ ├── 14795905_WA.cc │ └── 14795916_AC_0MS_920K.cc ├── 3421 │ ├── 14968700_TLE.cc │ ├── 14968707_TLE.cc │ ├── 14969083_TLE.cc │ └── 14969344_RE.cc ├── 3422 │ ├── 14925333_WA.cc │ ├── 14925387_WA.cc │ ├── 14926912_WA.cc │ ├── 14926917_WA.cc │ └── 14926918_AC_110MS_708K.cc ├── 3436 │ └── 14512444_AC_0MS_184K.cpp ├── 3438 │ └── 14478174_AC_1094MS_376K.cc ├── 3461 │ ├── 14005064_AC_125MS_1172K.cpp │ └── 14485988_WA.cc ├── 3468 │ ├── 13725109_RE.cpp │ ├── 13725110_RE.cpp │ ├── 13725114_TLE.cpp │ ├── 13885964_TLE.cpp │ ├── 13885968_RE.cpp │ ├── 13886824_TLE.cpp │ ├── 13911662_WA.cpp │ ├── 13911672_WA.cpp │ ├── 13911680_WA.cpp │ ├── 13911688_WA.cpp │ ├── 13911868_WA.cpp │ ├── 13911893_WA.cpp │ ├── 13911972_WA.c │ ├── 13911985_WA.cpp │ ├── 13912004_WA.cpp │ ├── 13912039_WA.cpp │ ├── 13912370_AC_2016MS_6688K.cpp │ ├── 13912920_WA.cpp │ ├── 13912961_WA.cpp │ ├── 13912969_WA.cpp │ ├── 13912978_AC_2016MS_6688K.cpp │ ├── 13912984_AC_1969MS_6688K.cpp │ ├── 13913001_WA.cpp │ ├── 13913724_WA.cpp │ ├── 13913732_CE.cpp │ ├── 13913737_CE.cpp │ ├── 13913742_WA.cpp │ ├── 13913744_WA.c │ ├── 13913747_WA.c │ ├── 13913751_CE.c │ ├── 13913755_WA.c │ ├── 13913761_CE.c │ ├── 13913762_CE.cc │ ├── 13913764_CE.cpp │ ├── 13913767_CE.cpp │ ├── 13913771_AC_2250MS_5332K.cpp │ └── 13913772_AC_2282MS_5332K.cpp ├── 3469 │ ├── 14548525_RE.cpp │ ├── 14645500_TLE.cc │ ├── 14645533_AC_5125MS_16612K.cc │ ├── 14706525_AC_5235MS_16620K.cc │ ├── 14706616_RE.cc │ ├── 14706618_TLE.cc │ └── 14706627_AC_4844MS_11244K.cc ├── 3481 │ └── 14718751_AC_422MS_11184K.cc ├── 3507 │ ├── 14820996_WA.cc │ ├── 14821002_WA.cc │ ├── 14821005_WA.cc │ ├── 14821009_WA.cc │ └── 14821011_AC_0MS_364K.cc ├── 3518 │ └── 14699350_AC_63MS_6264K.cc ├── 3522 │ ├── 14822471_TLE.cc │ ├── 14822713_RE.cc │ └── 14822716_AC_141MS_440K.cc ├── 3579 │ ├── 14983634_WA.cc │ └── 14983651_AC_844MS_512K.cc ├── 3589 │ └── 14253716_AC_0MS_160K.cpp ├── 3614 │ ├── 14214590_WA.cpp │ ├── 14214594_WA.cc │ ├── 14214604_WA.cc │ ├── 14214614_WA.cc │ └── 14214624_AC_63MS_644K.cc ├── 3616 │ ├── 14179596_TLE.cpp │ ├── 14179625_WA.cpp │ └── 14179651_AC_16MS_332K.cpp ├── 3617 │ ├── 14212938_WA.cpp │ ├── 14541927_PE.cpp │ ├── 14541935_PE.cpp │ └── 14541987_AC_0MS_152K.cpp ├── 3619 │ └── 14813824_AC_47MS_356K.cc ├── 3620 │ └── 14819934_AC_16MS_612K.cc ├── 3623 │ ├── 14212965_WA.cpp │ ├── 14212970_WA.cpp │ ├── 14645617_RE.cc │ └── 14645622_AC_1313MS_416K.cc ├── 3624 │ ├── 13967980_RE.cpp │ ├── 13967984_AC_297MS_568K.cpp │ └── 14718840_AC_266MS_440K.cc ├── 3627 │ ├── 14814057_RE.cc │ └── 14814334_AC_32MS_428K.cc ├── 3628 │ └── 14829344_AC_172MS_356K.cc ├── 3630 │ ├── 14264928_TLE.cc │ ├── 14264968_TLE.cc │ ├── 14265069_TLE.cc │ ├── 14265319_TLE.cc │ ├── 14265322_TLE.cc │ ├── 14265394_WA.cc │ └── 14265660_AC_157MS_4664K.cc ├── 3632 │ └── 14712962_AC_0MS_400K.cc ├── 3637 │ └── 14891874_AC_94MS_428K.cc ├── 3650 │ └── 14678748_AC_0MS_340K.cc ├── 3660 │ ├── 14773342_WA.cc │ ├── 14773476_WA.cc │ └── 14773515_AC_47MS_408K.cc ├── 3663 │ └── 14734761_AC_47MS_436K.cc ├── 3664 │ └── 14771073_AC_94MS_1028K.cc ├── 3666 │ ├── 14939747_TLE.cc │ ├── 14939753_AC_235MS_16812K.cc │ └── 14939759_AC_125MS_396K.cc ├── 3667 │ ├── 14489550_WA.cc │ ├── 14489621_WA.cc │ ├── 14489711_WA.cc │ ├── 14507708_WA.cpp │ └── 14508407_AC_625MS_3256K.cpp ├── 3669 │ ├── 14161424_TLE.cpp │ ├── 14161441_TLE.cpp │ ├── 14161442_TLE.cpp │ ├── 14161467_WA.cpp │ ├── 14161494_WA.cpp │ ├── 14161496_TLE.cpp │ ├── 14161501_WA.cpp │ ├── 14161538_AC_110MS_1416K.cpp │ └── 14161542_TLE.cpp ├── 3671 │ └── 14921265_AC_32MS_704K.cc ├── 3672 │ └── 14792600_AC_63MS_452K.cc ├── 3673 │ ├── 14090192_WA.cc │ ├── 14090198_WA.c │ ├── 14090204_AC_0MS_132K.c │ └── 14090207_AC_0MS_132K.c ├── 3684 │ ├── 14166064_WA.cpp │ ├── 14166101_WA.cpp │ └── 14166104_WA.cpp ├── 3687 │ ├── 14938023_WA.cc │ ├── 14938134_WA.cc │ ├── 14938164_WA.cc │ ├── 15061067_WA.cc │ ├── 15061070_WA.cc │ ├── 15061093_WA.cc │ ├── 15061156_RE.cc │ ├── 15061160_WA.cc │ ├── 15061161_WA.cc │ ├── 15061181_WA.cc │ ├── 15061202_WA.cc │ ├── 15061218_TLE.cc │ ├── 15061231_TLE.cc │ ├── 15061243_TLE.cc │ ├── 15061254_TLE.cc │ ├── 15061262_TLE.cc │ └── 15061649_AC_47MS_772K.cc ├── 3723 │ └── 14258254_AC_344MS_1024K.cc ├── 3740 │ ├── 14737103_TLE.cc │ ├── 14737133_WA.cc │ ├── 14737141_TLE.cc │ ├── 14737442_RE.cc │ ├── 14737444_RE.cc │ ├── 14737452_RE.cc │ ├── 14737460_RE.cc │ └── 14737516_AC_813MS_412K.cc ├── 3748 │ └── 14881822_AC_0MS_356K.cc ├── 3749 │ └── 14678715_AC_0MS_332K.cc ├── 3750 │ └── 14715369_AC_16MS_356K.cc ├── 3751 │ └── 14865453_AC_0MS_356K.cc ├── 3800 │ └── 14908262_AC_0MS_-784K.c ├── 3903 │ ├── 13929229_WA.cpp │ └── 13929317_AC_63MS_1932K.cpp ├── 3977 │ ├── 15011920_CE.cc │ ├── 15011931_WA.cc │ ├── 15011954_WA.cc │ ├── 15011992_WA.cc │ ├── 15012015_WA.cc │ └── 15012261_AC_1954MS_16824K.cc ├── 3979 │ └── 14773545_AC_0MS_356K.cc ├── 3980 │ ├── 14256915_CE.cc │ ├── 14256917_OLE.c │ ├── 14256920_AC_125MS_160K.c │ ├── 14323047_WA.c │ └── 14323048_AC_110MS_148K.c ├── 3981 │ └── 14723653_AC_0MS_336K.cc ├── 3982 │ ├── 14885340_WA.cpp │ ├── 14885354_WA.cpp │ ├── 14885373_OLE.cpp │ ├── 14885376_WA.cpp │ ├── 14885405_WA.cpp │ └── 14885417_AC_16MS_756K.cc ├── 3983 │ ├── 14181454_AC_0MS_120K.c │ └── 14826220_AC_0MS_372K.cc ├── 3984 │ └── 14439122_AC_0MS_556K.cc ├── 1000 A+B Problem │ ├── description.md │ └── main.cpp ├── 1001 Exponentiation │ ├── description.md │ └── main.cpp ├── 1002 487-3279 │ ├── description.md │ ├── main.cpp │ └── main1.cpp ├── 1003 Hangover │ ├── description.md │ └── main.cpp ├── 1004 Financial Management │ ├── description.md │ └── main.cpp ├── 1005 I Think I Need a Houseboat │ ├── description.md │ └── main.cpp └── 1006 Biorhythms │ ├── description.md │ └── main.cpp └── poj-java └── 3468 A Simple Problem with Integers ├── Main.java ├── README.md └── main.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | a.out 2 | .idea 3 | cmake-build-debug 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 算法之路 2 | -------------------------------------------------------------------------------- /hihocoder/1032/description.md: -------------------------------------------------------------------------------- 1 | # 最长回文子串 2 | 3 | 求字符串的最长回文串 4 | 5 | -------------------------------------------------------------------------------- /hihocoder/1033/description.md: -------------------------------------------------------------------------------- 1 | # 数位 dp -------------------------------------------------------------------------------- /poj-cpp/1000 A+B Problem/description.md: -------------------------------------------------------------------------------- 1 | # A + B 2 | 3 | 计算两个整数a和b的和。 4 | -------------------------------------------------------------------------------- /poj-cpp/1000 A+B Problem/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a, b; 6 | 7 | scanf("%d%d", &a, &b); 8 | printf("%d\n", a + b); 9 | 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /poj-cpp/1000/13564208_AC_0MS_132K.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int a, b; 5 | scanf("%d%d", &a, &b); 6 | printf("%d", a+b); 7 | return 0; 8 | } -------------------------------------------------------------------------------- /poj-cpp/1000/14323055_AC_0MS_148K.c: -------------------------------------------------------------------------------- 1 | main(a,b){scanf("%d%d",&a,&b);printf("%d\n",a+b);} -------------------------------------------------------------------------------- /poj-cpp/1000/16285493_AC_0MS_372K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a,b; 6 | scanf("%d %d",&a, &b); 7 | printf("%d\n",a+b); 8 | return 0; 9 | } -------------------------------------------------------------------------------- /poj-cpp/1001 Exponentiation/description.md: -------------------------------------------------------------------------------- 1 | # Exponentiation 2 | 3 | 题意很简单,计算 a 的 n 次方 4 | 5 | a 可以是小数,n 不会超过 25,总之 double 存不下就是了,显然一道挺麻烦的高精度的题 6 | 7 | 需要注意的有以下两点: 8 | 9 | 结尾不要有多余的 0,比如: 1.23400 要输出 1.234 10 | 11 | 结果小于 1 不要输出前面的 0,比如: 0.001 要输出 .001 12 | 13 | -------------------------------------------------------------------------------- /poj-cpp/1001/15091689_WA.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.io.*; 3 | import java.math.*; 4 | 5 | public class Main { 6 | public static void main(String[] args) { 7 | Scanner cin = new Scanner(System.in); 8 | while(cin.hasNext()) { 9 | double x = cin.nextDouble(); 10 | int n = cin.nextInt(); 11 | BigDecimal A = new BigDecimal(x+"").pow(n); 12 | String s = A.toPlainString(); 13 | if(s.toCharArray()[0]=='0') 14 | System.out.println(s.substring(1)); 15 | else System.out.println(s); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/1001/15091735_AC_141MS_3424K.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.io.*; 3 | import java.math.*; 4 | 5 | public class Main { 6 | public static void main(String[] args) { 7 | Scanner cin = new Scanner(System.in); 8 | while(cin.hasNext()) { 9 | double x = cin.nextDouble(); 10 | int n = cin.nextInt(); 11 | BigDecimal A = new BigDecimal(x+"").pow(n); 12 | String s = A.stripTrailingZeros().toPlainString(); 13 | if(s.toCharArray()[0]=='0') 14 | System.out.println(s.substring(1)); 15 | else System.out.println(s); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/1003 Hangover/description.md: -------------------------------------------------------------------------------- 1 | # Hangover 2 | 3 | 一张卡片平放在一个平台上,可以把牌的一部分悬在平台外面(另一部分在平台上),并且保证牌不会掉下去。 4 | 5 | 如果只有一张牌的话,突出平台的部分最多是 1/2 。 6 | 7 | 如果只有两张牌的话,突出平台的部分最多是 1/2 + 1/3 。 8 | 9 | 如果只有三张牌的话,突出平台的部分最多是 1/2 + 1/3 + 1/4 。 10 | 11 | ... 12 | 13 | 给你一个数,你来判断最少要多少张牌才能使突出平台的部分达到这么大。 14 | 15 | 由于给定的数小于 5.20 ,所以直接暴力即可。 16 | 17 | -------------------------------------------------------------------------------- /poj-cpp/1003 Hangover/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | double d; 6 | 7 | while(scanf("%lf", &d) && d > 0.001) { 8 | int n = 2; 9 | double s = 0; 10 | while(s < d) 11 | s += 1.0 / n++; 12 | printf("%d card(s)\n", n - 2); 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/1003/13711096_PE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int i; 5 | double sum=0, n; 6 | while(scanf("%lf", &n)){ 7 | if(0==n) break; 8 | for(i=2; ; i++){ 9 | sum += 1/(double)i; 10 | if(sum>n) break; 11 | } 12 | printf("%dcard(s)\n", i-1); 13 | sum = 0; 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/1003/13711097_AC_0MS_148K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int i; 5 | double sum=0, n; 6 | while(scanf("%lf", &n)){ 7 | if(0==n) break; 8 | for(i=2; ; i++){ 9 | sum += 1/(double)i; 10 | if(sum>n) break; 11 | } 12 | printf("%d card(s)\n", i-1); 13 | sum = 0; 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/1004 Financial Management/description.md: -------------------------------------------------------------------------------- 1 | # Financial Management 2 | 3 | Larry 找到了一个工作,年底了要计算一下工资的平均数。 4 | 5 | 求12个数的平均数。 6 | 7 | 输出保留两位小数,并且前面一个 $ 符号 8 | 9 | Tips: G++ 提交注意输出 double 类型的变量要用 %f 而不是 %lf 10 | 11 | -------------------------------------------------------------------------------- /poj-cpp/1004 Financial Management/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | double mon, sum = 0; 6 | 7 | while(~scanf("%lf", &mon)) 8 | sum += mon; 9 | printf("$%.2f", sum / 12); 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /poj-cpp/1004/13711057_AC_0MS_148K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | double sum, month; 5 | int t, i; 6 | while(scanf("%lf", &sum)!=EOF){ 7 | for(i=0; i<11; i++){ 8 | scanf("%lf", &month); 9 | sum += month; 10 | } 11 | sum /= 12; 12 | t = (int)(sum*100); 13 | sum = (double)t/100; 14 | printf("$%lg\n", sum); 15 | } 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /poj-cpp/1005 I Think I Need a Houseboat/description.md: -------------------------------------------------------------------------------- 1 | # I Think I Need a Houseboat 2 | 3 | 说有个人啊,住在一个小岛上的某个位置 P ,坐标是 (x, y) ,然后有一天,小岛的中心 (0, 0) 位置开始以一个半圆的形状像这人住的方向开始腐蚀了,并且速度是每年 50 平方米,他想知道他还能在这住多少年? 4 | 5 | 输入数据不会发生他正好住在某年的边界上这种情况。 6 | 7 | -------------------------------------------------------------------------------- /poj-cpp/1005 I Think I Need a Houseboat/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int T; 6 | double x, y; 7 | 8 | scanf("%d", &T); 9 | for(int nC = 1; nC <= T; nC++) { 10 | scanf("%lf%lf", &x, &y); 11 | double s = (x * x + y * y) * 3.1415926535; 12 | int ans = (s / 100) + 1; 13 | printf("Property %d: This property will begin eroding in year %d.\n", nC, ans); 14 | } 15 | printf("END OF OUTPUT."); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/1005/13715971_AC_0MS_148K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define PI 3.1416 5 | 6 | int main(){ 7 | double x, y, r, s; 8 | int nCase, day, t=0; 9 | scanf("%d", &nCase); 10 | while(nCase--){ 11 | day = 0; 12 | scanf("%lf%lf", &x, &y); 13 | r = sqrt(x*x+y*y); 14 | s = PI*r*r/2; 15 | day = s/50; 16 | printf("Property %d: This property will begin eroding in year %d.\n", ++t, day+1); 17 | } 18 | printf("END OF OUTPUT.\n"); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/1006 Biorhythms/description.md: -------------------------------------------------------------------------------- 1 | # Biorhythms 2 | 3 | 人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例如,智力周期的高峰,人会思维敏捷,精力容易高度集中。因为三个周期的周长不同,所以通常三个周期的高峰不会落在同一天。对于每个人,我们想知道何时三个高峰落在同一天。对于每个周期,我们会给出从当前年份的第一天开始,到出现高峰的天数(不一定是第一次高峰出现的时间)。你的任务是给定一个从当年第一天开始数的天数,输出从给定时间开始(不包括给定时间)下一次三个高峰落在同一天的时间(距给定时间的天数)。例如:给定时间为10,下次出现三个高峰同天的时间是12,则输出2(注意这里不是3)。 4 | 5 | 采用以下格式: 6 | 7 | Case 1: the next triple peak occurs in 1234 days. 8 | 9 | 注意:即使结果是1天,也使用复数形式“days”。 10 | -------------------------------------------------------------------------------- /poj-cpp/1006 Biorhythms/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int p, e, i, d, a, c = 1; 6 | 7 | while(scanf("%d%d%d%d", &p, &e, &i, &d) && p >= 0) { 8 | for(a = d + 1; ; a++) { 9 | if((a - p) % 23 == 0 && 10 | (a - e) % 28 == 0 && 11 | (a - i) % 33 == 0) 12 | break; 13 | } 14 | printf("Case %d: the next triple peak occurs in %d days.\n", c++, a - d); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/1006/13715705_AC_719MS_132K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int p, e, i, d, day, nCase=0, t; 5 | while(scanf("%d%d%d%d", &p, &e, &i, &d)){ 6 | if(-1==p) break; 7 | for(day=1; day<=21252; day++){ 8 | t = day+d; 9 | if(0==(t-p)%23 && 0==(t-e)%28 && 0==(t-i)%33) 10 | break; 11 | } 12 | printf("Case %d: the next triple peak occurs in %d days.\n", ++nCase, day); 13 | } 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /poj-cpp/1012/13890527_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int solve(int n, int k); 4 | 5 | int main(){ 6 | int k, i, t; 7 | 8 | while(scanf("%d", &k), k){ 9 | for(i=1; ; i++){ 10 | if(solve(k, i)) break; 11 | } 12 | printf("%d\n", i); 13 | } 14 | 15 | return 0; 16 | } 17 | 18 | int solve(int n, int k){ 19 | int i, t, sum; 20 | sum = n*2; 21 | for(i=0, t=-1; i 2 | 3 | int solve(int n, int k); 4 | 5 | int main(){ 6 | int k, i, t; 7 | 8 | while(scanf("%d", &k), k){ 9 | t=k*2; 10 | for(i=1; ; i++){ 11 | if(i%t 2 | #include 3 | 4 | double VS, R, C, omg; 5 | int N; 6 | 7 | int main() 8 | { 9 | scanf("%lf%lf%lf%d", &VS, &R, &C, &N); 10 | while(N--) { 11 | scanf("%lf", &omg); 12 | double ans = C*R*omg*VS/sqrt(1+(C*R*omg)*(C*R*omg)); 13 | printf("%.3f\n", ans); 14 | } 15 | 16 | return 0; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /poj-cpp/1045/14649736_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double VS, R, C, omg; 5 | int N; 6 | 7 | int main() 8 | { 9 | scanf("%lf%lf%lf%d", &VS, &R, &C, &N); 10 | while(N--) { 11 | scanf("%lf", &omg); 12 | double ans = C*R*omg*VS/sqrt(1+(C*R*omg)*(C*R*omg)); 13 | printf("%.3lf\n", ans); 14 | } 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /poj-cpp/1050/13827328_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int i, j, N, root[128][128]; 5 | 6 | while(~scanf("%d", &N)){ 7 | for(i=0; i=0; i--){ 14 | for(j=0; j<=i; j++){ 15 | root[i][j] += root[i+1][j]>root[i+1][j+1]?root[i+1][j]:root[i+1][j+1]; 16 | } 17 | } 18 | 19 | printf("%d\n", root[0][0]); 20 | } 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13724980_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int x, y, m, n, l; 5 | int cnt; 6 | 7 | while(scanf("%d%d%d%d%d", &x, &y, &m, &n, &l)!=EOF){ 8 | cnt = 0; 9 | while(x!=y){ 10 | x += m; 11 | if(x>=l) x%=l; 12 | y += n; 13 | if(y>=l) y%=l; 14 | cnt ++; 15 | } 16 | printf("%d\n", cnt); 17 | } 18 | return 0; 19 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13724982_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int x, y, m, n, l; 5 | int cnt; 6 | 7 | while(scanf("%d%d%d%d%d", &x, &y, &m, &n, &l)!=EOF){ 8 | cnt = 0; 9 | if(x!=y && m==n){ 10 | printf("Impossible\n"); 11 | continue; 12 | } 13 | while(x!=y){ 14 | x += m; 15 | if(x>=l) x%=l; 16 | y += n; 17 | if(y>=l) y%=l; 18 | cnt ++; 19 | } 20 | printf("%d\n", cnt); 21 | } 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /poj-cpp/1061/13724987_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int x, y, m, n, l; 5 | int cnt; 6 | 7 | while(scanf("%d%d%d%d%d", &x, &y, &m, &n, &l)!=EOF){ 8 | cnt = 0; 9 | if(x!=y && m==n){ 10 | printf("Impossible\n"); 11 | continue; 12 | } 13 | while(x!=y){ 14 | x += m; 15 | if(x>=l) x%=l; 16 | y += n; 17 | if(y>=l) y%=l; 18 | cnt ++; 19 | if(cnt==99999){ 20 | printf("Impossible\n"); 21 | break; 22 | } 23 | } 24 | if(cnt!=99999) printf("%d\n", cnt); 25 | } 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/1061/13724988_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int x, y, m, n, l; 5 | int cnt; 6 | 7 | while(scanf("%d%d%d%d%d", &x, &y, &m, &n, &l)!=EOF){ 8 | cnt = 0; 9 | if(x!=y && m==n){ 10 | printf("Impossible\n"); 11 | continue; 12 | } 13 | while(x!=y){ 14 | x += m; 15 | if(x>=l) x%=l; 16 | y += n; 17 | if(y>=l) y%=l; 18 | cnt ++; 19 | if(cnt==999999){ 20 | printf("Impossible\n"); 21 | break; 22 | } 23 | } 24 | if(cnt!=99999) printf("%d\n", cnt); 25 | } 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/1061/13724989_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int x, y, m, n, l; 5 | int cnt; 6 | 7 | while(scanf("%d%d%d%d%d", &x, &y, &m, &n, &l)!=EOF){ 8 | cnt = 0; 9 | if(x!=y && m==n){ 10 | printf("Impossible\n"); 11 | continue; 12 | } 13 | while(x!=y){ 14 | x += m; 15 | if(x>=l) x%=l; 16 | y += n; 17 | if(y>=l) y%=l; 18 | cnt ++; 19 | if(cnt==9999999){ 20 | printf("Impossible\n"); 21 | break; 22 | } 23 | } 24 | if(cnt!=99999) printf("%d\n", cnt); 25 | } 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/1061/13870638_WA.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | 5 | int main(){ 6 | int x, y, a, b, L, i, t1, t2, faild; 7 | 8 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 9 | t1 = y-x; 10 | if(!t1){ 11 | printf("0\n"); 12 | continue; 13 | } 14 | t2 = 1; 15 | faild = 0; 16 | for(i=1; ; i++){ 17 | t2 = a*i%L - b*i%L; 18 | if(t2==t1) break; 19 | if(!t2){ 20 | faild = 1; 21 | break; 22 | } 23 | } 24 | if(faild) printf("Impossible\n"); 25 | else printf("%d\n", i); 26 | } 27 | 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /poj-cpp/1061/13870642_TLE.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | 5 | int main(){ 6 | long long x, y, a, b, L, i, t1, t2, faild; 7 | 8 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 9 | t1 = y-x; 10 | if(!t1){ 11 | printf("0\n"); 12 | continue; 13 | } 14 | t2 = 1; 15 | faild = 0; 16 | for(i=1; ; i++){ 17 | t2 = a*i%L - b*i%L; 18 | if(t2==t1) break; 19 | if(!t2){ 20 | faild = 1; 21 | break; 22 | } 23 | } 24 | if(faild) printf("Impossible\n"); 25 | else printf("%lld\n", i); 26 | } 27 | 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /poj-cpp/1061/13870667_CE.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | 5 | int main(){ 6 | _int64 x, y, a, b, L, i, t1, t2, faild; 7 | 8 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 9 | t1 = y-x; 10 | if(!t1){ 11 | printf("0\n"); 12 | continue; 13 | } 14 | t2 = 1; 15 | faild = 0; 16 | for(i=1; ; i++){ 17 | t2 = a*i%L - b*i%L; 18 | if(t2==t1) break; 19 | if(!t2){ 20 | faild = 1; 21 | break; 22 | } 23 | } 24 | if(faild) printf("Impossible\n"); 25 | else printf("%I64d\n", i); 26 | } 27 | 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /poj-cpp/1061/13870670_TLE.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | 5 | int main(){ 6 | long long x, y, a, b, L, i, t1, t2, faild; 7 | 8 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 9 | t1 = y-x; 10 | if(!t1){ 11 | printf("0\n"); 12 | continue; 13 | } 14 | t2 = 1; 15 | faild = 0; 16 | for(i=1; ; i++){ 17 | t2 = a*i%L - b*i%L; 18 | if(t2==t1) break; 19 | if(!t2){ 20 | faild = 1; 21 | break; 22 | } 23 | } 24 | if(faild) printf("Impossible\n"); 25 | else printf("%Ild\n", i); 26 | } 27 | 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /poj-cpp/1061/13870710_WA.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | 5 | int main(){ 6 | long long x, y, a, b, L, i, t1, t2, faild; 7 | 8 | while(~scanf("%lld%lld%lld%lld%lld", &x, &y, &a, &b, &L)){ 9 | t1 = y-x; 10 | if(!t1){ 11 | printf("0\n"); 12 | continue; 13 | } 14 | t2 = 1; 15 | faild = 0; 16 | for(i=1; ; i++){ 17 | t2 = a*i%L - b*i%L; 18 | if(t2==t1) break; 19 | if(!t2){ 20 | faild = 1; 21 | break; 22 | } 23 | } 24 | if(faild) printf("Impossible\n"); 25 | else printf("%Ild\n", i); 26 | } 27 | 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /poj-cpp/1061/13873403_WA.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | int gcd(int a, int b){ 6 | if(!b) return a; 7 | else return gcd(b, a%b); 8 | } 9 | 10 | int lcm(int a, int b){ 11 | return a*b/gcd(a, b); 12 | } 13 | 14 | 15 | int main(){ 16 | int x, y, a, b, L, n, i; 17 | 18 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | if(x==y){ 22 | printf("0\n"); 23 | continue; 24 | } 25 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 26 | for(i=1; i<=n; i++){ 27 | if( (x+a*i)%L == (y+b*i)%L ) break; 28 | } 29 | if(i==n+1) printf("Impossible\n"); 30 | else printf("%d\n", i); 31 | 32 | } 33 | 34 | return 0; 35 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873404_WA.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | int gcd(int a, int b){ 6 | if(!b) return a; 7 | else return gcd(b, a%b); 8 | } 9 | 10 | int lcm(int a, int b){ 11 | return a*b/gcd(a, b); 12 | } 13 | 14 | 15 | int main(){ 16 | int x, y, a, b, L, n, i; 17 | 18 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | 22 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 23 | for(i=1; i<=n; i++){ 24 | if( (x+a*i)%L == (y+b*i)%L ) break; 25 | } 26 | if(i==n+1) printf("Impossible\n"); 27 | else printf("%d\n", i); 28 | 29 | } 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873433_WA.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | int gcd(int a, int b){ 6 | if(!b) return a; 7 | else return gcd(b, a%b); 8 | } 9 | 10 | int lcm(int a, int b){ 11 | return a*b/gcd(a, b); 12 | } 13 | 14 | 15 | int main(){ 16 | long long x, y, a, b, L, n, i; 17 | 18 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | 22 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 23 | for(i=1; i<=n; i++){ 24 | if( (x+a*i)%L == (y+b*i)%L ) break; 25 | } 26 | if(i==n+1) printf("Impossible\n"); 27 | else printf("%d\n", i); 28 | 29 | } 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873438_WA.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | int gcd(int a, int b){ 6 | if(!b) return a; 7 | else return gcd(b, a%b); 8 | } 9 | 10 | int lcm(int a, int b){ 11 | return a*b/gcd(a, b); 12 | } 13 | 14 | 15 | int main(){ 16 | long long x, y, a, b, L, n, i; 17 | 18 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | 22 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 23 | for(i=1; i<=n; i++){ 24 | if( (x+a*i)%L == (y+b*i)%L ) break; 25 | } 26 | if(i==n+1) printf("Impossible\n"); 27 | else printf("%lld\n", i); 28 | 29 | } 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873441_WA.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | int gcd(int a, int b){ 6 | if(!b) return a; 7 | else return gcd(b, a%b); 8 | } 9 | 10 | int lcm(int a, int b){ 11 | return a*b/gcd(a, b); 12 | } 13 | 14 | 15 | int main(){ 16 | long long x, y, a, b, L, n, i; 17 | 18 | while(~scanf("%lld%lld%lld%lld%lld", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | 22 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 23 | for(i=1; i<=n; i++){ 24 | if( (x+a*i)%L == (y+b*i)%L ) break; 25 | } 26 | if(i==n+1) printf("Impossible\n"); 27 | else printf("%lld\n", i); 28 | 29 | } 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873449_WA.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | int gcd(int a, int b){ 6 | if(!b) return a; 7 | else return gcd(b, a%b); 8 | } 9 | 10 | int lcm(int a, int b){ 11 | return a*b/gcd(a, b); 12 | } 13 | 14 | 15 | int main(){ 16 | long long x, y, a, b, L, n, i; 17 | 18 | while(~scanf("%lld%lld%lld%lld%lld", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | 22 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 23 | for(i=1; i<=n; i++){ 24 | if( (x+a*i)%L == (y+b*i)%L ) break; 25 | } 26 | if(i==n+1) printf("Impossible\n"); 27 | else printf("%lld\n", i); 28 | 29 | } 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873500_TLE.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | long long gcd(long long a, long long b){ 5 | if(!b) return a; 6 | else return gcd(b, a%b); 7 | } 8 | 9 | long long lcm(long long a, long long b){ 10 | return a*b/gcd(a, b); 11 | } 12 | 13 | 14 | int main(){ 15 | long long x, y, a, b, L, n, i; 16 | 17 | while(~scanf("%lld%lld%lld%lld%lld", &x, &y, &a, &b, &L)){ 18 | 19 | x %= L; y %= L; a %= L; b %= L; 20 | if(x==y){ 21 | printf("0\n"); 22 | continue; 23 | } 24 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 25 | for(i=1; i<=n; i++){ 26 | if( (x+a*i)%L == (y+b*i)%L ) break; 27 | } 28 | if(i==n+1) printf("Impossible\n"); 29 | else printf("%lld\n", i); 30 | 31 | } 32 | 33 | return 0; 34 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873545_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int gcd(int a, int b){ 5 | if(!b) return a; 6 | else return gcd(b, a%b); 7 | } 8 | 9 | long long lcm(int a, int b){ 10 | return a*b/gcd(a, b); 11 | } 12 | 13 | 14 | int main(){ 15 | int x, y, a, b, L; 16 | long long n, i; 17 | 18 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | 22 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 23 | for(i=1; i<=n; i++){ 24 | if( (x+a*i)%L == (y+b*i)%L ) break; 25 | } 26 | if(i==n+1) printf("Impossible\n"); 27 | else printf("%lld\n", i); 28 | 29 | } 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /poj-cpp/1061/13873550_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int gcd(int a, int b){ 5 | if(!b) return a; 6 | else return gcd(b, a%b); 7 | } 8 | 9 | long long lcm(int a, int b){ 10 | return (long long)a*b/gcd(a, b); 11 | } 12 | 13 | 14 | int main(){ 15 | int x, y, a, b, L; 16 | long long n, i; 17 | 18 | while(~scanf("%d%d%d%d%d", &x, &y, &a, &b, &L)){ 19 | 20 | x %= L; y %= L; a %= L; b %= L; 21 | 22 | n = lcm(L/gcd(L, a), L/gcd(L, b)); 23 | for(i=1; i<=n; i++){ 24 | if( (x+a*i)%L == (y+b*i)%L ) break; 25 | } 26 | if(i==n+1) printf("Impossible\n"); 27 | else printf("%lld\n", i); 28 | 29 | } 30 | 31 | return 0; 32 | } -------------------------------------------------------------------------------- /poj-cpp/1064/14720367_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const int maxn = 10005; 4 | const int INF = 0x3f3f3f3f; 5 | int N, K; 6 | double len[maxn]; 7 | 8 | int is_ok(double d) 9 | { 10 | int cnt = 0; 11 | for(int i=0; i= K; 14 | } 15 | 16 | int main() 17 | { 18 | scanf("%d%d", &N, &K); 19 | for(int i=0; i0.001) { 23 | double m = (l+r) / 2; 24 | if(is_ok(m)) l = m; 25 | else r = m; 26 | } 27 | printf("%.2f\n", l); 28 | 29 | return 0; 30 | } -------------------------------------------------------------------------------- /poj-cpp/1064/14720369_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const int maxn = 10005; 4 | const int INF = 0x3f3f3f3f; 5 | int N, K; 6 | double len[maxn]; 7 | 8 | int is_ok(double d) 9 | { 10 | int cnt = 0; 11 | for(int i=0; i= K; 14 | } 15 | 16 | int main() 17 | { 18 | scanf("%d%d", &N, &K); 19 | for(int i=0; i0.0001) { 23 | double m = (l+r) / 2; 24 | if(is_ok(m)) l = m; 25 | else r = m; 26 | } 27 | printf("%.2f\n", l); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /poj-cpp/1064/14720370_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const int maxn = 10005; 5 | const int INF = 0x3f3f3f3f; 6 | int N, K; 7 | double len[maxn]; 8 | 9 | int is_ok(double d) 10 | { 11 | int cnt = 0; 12 | for(int i=0; i= K; 15 | } 16 | 17 | int main() 18 | { 19 | scanf("%d%d", &N, &K); 20 | for(int i=0; i0.0001) { 24 | double m = (l+r) / 2; 25 | if(is_ok(m)) l = m; 26 | else r = m; 27 | } 28 | printf("%.2f\n", l); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /poj-cpp/1067/14675963_AC_16MS_352K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const double d = (sqrt(5)+1)/2; 5 | 6 | int main() 7 | { 8 | int a, b, k; 9 | 10 | while(~scanf("%d%d", &a, &b)) { 11 | if(a>b) a^=b^=a^=b; 12 | k = b-a; 13 | if(a==(int)(d*k)) 14 | printf("0\n"); 15 | else printf("1\n"); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/1083/14260736_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int arr[500]; 5 | 6 | int main() 7 | { 8 | int T, a, b, i, N; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | memset(arr, 0, sizeof(arr)); 13 | scanf("%d", &N); 14 | while(N--) { 15 | scanf("%d%d", &a, &b); 16 | for(i=a; i<=b; i++) arr[i]++; 17 | } 18 | int maxn = 0; 19 | for(i=0; i<=400; i++) 20 | if(arr[i]>maxn) maxn = arr[i]; 21 | printf("%d\n", maxn*10); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/1083/14260843_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int arr[500]; 5 | 6 | int main() 7 | { 8 | int T, a, b, i, N; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | memset(arr, 0, sizeof(arr)); 13 | scanf("%d", &N); 14 | while(N--) { 15 | scanf("%d%d", &a, &b); 16 | if(a>b) a^=b^=a^=b; 17 | for(i=a; i<=b; i++) arr[i]++; 18 | } 19 | int maxn = 0; 20 | for(i=0; i<=400; i++) 21 | if(arr[i]>maxn) maxn = arr[i]; 22 | printf("%d\n", maxn*10); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/1157/14296012_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int maps[110][110], dp[110][110], F, V; 8 | 9 | int main() 10 | { 11 | int i, j; 12 | 13 | scanf("%d%d", &F, &V); 14 | for(i=1; i<=F; i++) { 15 | for(j=1; j<=V; j++) { 16 | scanf("%d", &maps[i][j]); 17 | } 18 | } 19 | memset(dp, 0, sizeof(dp)); 20 | for(i=1; i<=F; i++) { 21 | for(j=1; j<=V; j++) { 22 | dp[i][j] = max(dp[i][j-1], dp[i-1][j-1]+maps[i][j]); 23 | } 24 | } 25 | printf("%d\n", dp[F][V]); 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /poj-cpp/1157/14296021_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int maps[110][110], dp[110][110], F, V; 8 | 9 | int main() 10 | { 11 | int i, j; 12 | 13 | scanf("%d%d", &F, &V); 14 | for(i=1; i<=F; i++) { 15 | for(j=1; j<=V; j++) { 16 | scanf("%d", &maps[i][j]); 17 | } 18 | } 19 | for(i=0; i<=F; i++) for(j=0; j<=V; j++) dp[i][j] = -99999; 20 | for(i=1; i<=F; i++) { 21 | for(j=1; j<=V; j++) { 22 | dp[i][j] = max(dp[i][j-1], dp[i-1][j-1]+maps[i][j]); 23 | } 24 | } 25 | printf("%d\n", dp[F][V]); 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /poj-cpp/1157/14296209_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int maps[110][110], dp[110][110], F, V; 8 | 9 | int main() 10 | { 11 | int i, j; 12 | 13 | scanf("%d%d", &F, &V); 14 | for(i=1; i<=F; i++) { 15 | for(j=1; j<=V; j++) { 16 | scanf("%d", &maps[i][j]); 17 | } 18 | } 19 | memset(dp, 0, sizeof(dp)); 20 | for(i=1; i<=F; i++) dp[i][i] = dp[i-1][i-1]+maps[i][i]; 21 | for(i=1; i<=F; i++) { 22 | for(j=i+1; j<=V; j++) { 23 | dp[i][j] = max(dp[i][j-1], dp[i-1][j-1]+maps[i][j]); 24 | } 25 | } 26 | for(i=1; i<=F; i++) { 27 | for(j=1; j<=V; j++) printf("%d ", dp[i][j]); 28 | printf("\n"); 29 | } 30 | printf("%d\n", dp[F][V]); 31 | 32 | return 0; 33 | } -------------------------------------------------------------------------------- /poj-cpp/1157/14296239_AC_0MS_468K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int maps[110][110], dp[110][110], F, V; 8 | 9 | int main() 10 | { 11 | int i, j; 12 | 13 | scanf("%d%d", &F, &V); 14 | for(i=1; i<=F; i++) { 15 | for(j=1; j<=V; j++) { 16 | scanf("%d", &maps[i][j]); 17 | } 18 | } 19 | memset(dp, 0, sizeof(dp)); 20 | for(i=1; i<=F; i++) dp[i][i] = dp[i-1][i-1]+maps[i][i]; 21 | for(i=1; i<=F; i++) { 22 | for(j=i+1; j<=V; j++) { 23 | dp[i][j] = max(dp[i][j-1], dp[i-1][j-1]+maps[i][j]); 24 | } 25 | } 26 | printf("%d\n", dp[F][V]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975884_MLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int d[7000][7000]; 8 | 9 | int main() 10 | { 11 | int N, i, j; 12 | char str[8000]; 13 | 14 | scanf("%d", &N); 15 | scanf("%s", str+1); 16 | memset(d, 0, sizeof(d)); 17 | for (i=N; i>0; i--) { 18 | for (j=i; j<=N; j++) { 19 | if (str[i] == str[j]) { 20 | d[i][j] = d[i+1][j-1]; 21 | } else { 22 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 23 | } 24 | } 25 | } 26 | printf("%d\n", d[1][N]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975886_MLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int d[5000][5000]; 8 | 9 | int main() 10 | { 11 | int N, i, j; 12 | char str[8000]; 13 | 14 | scanf("%d", &N); 15 | scanf("%s", str+1); 16 | memset(d, 0, sizeof(d)); 17 | for (i=N; i>0; i--) { 18 | for (j=i; j<=N; j++) { 19 | if (str[i] == str[j]) { 20 | d[i][j] = d[i+1][j-1]; 21 | } else { 22 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 23 | } 24 | } 25 | } 26 | printf("%d\n", d[1][N]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975891_RE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int d[3000][3000]; 8 | 9 | int main() 10 | { 11 | int N, i, j; 12 | char str[8000]; 13 | 14 | scanf("%d", &N); 15 | scanf("%s", str+1); 16 | memset(d, 0, sizeof(d)); 17 | for (i=N; i>0; i--) { 18 | for (j=i; j<=N; j++) { 19 | if (str[i] == str[j]) { 20 | d[i][j] = d[i+1][j-1]; 21 | } else { 22 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 23 | } 24 | } 25 | } 26 | printf("%d\n", d[1][N]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975892_RE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int d[4000][4000]; 8 | 9 | int main() 10 | { 11 | int N, i, j; 12 | char str[8000]; 13 | 14 | scanf("%d", &N); 15 | scanf("%s", str+1); 16 | memset(d, 0, sizeof(d)); 17 | for (i=N; i>0; i--) { 18 | for (j=i; j<=N; j++) { 19 | if (str[i] == str[j]) { 20 | d[i][j] = d[i+1][j-1]; 21 | } else { 22 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 23 | } 24 | } 25 | } 26 | printf("%d\n", d[1][N]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975933_RE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | short d[1000][1000]; 8 | 9 | int main() 10 | { 11 | int N, i, j; 12 | char str[8000]; 13 | 14 | scanf("%d", &N); 15 | scanf("%s", str+1); 16 | memset(d, 0, sizeof(d)); 17 | for (i=N; i>0; i--) { 18 | for (j=i; j<=N; j++) { 19 | if (str[i] == str[j]) { 20 | d[i][j] = d[i+1][j-1]; 21 | } else { 22 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 23 | } 24 | } 25 | } 26 | printf("%d\n", d[1][N]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975935_RE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | short d[5000][5000]; 8 | 9 | int main() 10 | { 11 | int N, i, j; 12 | char str[8000]; 13 | 14 | scanf("%d", &N); 15 | scanf("%s", str+1); 16 | memset(d, 0, sizeof(d)); 17 | for (i=N; i>0; i--) { 18 | for (j=i; j<=N; j++) { 19 | if (str[i] == str[j]) { 20 | d[i][j] = d[i+1][j-1]; 21 | } else { 22 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 23 | } 24 | } 25 | } 26 | printf("%d\n", d[1][N]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975939_MLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | short d[6000][6000]; 8 | 9 | int main() 10 | { 11 | int N, i, j; 12 | char str[8000]; 13 | 14 | scanf("%d", &N); 15 | scanf("%s", str+1); 16 | memset(d, 0, sizeof(d)); 17 | for (i=N; i>0; i--) { 18 | for (j=i; j<=N; j++) { 19 | if (str[i] == str[j]) { 20 | d[i][j] = d[i+1][j-1]; 21 | } else { 22 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 23 | } 24 | } 25 | } 26 | printf("%d\n", d[1][N]); 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975959_MLE.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int min(int a, int b) 5 | { 6 | return a0; i--) { 20 | for (j=i; j<=N; j++) { 21 | if (str[i] == str[j]) { 22 | d[i][j] = d[i+1][j-1]; 23 | } else { 24 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 25 | } 26 | } 27 | } 28 | printf("%d\n", d[1][N]); 29 | 30 | return 0; 31 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975985_RE.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int min(int a, int b) 5 | { 6 | return a0; i--) { 20 | for (j=i; j<=N; j++) { 21 | if (str[i] == str[j]) { 22 | d[i][j] = d[i+1][j-1]; 23 | } else { 24 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 25 | } 26 | } 27 | } 28 | printf("%d\n", d[1][N]); 29 | 30 | return 0; 31 | } -------------------------------------------------------------------------------- /poj-cpp/1159/13975987_AC_704MS_49168K.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int min(int a, int b) 5 | { 6 | return a0; i--) { 20 | for (j=i; j<=N; j++) { 21 | if (str[i] == str[j]) { 22 | d[i][j] = d[i+1][j-1]; 23 | } else { 24 | d[i][j] = min(d[i+1][j], d[i][j-1])+1; 25 | } 26 | } 27 | } 28 | printf("%d\n", d[1][N]); 29 | 30 | return 0; 31 | } -------------------------------------------------------------------------------- /poj-cpp/1163/13824911_AC_32MS_212K.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int i, j, N, root[128][128]; 5 | 6 | while(~scanf("%d", &N)){ 7 | for(i=0; i=0; i--){ 14 | for(j=0; j<=i; j++){ 15 | root[i][j] += root[i+1][j]>root[i+1][j+1]?root[i+1][j]:root[i+1][j+1]; 16 | } 17 | } 18 | 19 | printf("%d\n", root[0][0]); 20 | } 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /poj-cpp/1183/14818746_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const int INF = 0x3f3f3f3f; 5 | 6 | int main() 7 | { 8 | int a, b, c; 9 | 10 | scanf("%d", &a); 11 | for(b=1; ; b++) { 12 | if(a!=b && 0==(a*b+1)%(b-a)) { 13 | c = (a*b+1)/(b-a); 14 | if(c<0) continue; 15 | break; 16 | } 17 | } 18 | printf("%d\n", b+c); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /poj-cpp/1183/14818754_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const int INF = 0x3f3f3f3f; 5 | 6 | int main() 7 | { 8 | int a, b, c; 9 | 10 | while(~scanf("%d", &a)) { 11 | int ans = INF; 12 | for(b=1; ; b++) { 13 | if(a!=b && 0==(a*b+1)%(b-a)) { 14 | c = (a*b+1)/(b-a); 15 | if(c<0) continue; 16 | if(b+cc) break; 18 | } 19 | } 20 | printf("%d\n", ans); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/1183/14818759_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const int INF = 0x3f3f3f3f3f3f3f3f; 5 | 6 | int main() 7 | { 8 | long long a, b, c; 9 | 10 | while(~scanf("%lld", &a)) { 11 | long long ans = INF; 12 | for(b=1; ; b++) { 13 | if(a!=b && 0==(a*b+1)%(b-a)) { 14 | c = (a*b+1)/(b-a); 15 | if(c<0) continue; 16 | if(b+cc) break; 18 | } 19 | } 20 | printf("%lld\n", ans); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/1183/14818864_AC_32MS_352K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const int INF = 0x3f3f3f3f3f3f3f3f; 5 | 6 | int main() 7 | { 8 | long long a, m, n; 9 | 10 | while(~scanf("%lld", &a)) { 11 | for(m=a; ; m--) { 12 | if(0==(a*a+1)%m) 13 | break; 14 | } 15 | n = (a*a+1) / m; 16 | printf("%lld\n", 2*a+m+n); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/1207/13860487_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int num[80000000]; 5 | 6 | void getnum(); 7 | 8 | int main(){ 9 | int s, e, i, max; 10 | 11 | getnum(); 12 | while(~scanf("%d%d", &s, &e)){ 13 | for(i=s, max=0; i<=e; i++){ 14 | if(num[i]>max) max = num[i]; 15 | } 16 | printf("%d %d %d\n", s, e, max); 17 | } 18 | 19 | return 0; 20 | } 21 | 22 | void getnum(){ 23 | int i, j, cnt, n; 24 | 25 | memset(num, 0, 44000); 26 | 27 | num[1] = 1; 28 | for(i=1; i<10000; i++){ 29 | n = i; 30 | cnt = 0; 31 | while(1){ 32 | if(num[n]){ 33 | num[i] = cnt+num[n]; 34 | break; 35 | } 36 | if(n%2) n = 3*n+1; 37 | else n = n/2; 38 | cnt ++; 39 | } 40 | 41 | } 42 | } -------------------------------------------------------------------------------- /poj-cpp/1207/13860812_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int num[80000000]; 5 | 6 | void getnum(); 7 | 8 | int main(){ 9 | int s, e, i, max; 10 | 11 | getnum(); 12 | while(~scanf("%d%d", &s, &e)){ 13 | for(i=s, max=0; i<=e; i++){ 14 | if(num[i]>max) max = num[i]; 15 | } 16 | printf("%d %d %d\n", s, e, max); 17 | } 18 | 19 | return 0; 20 | } 21 | 22 | void getnum(){ 23 | int i, j, cnt, n; 24 | 25 | memset(num, 0, 44000); 26 | 27 | num[1] = 1; 28 | for(i=1; i<11000; i++){ 29 | n = i; 30 | cnt = 0; 31 | while(1){ 32 | if(num[n]){ 33 | num[i] = cnt+num[n]; 34 | break; 35 | } 36 | if(n%2) n = 3*n+1; 37 | else n = n/2; 38 | cnt ++; 39 | } 40 | 41 | } 42 | } -------------------------------------------------------------------------------- /poj-cpp/1218/13943396_AC_0MS_132K.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int lst[200], cell[200], cnt, n, spc, i, nCase; 7 | memset(lst, 0, sizeof(lst)); 8 | for(n=5; n<=100; n++){ 9 | memset(cell, 0, sizeof(cell)); 10 | for(spc=1; spc<=n; spc++){ 11 | for(i=spc; i<=n; i+=spc){ 12 | cell[i]++; 13 | } 14 | } 15 | for(i=1, cnt=0; i<=n; i++){ 16 | if(cell[i]%2) cnt++; 17 | } 18 | lst[n] = cnt; 19 | } 20 | scanf("%d", &nCase); 21 | while(nCase--){ 22 | scanf("%d", &i); 23 | printf("%d\n", lst[i]); 24 | } 25 | return 0; 26 | } -------------------------------------------------------------------------------- /poj-cpp/1316/13997622_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int i, j, sum, faild; 6 | 7 | for(i=1; i<=10000; i++){ 8 | faild = 0; 9 | for(j=1; j0){ 13 | sum += t%10; 14 | t /= 10; 15 | } 16 | if(sum==i){ 17 | faild = 1; 18 | break; 19 | } 20 | } 21 | if(!faild) printf("%d\n", i); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/1326/14771129_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char t1[30], t2[30], type[10]; 6 | int m, ans = 0; 7 | 8 | while(scanf("%s", t1)) { 9 | if(t1[0]=='0') { 10 | printf("%d\n", ans); 11 | ans = 0; 12 | continue; 13 | } else if(t1[0]=='#') break; 14 | scanf("%s%d%s", t2, &m, type); 15 | int t = 0; 16 | if(type[0]=='F') t = m*2; 17 | else if(type[0]=='B') t = (int)(m*1.5+0.5); 18 | else t = m; 19 | if(t<500) t = 500; 20 | ans += t; 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/1326/14771131_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char t1[30], t2[30], type[10]; 6 | int m, ans = 0; 7 | 8 | while(scanf("%s", t1)) { 9 | if(t1[0]=='0') { 10 | printf("%d\n", ans); 11 | ans = 0; 12 | continue; 13 | } else if(t1[0]=='#') break; 14 | scanf("%s%d%s", t2, &m, type); 15 | if(type[0]=='F') ans += m*2; 16 | else if(type[0]=='B') ans += (int)(m*1.5+0.5); 17 | else ans += m<500 ? 500 : m; 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /poj-cpp/1338/14819111_MLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | const int maxn = 10000000; 7 | int arr[2][maxn], ans[maxn], lc, rc, l, r, n; 8 | 9 | int main() 10 | { 11 | arr[0][0] = 3; arr[1][0] = 4; 12 | ans[0] = 1; int cnt = 1; 13 | lc = rc = 1; l = r = 0; 14 | while(cnt 2 | 3 | int main() 4 | { 5 | int T, n, sum; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d", &n); 10 | for(sum=0; n/5; n/=5) sum += n/5; 11 | printf("%d\n", sum); 12 | } 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216226_TLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int solve(int n); 5 | 6 | int main() 7 | { 8 | int T, n; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%d", &n); 13 | printf("%d\n", solve(n)); 14 | } 15 | 16 | return 0; 17 | } 18 | 19 | int solve(int n) 20 | { 21 | int i; 22 | 23 | double ans = 1; 24 | for(i=n; i>0; i--) { 25 | ans += log10((double)i); 26 | } 27 | return ans; 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216275_MLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double arr[10000001]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(10000000); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", (int)arr[n]); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | 28 | arr[0] = 1; 29 | for(i=1; i<=n; i++) { 30 | arr[i] = log10(i)+arr[i-1]; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216277_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | float arr[10000001]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(10000000); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", (int)arr[n]); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | 28 | arr[0] = 1; 29 | for(i=1; i<=n; i++) { 30 | arr[i] = log10(i)+arr[i-1]; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216283_RE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double arr[1000001]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(1000000); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", (int)arr[n]); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | 28 | arr[0] = 1; 29 | for(i=1; i<=n; i++) { 30 | arr[i] = log10(i)+arr[i-1]; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216288_MLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double arr[8388000]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(8388000); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", (int)arr[n]); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | 28 | arr[0] = 1; 29 | for(i=1; i<=n; i++) { 30 | arr[i] = log10(i)+arr[i-1]; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216290_MLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double arr[8380000]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(8379999); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", (int)arr[n]); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | 28 | arr[0] = 1; 29 | for(i=1; i<=n; i++) { 30 | arr[i] = log10(i)+arr[i-1]; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216294_RE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double arr[8000000]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(7999999); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", (int)arr[n]); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | 28 | arr[0] = 1; 29 | for(i=1; i<=n; i++) { 30 | arr[i] = log10(i)+arr[i-1]; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216313_RE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int arr[1000001]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(10000000); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", arr[n]+1); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | double t, prev = 0; 28 | 29 | for(i=1; i<=n; i++) { 30 | t = log10(i)+prev; 31 | arr[i] = t; 32 | prev = t; 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /poj-cpp/1423/14216317_AC_672MS_39540K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int arr[10000001]; 6 | 7 | int solve(int n); 8 | 9 | int main() 10 | { 11 | int T, n; 12 | 13 | scanf("%d", &T); 14 | memset(arr, 0, sizeof(arr)); 15 | solve(10000000); 16 | while(T--) { 17 | scanf("%d", &n); 18 | printf("%d\n", arr[n]+1); 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int solve(int n) 25 | { 26 | int ans, i; 27 | double t, prev = 0; 28 | 29 | for(i=1; i<=n; i++) { 30 | t = log10(i)+prev; 31 | arr[i] = t; 32 | prev = t; 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /poj-cpp/1450/14923685_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | int N, M; 9 | 10 | int main() 11 | { 12 | int T; 13 | scanf("%d", &T); 14 | for(int nC=1; nC<=T; nC++) { 15 | scanf("%d%d", &N, &M); 16 | double ans = 0; 17 | if(0==N%2 || 0==M%2) ans = N*M; 18 | else { 19 | int n = N 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | int N, M; 9 | 10 | int main() 11 | { 12 | int T; 13 | scanf("%d", &T); 14 | for(int nC=1; nC<=T; nC++) { 15 | scanf("%d%d", &N, &M); 16 | double ans = N*M; 17 | if(N*M&1) ans += 0.41; 18 | printf("Scenario #%d:\n%.2f\n\n", nC, ans); 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/1455/14785926_AC_0MS_548K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int dp[50000]; 4 | 5 | int main() 6 | { 7 | dp[1] = dp[2] = 0; dp[3] = 1; 8 | for(int i=4; i<50000; i++) dp[i] = i-2 + dp[i-2]; 9 | int T; 10 | scanf("%d", &T); 11 | while(T--) { 12 | int n; 13 | scanf("%d", &n); 14 | printf("%d\n", dp[n]); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/1488/14865422_AC_16MS_336K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int ch, ok = 0; 6 | 7 | while(ch=getchar()) { 8 | if(ch==EOF) break; 9 | if(ch=='"') { 10 | if(ok==0) printf("``"); 11 | else printf("''"); 12 | ok ^= 1; 13 | } else putchar(ch); 14 | } 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /poj-cpp/1517/14043421_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int jiecheng(int n); 4 | 5 | int main() 6 | { 7 | int n, i; 8 | double sum; 9 | 10 | printf("n e\n- -----------\n"); 11 | printf("0 1\n"); 12 | sum = 1; 13 | for(i=1; i<=9; i++) { 14 | sum += 1.0/jiecheng(i); 15 | printf("%d %.9lg\n", i, sum); 16 | } 17 | return 0; 18 | } 19 | 20 | int jiecheng(int n) 21 | { 22 | if(n==1) return 1; 23 | else return n*jiecheng(n-1); 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/1517/14043433_AC_0MS_152K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int jiecheng(int n); 4 | 5 | int main() 6 | { 7 | int n, i; 8 | double sum; 9 | 10 | printf("n e\n- -----------\n"); 11 | printf("0 1\n"); 12 | sum = 1; 13 | for(i=1; i<=9; i++) { 14 | sum += 1.0/jiecheng(i); 15 | printf("%d %.10lg\n", i, sum); 16 | } 17 | return 0; 18 | } 19 | 20 | int jiecheng(int n) 21 | { 22 | if(n==1) return 1; 23 | else return n*jiecheng(n-1); 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/1519/14264314_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n, sum; 6 | 7 | while(scanf("%d", &n) && n) { 8 | while(n>9) { 9 | sum = 0; 10 | while(n/10) { 11 | sum += n%10; 12 | n /= 10; 13 | } 14 | n += sum; 15 | } 16 | printf("%d\n", n); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/1519/14264327_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n, sum, i; 6 | char str[3000]; 7 | 8 | while(scanf("%s", &str)) { 9 | if(str[0]=='0') break; 10 | n = 0; 11 | for(i=0; str[i]!='\0'; i++) n += str[i]-'0'; 12 | while(n>9) { 13 | sum = 0; 14 | while(n/10) { 15 | sum += n%10; 16 | n /= 10; 17 | } 18 | n += sum; 19 | } 20 | printf("%d\n", n); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/1528/14795278_AC_0MS_628K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const int maxn = 70000; 4 | int arr[maxn]; 5 | 6 | int solve() 7 | { 8 | for(int i=1; iarr[n]) printf("DEFICIENT\n"); 22 | else if(n 2 | 3 | int main() 4 | { 5 | int N, i, j, k, l; 6 | 7 | scanf("%d", &N); 8 | for(i=1; i<=N; i++) 9 | for(j=1; j<=i; j++) 10 | for(k=j; k<=i; k++) 11 | for(l=k; l<=i; l++) 12 | if(i*i*i==j*j*j+k*k*k+l*l*l) 13 | printf("Cube = %d, Triple = (%d,%d,%d)\n", i, j, k, l); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/1543/14362399_AC_16MS_132K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, i, j, k, l; 6 | 7 | scanf("%d", &N); 8 | for(i=3; i<=N; i++) 9 | for(j=2; j<=i; j++) 10 | for(k=j; k<=i; k++) 11 | for(l=k; l<=i; l++) 12 | if(i*i*i==j*j*j+k*k*k+l*l*l) 13 | printf("Cube = %d, Triple = (%d,%d,%d)\n", i, j, k, l); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/1552/14026391_AC_0MS_132K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[30], i, j, k, cnt; 6 | 7 | while(1){ 8 | for(i=0; scanf("%d", &arr[i]) && arr[i] && arr[i]!=-1; i++) ; 9 | if(arr[i]==-1) break; 10 | cnt = 0; 11 | for(j=0; j 2 | #include 3 | 4 | int main() 5 | { 6 | char str[50]; 7 | 8 | while(scanf("%s", str)) { 9 | if(!strcmp(str, "0")) break; 10 | int l = strlen(str); 11 | int ans = 0; 12 | for(int i=0; i 2 | #include 3 | 4 | int maps[105][105]; 5 | 6 | int main() 7 | { 8 | int T, a, b, c; 9 | char cmd[10]; 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%s%d%d%d", cmd, &a, &b, &c); 13 | if(cmd[0]=='W') { 14 | for(int i=a; i 2 | 3 | int main() 4 | { 5 | int arr[10], T; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | for(int i=0; i<4; i++) scanf("%d", &arr[i]); 10 | int a = arr[3]-arr[2]; 11 | int b = arr[2]-arr[1]; 12 | int c = arr[1]-arr[0]; 13 | for(int i=0; i<4; i++) printf("%d ", arr[i]); 14 | if(a==b && b==c) { 15 | printf("%d\n", arr[3]+a); 16 | } else { 17 | printf("%d\n", arr[3]*(arr[2]/arr[1])); 18 | } 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/1663/14366244_AC_16MS_132K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int x, y, T; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d%d", &x, &y); 10 | if(x-y!=0 && x-y!=2) printf("No Number\n"); 11 | else { 12 | if(x==y) { 13 | if(x&1) printf("%d\n", x*2-1); 14 | else printf("%d\n", x*2); 15 | } else { 16 | if(x&1) printf("%d\n", x*2-3); 17 | else printf("%d\n", x*2-2); 18 | } 19 | } 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /poj-cpp/1664/13893063_AC_0MS_180K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int N, M, cnt; 4 | 5 | int solve(int s, int n, int m); 6 | 7 | int main(){ 8 | int T; 9 | scanf("%d", &T); 10 | while(T--){ 11 | scanf("%d%d", &N, &M); 12 | cnt = 0; 13 | solve(0, N, M); 14 | printf("%d\n", cnt); 15 | } 16 | 17 | return 0; 18 | } 19 | 20 | int solve(int s, int n, int m){ 21 | int i; 22 | 23 | if(m==1 && n>=s){ 24 | cnt++; 25 | } 26 | else{ 27 | for(i=0; i<=n; i++){ 28 | if(i 2 | 3 | int N, M, cnt; 4 | 5 | int solve(int s, int n, int m); 6 | 7 | int main(){ 8 | int T; 9 | scanf("%d", &T); 10 | while(T--){ 11 | scanf("%d%d", &N, &M); 12 | cnt = 0; 13 | solve(0, N, M); 14 | printf("%d\n", cnt); 15 | } 16 | 17 | return 0; 18 | } 19 | 20 | int solve(int s, int n, int m){ 21 | int i; 22 | 23 | if(m==1 && n>=s){ 24 | cnt++; 25 | } 26 | else{ 27 | for(i=0; i<=n; i++){ 28 | if(i 2 | #include 3 | 4 | const double pi = acos(-1.0); 5 | 6 | int main() 7 | { 8 | double d, t; 9 | int n, nC = 0; 10 | while(~scanf("%lf%d%lf", &d, &n, &t)) { 11 | if(!n) break; 12 | double c = d * pi; 13 | double s = c * n / (12 * 5280); 14 | double v = s * 3600 / t; 15 | printf("Trip #%d: %.2f %.2f\n", ++nC, s, v); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/1731/14702045_AC_454MS_400K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | char str[201]; 8 | 9 | int main() 10 | { 11 | scanf("%s", &str); 12 | int l = strlen(str); 13 | sort(str, str+l); 14 | do { 15 | printf("%s\n", str); 16 | } while(next_permutation(str, str+l)); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/1731/14702052_PE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | char str[201]; 8 | 9 | int main() 10 | { 11 | scanf("%s", &str); 12 | int l = strlen(str); 13 | sort(str, str+l); 14 | do { 15 | for(int i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | char str[201]; 8 | 9 | int main() 10 | { 11 | scanf("%s", &str); 12 | int l = strlen(str); 13 | sort(str, str+l); 14 | do { 15 | for(int i=0; i 2 | 3 | int main() 4 | { 5 | int fact[100], n; 6 | fact[0] = 1; 7 | for(int i=1; i<15; i++) 8 | fact[i] = i*fact[i-1]; 9 | while(scanf("%d", &n) && n>=0) { 10 | int ok = 0; 11 | for(int s=0; s<1<<15; s++) { 12 | int ss = 0; 13 | for(int i=0; i<15; i++) 14 | if(1< 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int T, n, k, i, arr[1050]; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%d%d", &n, &k); 13 | for(i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int T, n, k, i, arr[1050]; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%d%d", &n, &k); 13 | for(i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int T, n, k, i, arr[1050]; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%d%d", &n, &k); 13 | for(i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int T, n, k, i, arr[1050]; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%d%d", &n, &k); 13 | for(i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int T, n, k, i, arr[1050]; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%d%d", &n, &k); 13 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | double hei[1024], g[1024]; 8 | 9 | int main() 10 | { 11 | int N; 12 | scanf("%d", &N); 13 | for(int i=0; ians) ans = r; 22 | } 23 | printf("%d\n", N-ans-1); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/1836/14907022_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | double hei[1024], g[1024]; 8 | 9 | int main() 10 | { 11 | int N; 12 | scanf("%d", &N); 13 | for(int i=0; ians) ans = r; 22 | } 23 | printf("%d\n", N-ans-1); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/1836/14907037_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | double hei[1024], g[1024]; 8 | 9 | int cmp(double a, double b) 10 | { 11 | return a > b; 12 | } 13 | 14 | int main() 15 | { 16 | int N; 17 | scanf("%d", &N); 18 | for(int i=0; ians) ans = r; 27 | } 28 | printf("%d\n", N-ans-2); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /poj-cpp/1837/14402377_AC_141MS_1668K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int dp[21][16001], N, M; 5 | int pos[21], wei[21]; 6 | 7 | int main() 8 | { 9 | memset(dp, 0, sizeof(dp)); 10 | scanf("%d%d", &N, &M); 11 | for(int i=1; i<=N; i++) 12 | scanf("%d", &pos[i]); 13 | for(int i=1; i<=M; i++) 14 | scanf("%d", &wei[i]); 15 | dp[0][7500] = 1; 16 | for(int i=1; i<=M; i++) { 17 | for(int j=0; j<15001; j++) { 18 | for(int k=1; k<=N; k++) { 19 | dp[i][j+wei[i]*pos[k]] += dp[i-1][j]; 20 | } 21 | } 22 | } 23 | printf("%d\n", dp[M][7500]); 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /poj-cpp/1844/14371588_AC_0MS_132K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int i, S, sum; 6 | 7 | scanf("%d", &S); 8 | for(i=1, sum=0; ; i++) { 9 | sum += i; 10 | if(sum>=S && (sum-S)%2==0) break; 11 | } 12 | printf("%d\n", i); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /poj-cpp/1852/14871055_AC_141MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int l, n, T, c; 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d%d", &l, &n); 10 | double m = l/2.0, a = 1000001, b = 0; 11 | for(int i=0; i b) b = fabs(m-c); 15 | } 16 | printf("%d %d\n", (int)(m-a), (int)(m+b)); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/1862/14179241_AC_0MS_168K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | priority_queue pq; 10 | int N, i; 11 | double t, t1, t2, ans=0; 12 | 13 | scanf("%d", &N); 14 | for(i=0; i 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | 9 | int main() 10 | { 11 | priority_queue pq; 12 | int N; 13 | double n; 14 | 15 | scanf("%d", &N); 16 | for(int i=0; i1) { 21 | double d1 = pq.top(); 22 | pq.pop(); 23 | double d2 = pq.top(); 24 | pq.pop(); 25 | pq.push(sqrt(d1*d2)*2); 26 | } 27 | printf("%.3f\n", pq.top()); 28 | 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /poj-cpp/1922/14299014_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, v, t, ans; 6 | double time; 7 | 8 | while(scanf("%d", &N) && N) { 9 | ans = 99999; 10 | while(N--) { 11 | scanf("%d%d", &v, &t); 12 | if(t<0) continue; 13 | time = 4500/(v/3.6) + t; 14 | if(time-(int)time>0) time++; 15 | if((int)time 2 | 3 | int main() 4 | { 5 | int N, v, t, ans; 6 | double time; 7 | 8 | while(scanf("%d", &N) && N) { 9 | ans = 99999; 10 | while(N--) { 11 | scanf("%d%d", &v, &t); 12 | if(t<0) continue; 13 | time = 4500.0*3.6/v + t; 14 | if(time-(int)time>0) time++; 15 | if((int)time 2 | 3 | int main() 4 | { 5 | int N, v, t, ans; 6 | double time; 7 | 8 | while(scanf("%d", &N) && N) { 9 | ans = 99999; 10 | while(N--) { 11 | scanf("%d%d", &v, &t); 12 | if(t<0) continue; 13 | time = 4500.0/v*3.6 + t; 14 | if(time-(int)time>0) time++; 15 | if((int)time 2 | 3 | int main() 4 | { 5 | int N, v, t, ans; 6 | double time; 7 | 8 | while(scanf("%d", &N) && N) { 9 | ans = 99999; 10 | while(N--) { 11 | scanf("%d%d", &v, &t); 12 | if(t<0) continue; 13 | time = 4500/(v/3.6) + t; 14 | if(time-(int)time>0) time++; 15 | if((int)time 2 | 3 | int main() 4 | { 5 | int N, v, t, ans; 6 | double time; 7 | 8 | while(scanf("%d", &N) && N) { 9 | ans = 99999; 10 | while(N--) { 11 | scanf("%d%d", &v, &t); 12 | if(t<0) continue; 13 | time = 4500/(v/3.6) + t; 14 | if(time-(int)time>0) time++; 15 | if((int)time 2 | 3 | int main() 4 | { 5 | int N, v, t, ans; 6 | double time; 7 | 8 | while(scanf("%d", &N) && N) { 9 | ans = 99999; 10 | while(N--) { 11 | scanf("%d%d", &v, &t); 12 | if(t<0) continue; 13 | time = 4500.0/(v/3.6) + t; 14 | if(time-(int)time>0) time++; 15 | if((int)time 2 | 3 | int main() 4 | { 5 | int N, v, t, ans; 6 | double time; 7 | 8 | while(scanf("%d", &N) && N) { 9 | ans = 99999; 10 | while(N--) { 11 | scanf("%d%d", &v, &t); 12 | if(t<0) continue; 13 | time = 4500*3.6/v + t; 14 | if(time-(int)time>0) time++; 15 | if((int)time 2 | #include 3 | 4 | 5 | int main() 6 | { 7 | char str1[150000], str2[150000]; 8 | int l1, l2, i, j, cnt; 9 | 10 | while (~scanf("%s%s", str1, str2)){ 11 | l2 = strlen(str2); 12 | for (i = j = 0; i < l2 && str1[j] != '\0'; i++){ 13 | if (str1[j] == str2[i]) { 14 | j++; 15 | } 16 | } 17 | 18 | 19 | if (str1[j]=='\0') printf("Yes\n"); 20 | else printf("No\n"); 21 | } 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /poj-cpp/1953/14312773_AC_0MS_148K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int T, nCase, n, i, arr[45]; 6 | 7 | arr[0] = 1; arr[1] = 2; 8 | for(i=2; i<45; i++) arr[i] = arr[i-1]+arr[i-2]; 9 | scanf("%d", &T); 10 | for(nCase=1; nCase<=T; nCase++) { 11 | scanf("%d", &n); 12 | printf("Scenario #%d:\n%d\n\n", nCase, arr[n]); 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/1969/14723833_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int n; 7 | while(~scanf("%d", &n)) { 8 | int l = 0; int r = 10000; 9 | while(l> 1; 11 | if(m*(m+1)/2 < n) l = m+1; 12 | else r = m; 13 | } 14 | int s; 15 | int res = n - (l-1)*l/2; 16 | if(l & 1) s = res; 17 | else s = l-res+1; 18 | printf("TERM %d IS %d/%d\n", n, l-s+1, s); 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/2000/13954845_AC_16MS_160K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n, i, sum, t, nn; 6 | 7 | while(scanf("%d", &n), n){ 8 | sum = 0; 9 | for(i=0, nn=0, t=1; i 2 | 3 | char str[20][25], N; 4 | 5 | int main() 6 | { 7 | int nCase, s, e, i; 8 | 9 | nCase = 0; 10 | while(scanf("%d", &N) && N) { 11 | for(i=0; i0; N-=2) printf("%s\n", str[N]); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/2013/14318563_AC_0MS_148K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char str[15][26], N; 4 | 5 | int main() 6 | { 7 | int nCase, s, e, i; 8 | 9 | nCase = 0; 10 | while(scanf("%d", &N) && N) { 11 | for(i=0; i0; N-=2) printf("%s\n", str[N]); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/2017/13967918_AC_0MS_156K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, s, t, sum, b; 6 | 7 | while(scanf("%d", &N)){ 8 | if(N==-1) break; 9 | sum = 0; 10 | t = 0; 11 | while(N--){ 12 | scanf("%d%d", &s, &b); 13 | sum += s*(b-t); 14 | t = b; 15 | } 16 | printf("%d miles\n", sum); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/2017/13967961_CE.cpp: -------------------------------------------------------------------------------- 1 | include 2 | 3 | int main() 4 | { 5 | int N, s, t, sum, b; 6 | 7 | while(scanf("%d", &N)){ 8 | if(N==-1) break; 9 | sum = 0; 10 | t = 0; 11 | while(N--){ 12 | scanf("%d%d", &s, &b); 13 | sum += s*(b-t); 14 | t = b; 15 | } 16 | printf("%d miles\n", sum); 17 | } 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /poj-cpp/2017/13967962_AC_16MS_156K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, s, t, sum, b; 6 | 7 | while(scanf("%d", &N)){ 8 | if(N==-1) break; 9 | sum = 0; 10 | t = 0; 11 | while(N--){ 12 | scanf("%d%d", &s, &b); 13 | sum += s*(b-t); 14 | t = b; 15 | } 16 | printf("%d miles\n", sum); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/2027/13892858_AC_0MS_180K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int Q, a, b; 5 | scanf("%d", &Q); 6 | while(Q--){ 7 | scanf("%d%d", &a, &b); 8 | if(a 2 | #include 3 | 4 | using namespace std; 5 | 6 | int arr[510000]; 7 | 8 | int main() 9 | { 10 | int m, i; 11 | set st; 12 | 13 | arr[0] = 0; 14 | st.insert(0); 15 | for(i=1; i<=500000; i++) { 16 | int n = arr[i-1]-i; 17 | if(n>0 && st.find(n)==st.end()) arr[i] = n; 18 | else arr[i] = arr[i-1]+i; 19 | st.insert(arr[i]); 20 | } 21 | while(scanf("%d", &m)) { 22 | if(m==-1) break; 23 | printf("%d\n", arr[m]); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2104/13943750_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int arr[110000], tmp[110000], N, i, Q, l, r, k; 9 | scanf("%d%d", &N, &Q); 10 | for(i=1; i<=N; i++){ 11 | scanf("%d", &arr[i]); 12 | } 13 | while(Q--){ 14 | scanf("%d%d%d", &l, &r, &k); 15 | for(i=l; i<=r; i++) tmp[i] = arr[i]; 16 | sort(tmp+l, tmp+r); 17 | printf("%d\n", tmp[l+k-1]); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /poj-cpp/2104/13943990_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int arr[200000], tmp[200000], N, i, Q, l, r, k; 9 | scanf("%d%d", &N, &Q); 10 | for(i=1; i<=N; i++){ 11 | scanf("%d", &arr[i]); 12 | } 13 | while(Q--){ 14 | scanf("%d%d%d", &l, &r, &k); 15 | for(i=l; i<=r; i++) tmp[i] = arr[i]; 16 | sort(tmp+l, tmp+r); 17 | printf("%d\n", tmp[l+k-1]); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /poj-cpp/2104/13944005_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int arr[200000], tmp[200000], N, i, Q, l, r, k; 9 | scanf("%d%d", &N, &Q); 10 | for(i=1; i<=N; i++){ 11 | scanf("%d", &arr[i]); 12 | } 13 | while(Q--){ 14 | scanf("%d%d%d", &l, &r, &k); 15 | for(i=l; i<=r; i++) tmp[i] = arr[i]; 16 | sort(tmp+l, tmp+r+1); 17 | printf("%d\n", tmp[l+k-1]); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /poj-cpp/2104/13944073_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int cmp(const void* a, const void* b) 5 | { 6 | return *(int*)a-*(int*)b; 7 | } 8 | 9 | int main() 10 | { 11 | int arr[200000], tmp[200000], N, i, Q, l, r, k; 12 | scanf("%d%d", &N, &Q); 13 | for(i=1; i<=N; i++){ 14 | scanf("%d", &arr[i]); 15 | } 16 | while(Q--){ 17 | scanf("%d%d%d", &l, &r, &k); 18 | for(i=l; i<=r; i++) tmp[i] = arr[i]; 19 | qsort(tmp+l, r-l+1, sizeof(int), cmp); 20 | printf("%d\n", tmp[l+k-1]); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/2104/13944114_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int cmp(int a, int b) 7 | { 8 | return a-b; 9 | } 10 | 11 | int main() 12 | { 13 | int arr[200000], tmp[200000], N, i, Q, l, r, k; 14 | scanf("%d%d", &N, &Q); 15 | for(i=1; i<=N; i++){ 16 | scanf("%d", &arr[i]); 17 | } 18 | while(Q--){ 19 | scanf("%d%d%d", &l, &r, &k); 20 | for(i=l; i<=r; i++) tmp[i] = arr[i]; 21 | sort(tmp+l, tmp+r+1, cmp); 22 | printf("%d\n", tmp[l+k-1]); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/2104/13944119_TLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int arr[200000], tmp[200000], N, i, Q, l, r, k; 9 | scanf("%d%d", &N, &Q); 10 | for(i=1; i<=N; i++){ 11 | scanf("%d", &arr[i]); 12 | } 13 | while(Q--){ 14 | scanf("%d%d%d", &l, &r, &k); 15 | for(i=l; i<=r; i++) tmp[i] = arr[i]; 16 | sort(tmp+l, tmp+r+1); 17 | printf("%d\n", tmp[l+k-1]); 18 | } 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /poj-cpp/2105/14026668_AC_0MS_132K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int get_n(char *str); 4 | 5 | int main() 6 | { 7 | int N, i; 8 | char str[50]; 9 | 10 | scanf("%d", &N); 11 | while(N--) { 12 | scanf("%s", str); 13 | printf("%d", get_n(str)); 14 | for(i=8; i<32; i+=8) { 15 | printf(".%d", get_n(str+i)); 16 | } 17 | printf("\n"); 18 | } 19 | 20 | return 0; 21 | } 22 | 23 | int get_n(char *str) 24 | { 25 | int i, sum; 26 | 27 | for(i=0, sum=0; i<8; i++) { 28 | sum += (1<<(7-i))*(str[i]-'0'); 29 | } 30 | 31 | return sum; 32 | } 33 | -------------------------------------------------------------------------------- /poj-cpp/2109/14073190_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | double n, p; 7 | 8 | while(~scanf("%lf%lf", &n, &p)) { 9 | printf("%d\n", (int)pow(p, 1/n)); 10 | } 11 | 12 | // printf("%lld", ); 13 | return 0; 14 | } -------------------------------------------------------------------------------- /poj-cpp/2109/14073192_AC_0MS_180K.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | double n, p; 7 | 8 | while(~scanf("%lf%lf", &n, &p)) { 9 | printf("%lg\n", pow(p, 1/n)); 10 | } 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /poj-cpp/2140/14090094_AC_610MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int i, j, N, cnt, t; 7 | 8 | scanf("%d", &N); 9 | cnt = 0; 10 | for(i=1; i<=N; i++) { 11 | for(j=i; j<=N; j++) { 12 | if((i+j)*(j-i+1)/2==N) cnt++; 13 | else if((i+j)*(j-i+1)/2>N) break; 14 | } 15 | } 16 | printf("%d\n", cnt); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/2141/14554775_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int main() 5 | { 6 | char maps[27]; 7 | scanf("%s", maps); 8 | int ch; 9 | getchar(); 10 | while((ch=getchar())!=EOF) { 11 | if(ch==' ') putchar(' '); 12 | else if(ch<='Z' && ch>'A') { 13 | putchar(maps[ch-'A']-'a'+'A'); 14 | } else { 15 | putchar(maps[ch-'a']); 16 | } 17 | } 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /poj-cpp/2141/14554787_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int main() 5 | { 6 | char maps[27]; 7 | scanf("%s", maps); 8 | int ch; 9 | getchar(); 10 | while((ch=getchar())!=EOF) { 11 | if(ch==' ') putchar(' '); 12 | else if(ch<='Z' && ch>='A') { 13 | putchar(maps[ch-'A']-'a'+'A'); 14 | } else { 15 | putchar(maps[ch-'a']); 16 | } 17 | } 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /poj-cpp/2141/14554799_AC_16MS_348K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int main() 5 | { 6 | char maps[27]; 7 | scanf("%s", maps); 8 | int ch; 9 | getchar(); 10 | while((ch=getchar())!=EOF) { 11 | if(ch<='Z' && ch>='A') { 12 | putchar(maps[ch-'A']-'a'+'A'); 13 | } else if(ch<='z' && ch>='a') { 14 | putchar(maps[ch-'a']); 15 | } else 16 | putchar(ch); 17 | } 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /poj-cpp/2181/14815963_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, n, ans = 0; 6 | scanf("%d", &N); 7 | for(int i=1; i<=N; i++) { 8 | scanf("%d", &n); 9 | if(i%2) ans += n; 10 | } 11 | printf("%d\n", ans); 12 | 13 | return 0; 14 | } -------------------------------------------------------------------------------- /poj-cpp/2181/14816531_AC_63MS_1476K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | const int maxn = 160000; 7 | int dp[maxn][2]; 8 | 9 | int main() 10 | { 11 | int N, n, ans = 0; 12 | 13 | scanf("%d", &N); 14 | for(int i=1; i<=N; i++) { 15 | scanf("%d", &n); 16 | dp[i][0] = max(dp[i-1][0], dp[i-1][1]+n); 17 | dp[i][1] = max(dp[i-1][1], dp[i-1][0]-n); 18 | } 19 | printf("%d\n", max(dp[N][0], dp[N][1])); 20 | 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /poj-cpp/2196/14684691_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | for(int i=2992; i<10000; i++) { 9 | int n = i; 10 | int s = 0; 11 | while(n>0) { 12 | s += n%16; 13 | n /= 16; 14 | } 15 | int s1 = i%10 + (i/10)%10 + (i/100)%10 + i/1000; 16 | if(s==s1) printf("%d\n", i); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/2196/14684699_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | for(int i=2992; i<10000; i++) { 7 | int n = i; 8 | int s = 0; 9 | while(n) { 10 | s += n%16; 11 | n /= 16; 12 | } 13 | int s1 = i%10 + (i/10)%10 + (i/100)%10 + i/1000; 14 | if(s==s1) printf("%d\n", i); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/2196/14684700_AC_0MS_340K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | for(int i=2992; i<10000; i++) { 7 | int n = i; 8 | int s = 0; 9 | while(n) { 10 | s += n%16; 11 | n /= 16; 12 | } 13 | n = i; 14 | int s2 = 0; 15 | while(n) { 16 | s2 += n%12; 17 | n /= 12; 18 | } 19 | int s1 = i%10 + (i/10)%10 + (i/100)%10 + i/1000; 20 | if(s==s1 && s1==s2) printf("%d\n", i); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/2209/14912697_AC_32MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int pow(int x, int n) 4 | { 5 | int s = 1; 6 | while(n) { 7 | if(n&1) s *= x; 8 | x *= x; 9 | n >>= 1; 10 | } 11 | return s; 12 | } 13 | 14 | int main() 15 | { 16 | int n, ans, e, x; 17 | ans = 0; 18 | scanf("%d%d", &n, &e); 19 | while(n--) { 20 | scanf("%d", &x); 21 | x = pow(x, e); 22 | if(x > 0) ans += x; 23 | } 24 | printf("%d\n", ans); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2229/14152345_RE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int cnt; 4 | 5 | int dfs(int s, int N); 6 | 7 | int main() 8 | { 9 | int N, i; 10 | 11 | scanf("%d", &N); 12 | cnt = 0; 13 | dfs(0, N); 14 | printf("%d\n", cnt); 15 | 16 | return 0; 17 | } 18 | 19 | int dfs(int s, int N) 20 | { 21 | int i, t; 22 | 23 | if(N==0) cnt++; 24 | else 25 | for(i=s; i=0) dfs(i, N-t); 28 | else break; 29 | } 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /poj-cpp/2229/14153166_RE.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int arr[1100000]; 6 | 7 | int get_n(int n); 8 | int get(int n, int m); 9 | 10 | int main() 11 | { 12 | int N; 13 | 14 | scanf("%d", &N); 15 | memset(arr, 0, sizeof(arr)); 16 | arr[1] = 1; 17 | printf("%d\n", get_n(N)); 18 | 19 | return 0; 20 | } 21 | 22 | int get_n(int n) 23 | { 24 | int ans = 0; 25 | 26 | if(arr[n]) return arr[n]; 27 | else { 28 | ans += get_n(n-1); 29 | if(n%2==0) ans += get_n(n/2); 30 | } 31 | 32 | return arr[n] = ans%1000000000; 33 | } 34 | -------------------------------------------------------------------------------- /poj-cpp/2229/14153188_AC_125MS_4068K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int arr[1100000]; 5 | 6 | int main() 7 | { 8 | int i, n; 9 | 10 | scanf("%d", &n); 11 | arr[1] = 1; 12 | for(i=2; i<=n; i++) { 13 | arr[i] = (arr[i-1] + (i%2?0:arr[i/2]))%1000000000; 14 | } 15 | printf("%d\n", arr[n]); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/2231/14699435_TLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | typedef long long ll; 8 | const int maxn = 10005; 9 | 10 | int N, arr[maxn]; 11 | 12 | int main() 13 | { 14 | ll ans = 0; 15 | scanf("%d", &N); 16 | for(int i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | typedef long long ll; 8 | const int maxn = 10005; 9 | 10 | int N, arr[maxn]; 11 | 12 | int main() 13 | { 14 | ll ans = 0; 15 | scanf("%d", &N); 16 | for(int i=0; i 2 | 3 | int main() 4 | { 5 | int n, a, b; 6 | 7 | while(~scanf("%d", &n)) { 8 | scanf("%d", &a); 9 | for(int i=1; i 2 | 3 | int next[160], N; 4 | 5 | int main() 6 | { 7 | int m, i, j, t; 8 | 9 | while(~scanf("%d", &N) && N) { 10 | m = 1; 11 | while(m++) { 12 | for(i=1; i 2 | 3 | int next[160], N; 4 | 5 | int main() 6 | { 7 | int m, i, j, t; 8 | 9 | while(~scanf("%d", &N) && N) { 10 | m = 1; 11 | while(m++) { 12 | for(i=1; i 2 | #include 3 | 4 | long long cal(int n, int m) 5 | { 6 | if(n-m < m) m = n-m; 7 | long long a = 1; 8 | for(int i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int rop[1024], N, T; 8 | 9 | int main() 10 | { 11 | scanf("%d", &T); 12 | while(T--) { 13 | scanf("%d", &N); 14 | for(int i=0; i 2 | 3 | int main(){ 4 | int nums, a[500000]; 5 | int i, j, n, t; 6 | 7 | while(scanf("%d", &nums)!=EOF){ 8 | if(nums==0) return 0; 9 | n = 0; 10 | for(i=0; i0; i--){ 14 | for(j=0; ja[j+1]){ 16 | t = a[j+1]; 17 | a[j+1] = a[j]; 18 | a[j] = t; 19 | n++; 20 | } 21 | } 22 | } 23 | printf("%d\n", n); 24 | } 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/2301/14260737_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int T, a, b; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d%d", &a, &b); 10 | if(a>=b && (a+b)%2==0) 11 | printf("%d %d\n", (a+b)/2, a-(a+b)/2); 12 | else printf("impossible\n"); 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/2309/14711108_AC_0MS_396K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int T; 9 | long long n; 10 | 11 | scanf("%d", &T); 12 | while(T--) { 13 | scanf("%lld", &n); 14 | int i; 15 | for(i=0; i<32; i++) 16 | if(n & (1< 2 | 3 | int main() 4 | { 5 | int arr[1024], N, i, sum, ans, T; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d", &N); 10 | for(i=0, sum=0; i(double)sum/N) ans++; 17 | } 18 | printf("%.3lf%%\n", (double)ans*100/N); 19 | } 20 | return 0; 21 | } -------------------------------------------------------------------------------- /poj-cpp/2352/13943261_TLE.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int N, i, j, x[20000], y[20000], rand[20000], cnt; 7 | 8 | scanf("%d", &N); 9 | for(i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int arr[128]; 7 | 8 | int main() 9 | { 10 | int N, n; 11 | char str[1024]; 12 | 13 | scanf("%d", &N); 14 | for(int i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int arr[5005]; 7 | 8 | int main() 9 | { 10 | int N, n; 11 | char str[1024]; 12 | 13 | scanf("%d", &N); 14 | for(int i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int arr[100005]; 7 | 8 | int main() 9 | { 10 | int N, n; 11 | char str[1024]; 12 | 13 | scanf("%d", &N); 14 | for(int i=0; i 2 | 3 | int T, E, N, d[1100], u[4100], v[4100], w[4100]; 4 | 5 | int Bellman() 6 | { 7 | int update = 1; 8 | for(int i=1; i<=N; i++) d[i] = 99999999; 9 | d[1] = 0; 10 | while(update) { 11 | update = 0; 12 | for(int i=0; i d[u[i]] + w[i]) { 14 | d[v[i]] = d[u[i]] + w[i]; 15 | update = 1; 16 | } 17 | } 18 | } 19 | return d[N]; 20 | } 21 | 22 | int main() 23 | { 24 | int tu, tv, tw; 25 | 26 | scanf("%d%d", &T, &N); 27 | E = 0; 28 | while(T--) { 29 | scanf("%d%d%d", &tu, &tv, &tw); 30 | u[E] = tu; v[E] = tv; 31 | w[E] = tw; E++; 32 | //u[E] = tv; v[E] = tu; 33 | //w[E] = tw; E++; 34 | } 35 | printf("%d\n", Bellman()); 36 | 37 | return 0; 38 | } -------------------------------------------------------------------------------- /poj-cpp/2387/14392069_AC_16MS_432K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int T, E, N, d[1100], u[4100], v[4100], w[4100]; 4 | 5 | int Bellman() 6 | { 7 | int update = 1; 8 | for(int i=1; i<=N; i++) d[i] = 99999999; 9 | d[1] = 0; 10 | while(update) { 11 | update = 0; 12 | for(int i=0; i d[u[i]] + w[i]) { 14 | d[v[i]] = d[u[i]] + w[i]; 15 | update = 1; 16 | } 17 | } 18 | } 19 | return d[N]; 20 | } 21 | 22 | int main() 23 | { 24 | int tu, tv, tw; 25 | 26 | scanf("%d%d", &T, &N); 27 | E = 0; 28 | while(T--) { 29 | scanf("%d%d%d", &tu, &tv, &tw); 30 | u[E] = tu; v[E] = tv; 31 | w[E] = tw; E++; 32 | u[E] = tv; v[E] = tu; 33 | w[E] = tw; E++; 34 | } 35 | printf("%d\n", Bellman()); 36 | 37 | return 0; 38 | } -------------------------------------------------------------------------------- /poj-cpp/2388/13860498_AC_16MS_176K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int num[1100000]; 7 | 8 | int main(){ 9 | int n, i; 10 | while(~scanf("%d", &n)){ 11 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int R, Y; 6 | double M; 7 | 8 | scanf("%d%lf%d", &R, &M, &Y); 9 | while(Y--) M *= (1+R/100.0); 10 | printf("%d\n", (int)M); 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /poj-cpp/2407/14712803_AC_0MS_396K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int euler_phi(int n) 5 | { 6 | int m = (int)(sqrt(n)+0.5); 7 | int ans = n; 8 | for(int i=2; i<=m; i++) { 9 | if(n%i==0) { 10 | ans = ans/i * (i-1); 11 | while(n%i==0) n /= i; 12 | } 13 | } 14 | if(n>1) ans = ans/n * (n-1); 15 | return ans; 16 | } 17 | 18 | int main() 19 | { 20 | int n; 21 | 22 | while(scanf("%d", &n) && n) { 23 | printf("%d\n", euler_phi(n)); 24 | } 25 | 26 | return 0; 27 | } 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /poj-cpp/2411/14600605_TLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | const int maxn = 11; 5 | 6 | int dp[maxn][maxn][1< 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | map mp; 11 | int cnt; 12 | char str[35]; 13 | 14 | cnt = 0; 15 | while(gets(str)) { 16 | if(!isalpha(str[0])) continue; 17 | cnt++; 18 | mp[str] ++; 19 | } 20 | 21 | map::iterator it; 22 | for(it=mp.begin(); it!=mp.end(); it++) { 23 | printf("%s %.4f\n", it->first.c_str(), (double)it->second*100/cnt); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2418/14298402_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | map mp; 11 | int cnt; 12 | char str[35]; 13 | 14 | cnt = 0; 15 | while(gets(str)) { 16 | if(!isalpha(str[0])) continue; 17 | cnt++; 18 | mp[str] ++; 19 | } 20 | 21 | map::iterator it; 22 | for(it=mp.begin(); it!=mp.end(); it++) { 23 | printf("%s %.4lf\n", it->first.c_str(), (double)it->second*100/cnt); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2418/14298411_AC_1485MS_352K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | map mp; 10 | int cnt; 11 | char str[35]; 12 | 13 | cnt = 0; 14 | while(gets(str)) { 15 | if(str[0]=='\0') continue; 16 | cnt++; 17 | mp[str] ++; 18 | } 19 | 20 | map::iterator it; 21 | for(it=mp.begin(); it!=mp.end(); it++) { 22 | printf("%s %.4lf\n", it->first.c_str(), (double)it->second*100/cnt); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/2453/14764672_AC_0MS_388K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | 7 | while(~scanf("%d", &n) && n) { 8 | int a = n + (n&-n); 9 | int b = (a|n) - a; 10 | b &= b<<1; 11 | while(b && !(b&1)) b >>= 1; 12 | printf("%d\n", a+b); 13 | } 14 | 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /poj-cpp/2470/14886888_AC_266MS_716K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int per[100010], N; 4 | 5 | int main() 6 | { 7 | int i; 8 | 9 | while(scanf("%d", &N) && N) { 10 | for(i=1; i<=N; i++) 11 | scanf("%d", &per[i]); 12 | for(i=1; i<=N; i++) 13 | if(per[per[i]]!=i) break; 14 | if(i<=N) printf("not ambiguous\n"); 15 | else printf("ambiguous\n"); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/2478/14798051_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const int maxn = 1e6+1; 4 | int fact[maxn], dp[maxn]; 5 | 6 | void sieve() 7 | { 8 | for(int i=2; i*i 2 | 3 | const int maxn = 1e6+1; 4 | long long fact[maxn], dp[maxn]; 5 | 6 | void sieve() 7 | { 8 | for(int i=2; i*i 2 | 3 | const int maxn = 1e6+1; 4 | int fact[maxn]; 5 | long long dp[maxn]; 6 | 7 | void sieve() 8 | { 9 | for(int i=2; i*2 2 | 3 | const int maxn = 1e6+1; 4 | int fact[maxn], prime[maxn]; 5 | long long dp[maxn]; 6 | 7 | void sieve() 8 | { 9 | 10 | for(int i=2; i*2 2 | 3 | const int maxn = 1e6+1; 4 | int fact[maxn], prime[maxn]; 5 | long long dp[maxn]; 6 | 7 | void sieve() 8 | { 9 | for(int i=2; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | typedef char String[15]; 8 | 9 | int main(){ 10 | map mp; 11 | char str1[15], str2[15], str[15]; 12 | char tch; 13 | 14 | scanf("%s%s", str1, str2); 15 | mp[str2] = str1; 16 | while(1){ 17 | if(getchar()=='\n' && (tch=getchar())=='\n') break; 18 | str1[0] = tch; 19 | scanf("%s%s", &str1[1], str2); 20 | mp[str2] = str1; 21 | } 22 | 23 | while(~scanf("%s", str)){ 24 | if(mp[str].empty()) printf("eh\n"); 25 | else printf("%s\n", mp[str].c_str()); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /poj-cpp/2509/14345498_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int ans, N, k, butt; 6 | 7 | while(~scanf("%d%d", &N, &k)) { 8 | ans = 0; 9 | butt = 0; 10 | while(N>0) { 11 | ans += N; 12 | butt += N; 13 | N = butt/k; 14 | butt %= k; 15 | } 16 | printf("%d\n", ans); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/2513/14089319_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | map mp; 10 | char str[50]; 11 | 12 | while(~scanf("%s", str)) { 13 | mp[str]++; 14 | } 15 | map::iterator it; 16 | int cnt = 0; 17 | for(it=mp.begin(); it!=mp.end(); it++) { 18 | if(it->second%2!=0) cnt++; 19 | } 20 | if(cnt>2) printf("Impossible\n"); 21 | else printf("Possible\n"); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/2521/14598751_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a, b, c, d; 6 | 7 | while(scanf("%d%d%d%d", &a, &b, &c, &d)) { 8 | if(!a && !b && !c && !d) break; 9 | printf("%d\n", c-b+a); 10 | } 11 | 12 | return 0; 13 | } -------------------------------------------------------------------------------- /poj-cpp/2533/13923581_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(){ 5 | int num[2000], sub[2000], i, j, maxs, N; 6 | 7 | while(~scanf("%d", &N)){ 8 | for(i=0; i=0; j--){ 14 | if(num[j]maxs) maxs = sub[i]; 22 | } 23 | printf("%d\n", maxs); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2533/13923608_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(){ 5 | int num[2000], sub[2000], i, j, maxs, N; 6 | 7 | while(~scanf("%d", &N)){ 8 | for(i=0; i=0; j--){ 14 | if(num[j]<=num[i]){ 15 | sub[i] = sub[j]+1; 16 | break; 17 | } 18 | } 19 | } 20 | for(i=0, maxs=0; imaxs) maxs = sub[i]; 22 | } 23 | printf("%d\n", maxs); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2533/13923613_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(){ 5 | int num[2000], sub[2000], i, j, maxs, N; 6 | 7 | while(~scanf("%d", &N)){ 8 | for(i=0; i=0; j--){ 14 | if(num[j]maxs) maxs = sub[i]; 22 | } 23 | printf("%d\n", maxs); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2533/13927884_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[2000], cnt[2000], N, i, j, maxs; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[2000], cnt[2000], N, i, j, maxs; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[2000], cnt[2000], N, i, j, maxs; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[2000], cnt[2000], N, i, j, maxs; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[2000], g[2000], d[2000], N, i, j, maxs=0; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main(){ 7 | int N, arr[2000], tmp[2000], i, j, t, maxs=0; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[2000], g[2000], d[2000], N, i, j, maxs=0; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[2000], g[2000], N, i, j, maxs=0; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i 2 | 3 | char S1[39] = {"1234567890QWERTYUIOPASDFGHJKLZXCVBNM,."}; 4 | char S2[39] = {"234567890-WERTYUIOP[SDFGHJKL;XCVBNM,./"}; 5 | int maps[128]; 6 | 7 | int main() 8 | { 9 | for(int i=0; i<38; i++) 10 | maps[S2[i]] = i; 11 | while(int ch=getchar()) { 12 | if(EOF==ch) break; 13 | if(ch==' ' || ch=='\n') putchar(ch); 14 | else putchar(S1[maps[ch]]); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/2538/14872457_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char S1[49] = {"`1234567890QWERTYUIOP[]ASDFGHJKL;ZXCVBNM,."}; 5 | char S2[49] = {"1234567890-WERTYUIOP[]\\SDFGHJKL;'XCVBNM,./"}; 6 | int maps[128]; 7 | 8 | int main() 9 | { 10 | for(int i=0; i<42; i++) 11 | maps[S2[i]] = i; 12 | while(int ch=getchar()) { 13 | if(EOF==ch) break; 14 | if(ch==' ' || ch=='\n') putchar(ch); 15 | else putchar(S1[maps[ch]]); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/2538/14872463_AC_16MS_316K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char S1[49] = {"`1234567890-QWERTYUIOP[]ASDFGHJKL;ZXCVBNM,."}; 5 | char S2[49] = {"1234567890-=WERTYUIOP[]\\SDFGHJKL;'XCVBNM,./"}; 6 | int maps[128]; 7 | 8 | int main() 9 | { 10 | for(int i=0; i<43; i++) 11 | maps[S2[i]] = i; 12 | while(int ch=getchar()) { 13 | if(EOF==ch) break; 14 | if(ch==' ' || ch=='\n') putchar(ch); 15 | else putchar(S1[maps[ch]]); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/2551/14244955_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, n, ans; 6 | 7 | while(~scanf("%d", &N)) { 8 | ans = n = 1; 9 | while(n%=N) { 10 | n = n*10+1; 11 | ans++; 12 | } 13 | printf("%d\n", ans); 14 | } 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /poj-cpp/2575/14766023_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int n, a, b, faild; 7 | 8 | while(~scanf("%d", &n)) { 9 | faild = 0; 10 | scanf("%d", &a); 11 | for(int k=1; k0 && c 2 | #include 3 | 4 | int main() 5 | { 6 | int n, a, b, faild; 7 | 8 | while(~scanf("%d", &n)) { 9 | faild = 0; 10 | if(n>0) scanf("%d", &a); 11 | for(int k=1; k0 && c 2 | 3 | int main() 4 | { 5 | int a, b, c; 6 | 7 | scanf("%d%d%d", &a, &b, &c); 8 | if(a<=168) printf("CRASH %d\n", a); 9 | else if(b<=168) printf("CRASH %d\n", b); 10 | else if(c<=168) printf("CRASH %d\n", c); 11 | else printf("NO CRASH"); 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /poj-cpp/2583/14792642_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int f(int a, int b, int c, int x) 4 | { 5 | return a*x*x + b*x + c; 6 | } 7 | 8 | int main() 9 | { 10 | int x, y, z; 11 | 12 | while(~scanf("%d%d%d", &x, &y, &z)) { 13 | int a = (x-2*y+z) / 2; 14 | int b = y - a - x; 15 | int c = x; 16 | printf("%d ", f(a, b, c, 3)); 17 | printf("%d ", f(a, b, c, 4)); 18 | printf("%d\n", f(a, b, c, 5)); 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/2591/14819113_MLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | const int maxn = 10000000; 7 | int arr[2][maxn], ans[maxn], lc, rc, l, r, n; 8 | 9 | int main() 10 | { 11 | arr[0][0] = 3; arr[1][0] = 4; 12 | ans[0] = 1; int cnt = 1; 13 | lc = rc = 1; l = r = 0; 14 | while(cnt 2 | 3 | int num1[1000010], num2[1000010], N; 4 | 5 | int main() 6 | { 7 | int i; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i=0; i--) { 14 | num1[i] += num2[i]; 15 | } 16 | for(i=N-1; i>0; i--) { 17 | if(num1[i]>=10) { 18 | num1[i] -= 10; 19 | num1[i-1] += 1; 20 | } 21 | } 22 | for(i=0; i 2 | 3 | int num[1000010], N; 4 | 5 | int main() 6 | { 7 | int i, a, b; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i0; i--) { 15 | if(num[i]>=10) { 16 | num[i] -= 10; 17 | num[i-1] += 1; 18 | } 19 | } 20 | for(i=0; i 2 | 3 | int num[1000010], N; 4 | 5 | int main() 6 | { 7 | int i, a, b; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i0; i--) { 15 | if(num[i]>=10) { 16 | num[i] -= 10; 17 | num[i-1] += 1; 18 | } 19 | } 20 | for(i=0; i 2 | 3 | int num[1000010], N; 4 | 5 | int main() 6 | { 7 | int i, a, b; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i0; i--) { 15 | if(num[i]>=10) { 16 | num[i] -= 10; 17 | num[i-1] += 1; 18 | } 19 | } 20 | for(i=0; i 2 | 3 | char num[1000010], N; 4 | 5 | int main() 6 | { 7 | int i, a, b; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i0; i--) { 18 | if(num[i]>'9') { 19 | num[i] -= 10; 20 | num[i-1] += 1; 21 | } 22 | } 23 | printf("%s\n", num); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/2602/14333999_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char num[1000010], N; 4 | 5 | int main() 6 | { 7 | int i, a, b; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i0; i--) { 18 | if(num[i]>'9') { 19 | num[i] -= 10; 20 | num[i-1] += 1; 21 | } 22 | } 23 | if(num[0]>'9') { 24 | num[0] -= 10; 25 | putchar('1'); 26 | } 27 | printf("%s\n", num); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /poj-cpp/2602/14334009_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char num[1000010], N; 4 | 5 | int main() 6 | { 7 | int i, a, b; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i0; i--) { 18 | if(num[i]>'9') { 19 | num[i] -= 10; 20 | num[i-1] += 1; 21 | } 22 | } 23 | if(num[0]>'9') num[0] -= 10; 24 | printf("%s\n", num); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2602/14334012_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char num[10000010], N; 4 | 5 | int main() 6 | { 7 | int i, a, b; 8 | 9 | scanf("%d", &N); 10 | for(i=0; i0; i--) { 18 | if(num[i]>'9') { 19 | num[i] -= 10; 20 | num[i-1] += 1; 21 | } 22 | } 23 | if(num[0]>'9') num[0] -= 10; 24 | printf("%s\n", num); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poj-cpp/2602/14334020_AC_1500MS_1136K.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char num[1000010]; 4 | int N; 5 | 6 | int main() 7 | { 8 | int i, a, b; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i0; i--) { 19 | if(num[i]>'9') { 20 | num[i] -= 10; 21 | num[i-1] += 1; 22 | } 23 | } 24 | if(num[0]>'9') num[0] -= 10; 25 | printf("%s\n", num); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /poj-cpp/2602/14334021_AC_469MS_1360K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char num[1000010]; 4 | int N; 5 | 6 | int main() 7 | { 8 | int i, a, b; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i0; i--) { 19 | if(num[i]>'9') { 20 | num[i] -= 10; 21 | num[i-1] += 1; 22 | } 23 | } 24 | if(num[0]>'9') num[0] -= 10; 25 | printf("%s\n", num); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /poj-cpp/2602/14334024_AC_454MS_1360K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char num[1000010]; 4 | int N; 5 | 6 | int main() 7 | { 8 | int i, a, b; 9 | 10 | scanf("%d", &N); 11 | for(i=0; i0; i--) { 19 | if(num[i]>'9') { 20 | num[i] -= 10; 21 | num[i-1] += 1; 22 | } 23 | } 24 | if(num[0]>'9') { 25 | num[0] -= 10; 26 | putchar('1'); 27 | } printf("%s\n", num); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /poj-cpp/2608/14795358_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int maps[26] = {0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5, 5, 0, 1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2}; 4 | 5 | int main() 6 | { 7 | char str[30]; 8 | 9 | while(~scanf("%s", str)) { 10 | for(int i=0; str[i]; i++) { 11 | if(!maps[str[i]-'A']) continue; 12 | if(maps[str[i]-'A']==maps[str[i-1]-'A']) continue; 13 | printf("%d", maps[str[i]-'A']); 14 | } 15 | printf("\n"); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/2623/14819455_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | const int maxn = 250005; 7 | int arr[maxn], N; 8 | 9 | int main() 10 | { 11 | scanf("%d", &N); 12 | for(int i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | const int maxn = 250005; 7 | long long arr[maxn], N; 8 | 9 | int main() 10 | { 11 | scanf("%d", &N); 12 | for(int i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | const int maxn = 250005; 7 | long long arr[maxn], N; 8 | 9 | int main() 10 | { 11 | scanf("%d", &N); 12 | for(int i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | const int maxn = 250005; 7 | long long arr[maxn], N; 8 | 9 | int main() 10 | { 11 | scanf("%d", &N); 12 | for(int i=0; i 2 | 3 | struct Point { 4 | double x, y; 5 | Point(double a, double b): 6 | x(a), y(b) {} 7 | Point() {} 8 | Point operator + (Point A) { 9 | return Point(x+A.x, y+A.y); 10 | } 11 | }; 12 | 13 | double a, b, c, d; 14 | 15 | int main() 16 | { 17 | while(~scanf("%lf%lf%lf%lf", &a, &b, &c, &d)) { 18 | Point pa = Point(a-c, b-d); 19 | scanf("%lf%lf%lf%lf", &a, &b, &c, &d); 20 | Point pb = Point(c-a, d-b); 21 | Point pc = pa+pb; 22 | printf("%.3lf %.3lf\n", a+pc.x, b+pc.y); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/2636/14297641_CE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int sum, i, N锛孴, n锛� scanf("%d", &T); 6 | while(T--) { 7 | scanf("%d", &N); 8 | sum = 0; 9 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int sum, i, N锛孴, n; 6 | scanf("%d", &T); 7 | while(T--) { 8 | scanf("%d", &N); 9 | sum = 0; 10 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int i, N, T, sum, n; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d", &N); 10 | sum = 0; 11 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int N, i, maxs, flag, a, b; 6 | 7 | while(scanf("%d", &N) && N) { 8 | flag = 0; maxs = 8; 9 | for(i=1; i<=N; i++) { 10 | scanf("%d%d", &a, &b); 11 | if(a+b>maxs) { 12 | maxs = a+b; 13 | flag = i; 14 | } 15 | } 16 | printf("%d\n", flag); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/2663/14817338_TLE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int N, dp[3][31][8]; 5 | 6 | int dfs(int r, int c, int s) 7 | { 8 | if(c==N) return 1; 9 | if(r==3) return dfs(0, c+1, s); 10 | if(dp[r][c][s]) return dp[r][c][s]; 11 | if(s & 1< 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int L, R, l, r; 9 | 10 | while(scanf("%d%d%d%d", &L, &R, &l, &r)) { 11 | if(!L && !R && !l && !r) break; 12 | double d = min((double)l/L, (double)r/R); 13 | d = max(d, min((double)l/R, (double)r/L)); 14 | if(d>1) d = 1; 15 | printf("%d%%\n", (int)(d*100)); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/2719/14684513_AC_141MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char str[15]; 4 | 5 | int main() 6 | { 7 | while(scanf("%s", str) && str[0]-'0') { 8 | printf("%s: ", str); 9 | for(int i=0; str[i]; i++) { 10 | if(str[i]>'4') 11 | str[i]--; 12 | } 13 | int s = 0; 14 | for(int i=0; str[i]; i++) { 15 | s *= 9; 16 | s += str[i]-'0'; 17 | } 18 | printf("%d\n", s); 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/2828/14321324_TLE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int val[200005], next[200005]; 4 | 5 | int main() 6 | { 7 | int N, i, j, n, v, cnt; 8 | 9 | while(~scanf("%d", &N)) { 10 | cnt = 1; 11 | next[0] = -1; 12 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int hour, minute, T; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d:%d", &hour, &minute); 10 | if(minute!=0) printf("0\n"); 11 | else { 12 | if(hour>12) printf("%d\b", hour-12); 13 | else printf("%d\n", hour+12); 14 | } 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/2840/14366415_AC_0MS_132K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int hour, minute, T; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d:%d", &hour, &minute); 10 | if(minute!=0) printf("0\n"); 11 | else { 12 | if(hour>12) printf("%d\n", hour-12); 13 | else printf("%d\n", hour+12); 14 | } 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/2853/14795473_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int num, n, T; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d%d", &num, &n); 10 | int ans = 0; 11 | for(int i=2; i*(1+i)/2<=n; i++) { 12 | if(0==(n-i*(1+i)/2)%i) ans++; 13 | } 14 | printf("%d %d\n", num, ans); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /poj-cpp/2871/14734699_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | double p, q; 6 | 7 | scanf("%lf", &p); 8 | while(scanf("%lf", &q)) { 9 | if(p==999) break; 10 | printf("%lg\n", q-p); 11 | p = q; 12 | } 13 | printf("End of Output\n"); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/2871/14734701_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | double p, q; 6 | 7 | scanf("%lf", &p); 8 | while(scanf("%lf", &q)) { 9 | if(q==999) break; 10 | printf("%lg\n", q-p); 11 | p = q; 12 | } 13 | printf("End of Output\n"); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/2871/14734703_AC_0MS_372K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | double p, q; 6 | 7 | scanf("%lf", &p); 8 | while(scanf("%lf", &q)) { 9 | if(q==999) break; 10 | printf("%.2f\n", q-p); 11 | p = q; 12 | } 13 | printf("End of Output\n"); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/2909/14555048_AC_0MS_760K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int prim[100005]; 6 | 7 | void get_prim() 8 | { 9 | memset(prim, 0, sizeof(prim)); 10 | prim[0] = prim[1] = 1; 11 | int n = sqrt(100000+0.5); 12 | for(int i=2; i<=n; i++) { 13 | if(prim[i]) continue; 14 | for(int j = i*i; j<100000; j+=i) { 15 | prim[j] = 1; 16 | } 17 | } 18 | } 19 | 20 | int main() 21 | { 22 | get_prim(); 23 | int n; 24 | 25 | while(scanf("%d", &n) && n) { 26 | int ans = 0; 27 | for(int i=2; i<=n/2; i++) { 28 | if(prim[i]) continue; 29 | if(!prim[n-i]) ans++; 30 | } 31 | printf("%d\n", ans); 32 | } 33 | 34 | return 0; 35 | } -------------------------------------------------------------------------------- /poj-cpp/2924/14826064_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | typedef long long ll; 3 | 4 | int main() 5 | { 6 | int T; 7 | ll s, a, b; 8 | scanf("%d", &T); 9 | for(int nC=1; nC<=T; nC++) { 10 | printf("Scenario #%d:\n", nC); 11 | scanf("%lld%lld", &a, &b); 12 | printf("%lld\n\n", (a+b)*(b-a+1)/2); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /poj-cpp/3030/14098714_AC_0MS_152K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, a, b, c; 6 | 7 | scanf("%d", &N); 8 | while(N--) { 9 | scanf("%d%d%d", &a, &b, &c); 10 | if(a==b-c) puts("does not matter"); 11 | else if(a>b-c) puts("do not advertise"); 12 | else puts("advertise"); 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /poj-cpp/3062/14124949_OLE.c: -------------------------------------------------------------------------------- 1 | main(){char str[1024];for(;scanf("%s",str);puts(str));} -------------------------------------------------------------------------------- /poj-cpp/3062/14124951_PE.c: -------------------------------------------------------------------------------- 1 | main(){char str[1024];for(;~scanf("%s",str);puts(str));} -------------------------------------------------------------------------------- /poj-cpp/3062/14124953_OLE.c: -------------------------------------------------------------------------------- 1 | main(){char str[1024];for(;scanf("%s", str);printf("%s",str));} 2 | -------------------------------------------------------------------------------- /poj-cpp/3062/14124955_PE.c: -------------------------------------------------------------------------------- 1 | main(){char str[1024];for(;~scanf("%s", str);printf("%s",str));} 2 | -------------------------------------------------------------------------------- /poj-cpp/3062/14124965_OLE.c: -------------------------------------------------------------------------------- 1 | main(){char str[1024];for(;~gets(str);puts(str));} -------------------------------------------------------------------------------- /poj-cpp/3062/14124978_OLE.c: -------------------------------------------------------------------------------- 1 | main(){while(putchar(getchar()));} -------------------------------------------------------------------------------- /poj-cpp/3062/14124987_RE.c: -------------------------------------------------------------------------------- 1 | main(){char c;for(;~scanf("%c",c);putchar(c));} 2 | -------------------------------------------------------------------------------- /poj-cpp/3062/14125003_AC_0MS_96K.c: -------------------------------------------------------------------------------- 1 | main(){int c;for(;-1!=(c=getchar());putchar(c));} -------------------------------------------------------------------------------- /poj-cpp/3062/14125020_OLE.c: -------------------------------------------------------------------------------- 1 | main(){for(;~putchar(getchar()););} -------------------------------------------------------------------------------- /poj-cpp/3077/14699360_AC_0MS_396K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | int T, n; 9 | 10 | scanf("%d", &T); 11 | while(T--) { 12 | scanf("%d", &n); 13 | int mod = 10; 14 | while(n/mod) { 15 | n = (n+mod*5/10) / mod * mod; 16 | mod *= 10; 17 | } 18 | printf("%d\n", n); 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/3085/14715355_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int T, n, a, b, c, d; 7 | 8 | scanf("%d", &T); 9 | for(int nC=1; nC<=T; nC++) { 10 | scanf("%d", &n); 11 | a = n/25; n %= 25; 12 | b = n/10; n %= 10; 13 | c = n/5; n %= 5; 14 | d = n; 15 | printf("%d %d QUARTER(S), %d DIME(S), %d NICKEL(S), %d PENNY(S)\n", nC, a, b, c, d); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/3086/14699361_AC_0MS_396K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sum[305]; 5 | int wei[305]; 6 | 7 | int main() 8 | { 9 | int T, n; 10 | 11 | sum[0] = 0; 12 | for(int i=1; i<=301; i++) 13 | sum[i] = i + sum[i-1]; 14 | for(int i=1; i<=300; i++) 15 | wei[i] = wei[i-1] + i*sum[i+1]; 16 | 17 | scanf("%d", &T); 18 | for(int nCase=1; nCase<=T; nCase++) { 19 | scanf("%d", &n); 20 | printf("%d %d %d\n", nCase, n, wei[n]); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poj-cpp/3093/13929222_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[150000], cnt[150000], N, i, j, maxs; 9 | 10 | while(~scanf("%d", &N)){ 11 | for(i=0; i 2 | #include 3 | 4 | int main() 5 | { 6 | char str[1024]; 7 | int arr[1024], i, l, sum; 8 | 9 | while(gets(str) && str[0]!='#') { 10 | l = strlen(str); 11 | sum = 0; 12 | for(i=0; i 2 | #include 3 | 4 | int main() 5 | { 6 | int B, N; 7 | 8 | while(scanf("%d%d", &B, &N)) { 9 | if(B==0 && N==0) break; 10 | int m = (int)(pow(B, 1.0/N)+0.5); 11 | int l = m-1, r = m+1; 12 | if(fabs(pow(l, N)-B) < fabs(pow(m, N)-B)) { 13 | printf("%d\n", l); 14 | } else if(fabs(pow(m, N))-B < fabs(pow(r, N)-B)) { 15 | printf("%d\n", m); 16 | } else { 17 | printf("%d\n", r); 18 | } 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/3100/14366674_AC_0MS_384K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int B, N; 7 | 8 | while(scanf("%d%d", &B, &N)) { 9 | if(B==0 && N==0) break; 10 | int m = (int)(pow(B, 1.0/N)+0.5); 11 | int l = m-1, r = m+1; 12 | if(fabs(pow(l, N)-B) < fabs(pow(m, N)-B)) { 13 | printf("%d\n", l); 14 | } else if(fabs(pow(m, N))-B < fabs(pow(r, N)-B)) { 15 | printf("%d\n", m); 16 | } else { 17 | printf("%d\n", r); 18 | } 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/3100/14366722_AC_0MS_388K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int B, N; 7 | 8 | while(scanf("%d%d", &B, &N)) { 9 | if(B==0 && N==0) break; 10 | int l = floor(pow(B, 1.0/N)); 11 | int r = l+1; 12 | if(fabs(pow(l, N)-B) < fabs(pow(r, N)-B)) { 13 | printf("%d\n", l); 14 | } else { 15 | printf("%d\n", r); 16 | } 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/3117/14779402_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int cnt, T, N, t; 6 | char str[128]; 7 | 8 | while(scanf("%d%d", &T, &N) && T) { 9 | cnt = 0; 10 | for(int i=0; i 2 | 3 | int main() 4 | { 5 | int cnt, T, N, t; 6 | char str[128]; 7 | 8 | while(scanf("%d%d", &T, &N) && T) { 9 | cnt = 0; 10 | for(int i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int arr[400][400], N; 7 | 8 | int main() 9 | { 10 | int i, j; 11 | 12 | scanf("%d", &N); 13 | for(i=1; i<=N; i++) { 14 | for(j=1; j<=i; j++) scanf("%d", &arr[i][j]); 15 | } 16 | for(i=N-1; i>0; i--) { 17 | for(j=1; j<=i; j++) { 18 | arr[i][j] += max(arr[i+1][j], arr[i+1][j+1]); 19 | } 20 | } 21 | printf("%d\n", arr[1][1]); 22 | 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/3176/14057552_AC_32MS_696K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int arr[400][400], N; 7 | 8 | int main() 9 | { 10 | int i, j; 11 | 12 | scanf("%d", &N); 13 | for(i=1; i<=N; i++) { 14 | for(j=1; j<=i; j++) scanf("%d", &arr[i][j]); 15 | } 16 | for(i=N-1; i>0; i--) { 17 | for(j=1; j<=i; j++) { 18 | arr[i][j] += max(arr[i+1][j], arr[i+1][j+1]); 19 | } 20 | } 21 | printf("%d", arr[1][1]); 22 | 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/3181/14210927_WA.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int arr[1024][128], ans; 6 | 7 | int dfs(int n, int k); 8 | 9 | int main() 10 | { 11 | int N, K, i; 12 | 13 | memset(arr, 0, sizeof(arr)); 14 | ans = 0; 15 | scanf("%d%d", &N, &K); 16 | dfs(N, K); 17 | printf("%d\n", ans); 18 | 19 | return 0; 20 | } 21 | 22 | int dfs(int n, int k) 23 | { 24 | if(n==0) return ans += 1; 25 | else if(k==0) return 0; 26 | else if(arr[n][k]) return arr[n][k]; 27 | else if(k>n) return arr[n][k] = dfs(n, n); 28 | else { 29 | for(int i=0; n-k*i>=0; i++) { 30 | ///printf("%d ", n-k*i); 31 | arr[n][k] = dfs(n-k*i, k-1); 32 | } 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /poj-cpp/3185/15003606_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int bowl[21]; 4 | 5 | void flip(int n) 6 | { 7 | bowl[n-1] ^= 1; 8 | bowl[n] ^= 1; 9 | bowl[n+1] ^= 1; 10 | } 11 | 12 | int main() 13 | { 14 | for(int i=0; i<20; i++) 15 | scanf("%d", &bowl[i]); 16 | int cnt = 0; 17 | for(int i=0; i<20; i++) { 18 | if(bowl[i]==1) { 19 | flip(i+1); 20 | cnt++; 21 | } 22 | } 23 | printf("%d\n", cnt); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/3210/14718972_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | 7 | while(scanf("%d", &n) && n) { 8 | if(n&1) printf("%d\n", n-1); 9 | else printf("No Solution!\n"); 10 | } 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /poj-cpp/3224/14764588_AC_16MS_388K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int cnt[101]; 4 | 5 | int main() 6 | { 7 | int n, a; 8 | scanf("%d", &n); 9 | for(int i=0; imaxs) { 18 | maxs = cnt[i]; 19 | ans = i; 20 | } 21 | } 22 | printf("%d\n", ans+1); 23 | 24 | return 0; 25 | } -------------------------------------------------------------------------------- /poj-cpp/3250/14785453_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int que[85000], N, top, cnt; 4 | 5 | int main() 6 | { 7 | int a, ans = 0; 8 | top = cnt = 0; 9 | scanf("%d", &N); 10 | while(N--) { 11 | scanf("%d", &a); 12 | while(cnt && que[top-1] 2 | 3 | int que[85000], N, top, cnt; 4 | 5 | int main() 6 | { 7 | int a, ans = 0; 8 | top = cnt = 0; 9 | scanf("%d", &N); 10 | while(N--) { 11 | scanf("%d", &a); 12 | while(cnt && que[top-1]<=a) { 13 | top--; cnt--; 14 | } 15 | ans += cnt; 16 | que[top++] = a; cnt++; 17 | } 18 | printf("%d\n", ans); 19 | 20 | return 0; 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /poj-cpp/3250/14785468_AC_172MS_672K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int que[85000], N, top, cnt; 4 | 5 | int main() 6 | { 7 | int a; 8 | unsigned long long ans = 0; 9 | top = cnt = 0; 10 | scanf("%d", &N); 11 | while(N--) { 12 | scanf("%d", &a); 13 | while(cnt && que[top-1]<=a) { 14 | top--; cnt--; 15 | } 16 | ans += cnt; 17 | que[top++] = a; cnt++; 18 | } 19 | printf("%lld\n", ans); 20 | 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /poj-cpp/3253/13917281_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct cmp{ 7 | int operator ()(int a, int b){ 8 | return a>b; 9 | } 10 | }; 11 | 12 | int main(){ 13 | priority_queue, cmp> pq; 14 | int N, t, i, cnt; 15 | 16 | scanf("%d", &N); 17 | for(i=0; i1){ 23 | t = pq.top(); 24 | pq.pop(); 25 | t += pq.top(); 26 | pq.pop(); 27 | cnt += t; 28 | pq.push(t); 29 | } 30 | printf("%d\n", cnt); 31 | 32 | 33 | return 0; 34 | } -------------------------------------------------------------------------------- /poj-cpp/3253/13917288_AC_32MS_356K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct cmp{ 7 | int operator ()(int a, int b){ 8 | return a>b; 9 | } 10 | }; 11 | 12 | int main(){ 13 | priority_queue, cmp> pq; 14 | int t; 15 | long long N, i, cnt; 16 | 17 | scanf("%lld", &N); 18 | for(i=0; i1){ 24 | t = pq.top(); 25 | pq.pop(); 26 | t += pq.top(); 27 | pq.pop(); 28 | cnt += t; 29 | pq.push(t); 30 | } 31 | printf("%lld\n", cnt); 32 | 33 | 34 | return 0; 35 | } -------------------------------------------------------------------------------- /poj-cpp/3253/14043744_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int arr[30000], N, i, sum, rzt; 9 | 10 | scanf("%d", &N); 11 | sum = 0; 12 | for(i=0; i1; i--) rzt += (sum-=arr[i]); 19 | printf("%d\n", rzt); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /poj-cpp/3253/14043811_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | long long arr[30000], N, i, sum, rzt; 9 | 10 | scanf("%lld", &N); 11 | sum = 0; 12 | for(i=0; i1; i--) rzt += (sum-=arr[i]); 19 | printf("%lld\n", rzt); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /poj-cpp/3277/14766051_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef long long ll; 4 | 5 | int main() 6 | { 7 | int N; 8 | ll a, b, h, ans = 0; 9 | scanf("%d", &N); 10 | while(N--) { 11 | scanf("%lld%lld%lld", &a, &b, &h); 12 | ans += (b-a)*h; 13 | } 14 | printf("%lld\n", ans-1); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /poj-cpp/3299/13724837_CE.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define exp(x) pow(2.718281828, (x)) 6 | 7 | int main(){ 8 | double t, d, h, e; 9 | char input[30]; 10 | 11 | while(gets(input)){ 12 | if(0==strcmp(input, "E")) return 0; 13 | sscanf(input, "T %lf D %lf", &t, &d); 14 | e = 6.11*exp(5417.7530*((1/273.16)-(1/(d+273.16)))); 15 | h = (0.5555)*(e-10.0); 16 | printf("%s H %.1lf\n", input, t+h); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/3299/13724839_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define exp(x) pow(2.718281828, (x)) 6 | 7 | int main(){ 8 | double t, d, h, e; 9 | char input[30]; 10 | 11 | while(gets(input)){ 12 | if(0==strcmp(input, "E")) return 0; 13 | sscanf(input, "T %lf D %lf", &t, &d); 14 | e = 6.11*exp(5417.7530*((1/273.16)-(1/(d+273.16)))); 15 | h = (0.5555)*(e-10.0); 16 | printf("%s H %.1lf\n", input, t+h); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/3299/13724849_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define exp(x) pow(2.718281828, (x)) 6 | 7 | int main(){ 8 | double t, d, h, e; 9 | char input[30]; 10 | 11 | while(gets(input)){ 12 | if(0==strcmp(input, "E")) return 0; 13 | sscanf(input, "T %lf D %lf", &t, &d); 14 | e = 6.11*exp(5417.7530*((1/273.16)-(1/(d+273.16)))); 15 | h = (0.5555)*(e-10.0); 16 | printf("T %.1lf D %.1lf H %.1lf\n", t, d, t+h); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /poj-cpp/3299/13724861_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define exp(x) pow(2.718281828, (x)) 6 | 7 | int main(){ 8 | double t, d, h, e; 9 | char input[30]; 10 | 11 | while(gets(input)){ 12 | if(0==strcmp(input, "E")) return 0; 13 | sscanf(input, "T %lf D %lf", &t, &d); 14 | e = 6.11*exp(5417.7530*((1/273.16)-(1/(d+273.16)))); 15 | h = (0.5555)*(e-10.0); 16 | printf("T %.1lf D %.1lf H %.1lf\n", t, d, t+h); 17 | } 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /poj-cpp/3299/13724866_WA.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define exp(x) pow(2.718281828, (x)) 6 | 7 | int main(){ 8 | double t, d, h, e; 9 | char input[30]; 10 | 11 | while(gets(input)){ 12 | t = d = h = e =0; 13 | if(0==strcmp(input, "E")) return 0; 14 | sscanf(input, "T %lf D %lf", &t, &d); 15 | e = 6.11*exp(5417.7530*((1/273.16)-(1/(d+273.16)))); 16 | h = (0.5555)*(e-10.0); 17 | printf("T %.1lf D %.1lf H %.1lf\n", t, d, t+h); 18 | } 19 | 20 | return 0; 21 | } -------------------------------------------------------------------------------- /poj-cpp/3320/14159886_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int arr[1100000], N, i, ans, t; 5 | 6 | int main() 7 | { 8 | scanf("%d", &N); 9 | memset(arr, 0, sizeof(arr)); 10 | ans = 0; 11 | for(i=0; i 2 | #include 3 | 4 | int main() 5 | { 6 | int N, n, sum, maxs, mins; 7 | 8 | while(scanf("%d", &N) && N) { 9 | sum = 0; mins = 1024; maxs = -1; 10 | for(int i=0; imaxs) maxs = n; 14 | if(n 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | char S1[1024], S2[1024]; 8 | int dp[1024][1024]; 9 | 10 | int main() 11 | { 12 | int N, M; 13 | 14 | scanf("%d%s%d%s", &M, S1+1, &N, S2+1); 15 | dp[0][0] = 0; 16 | for(int i=1; i<=M; i++) { 17 | for(int j=1; j<=N; j++) { 18 | if(S1[i]==S2[j]) dp[i][j] = dp[i-1][j-1]+1; 19 | else dp[i][j] = max(dp[i-1][j], dp[i][j-1]); 20 | } 21 | } 22 | printf("%d\n", N-dp[M][N]); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/3356/14827226_AC_0MS_4376K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | char S1[1024], S2[1024]; 8 | int dp[1024][1024]; 9 | 10 | int main() 11 | { 12 | int N, M; 13 | 14 | while(~scanf("%d%s%d%s", &M, S1+1, &N, S2+1)) { 15 | dp[0][0] = 0; 16 | for(int i=1; i<=M; i++) { 17 | for(int j=1; j<=N; j++) { 18 | if(S1[i]==S2[j]) dp[i][j] = dp[i-1][j-1]+1; 19 | else dp[i][j] = max(dp[i-1][j], dp[i][j-1]); 20 | } 21 | } 22 | printf("%d\n", N-dp[M][N]); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/3372/14885889_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, i; 6 | 7 | while(~scanf("%d", &N)) { 8 | for(i=0; 1< 2 | 3 | int main() 4 | { 5 | int N, i; 6 | 7 | while(~scanf("%d", &N)) { 8 | for(i=0; 1< 2 | 3 | int main() 4 | { 5 | int cnt, n, T; 6 | 7 | scanf("%d", &T); 8 | getchar(); 9 | while(T--) { 10 | n = getchar(); 11 | cnt = 1; 12 | while(1) { 13 | int ch = getchar(); 14 | if(ch!=n) { 15 | printf("%d%c", cnt, n); 16 | n = ch; 17 | cnt = 1; 18 | } else { 19 | cnt ++; 20 | } 21 | if(ch=='\n') break; 22 | } 23 | printf("\n"); 24 | } 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /poj-cpp/3507/14820996_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a, b, c, d, e, f; 6 | 7 | while(scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f)) { 8 | if(!a && !b && !c && !d && !e && !f) break; 9 | printf("%g\n", (a+b+c+d+e+f)/6.0); 10 | } 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /poj-cpp/3507/14821002_WA.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int arr[6]; 6 | 7 | while(1) { 8 | int maxs = 0; 9 | int mins = 0x3f3f3f3f; 10 | int sum = 0; 11 | for(int i=0; i<6; i++) { 12 | scanf("%d", &arr[i]); 13 | if(arr[i]>maxs) maxs = arr[i]; 14 | if(arr[i] 2 | 3 | int main() 4 | { 5 | int arr[6]; 6 | 7 | while(1) { 8 | int maxs = 0; 9 | int mins = 0x3f3f3f3f; 10 | int sum = 0; 11 | for(int i=0; i<6; i++) { 12 | scanf("%d", &arr[i]); 13 | if(arr[i]>maxs) maxs = arr[i]; 14 | if(arr[i] 2 | 3 | int main() 4 | { 5 | char n1[5], n2[5]; 6 | int i, j, ca, cb, T; 7 | 8 | scanf("%d", &T); 9 | while(T--) { 10 | scanf("%s%s", n1, n2); 11 | ca = cb = 0; 12 | for(i=0; i<4; i++) if(n1[i]==n2[i]) ca++; 13 | for(i=0; i<4; i++) 14 | for(j=0; j<4; j++) 15 | if(n1[i]==n2[j]) { 16 | cb++; 17 | n2[j] = '*'; 18 | } 19 | printf("%dA%dB\n", ca, cb-ca); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /poj-cpp/3617/14541935_PE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char str[2048]; 5 | 6 | int judge(int s, int t) 7 | { 8 | while(s<=t && str[s]==str[t]) { 9 | s++; t--; 10 | } 11 | return str[s]str[s]) { 30 | putchar(str[t]); 31 | t--; 32 | } else { 33 | if(judge(s, t)) { 34 | putchar(str[s]); 35 | s++; 36 | } else { 37 | putchar(str[t]); 38 | t--; 39 | } 40 | } 41 | } 42 | 43 | return 0; 44 | } -------------------------------------------------------------------------------- /poj-cpp/3619/14813824_AC_47MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, K; 6 | int s, t, r; 7 | 8 | scanf("%d%d", &N, &K); 9 | while(K--) { 10 | int cnt = N; 11 | scanf("%d%d%d", &s, &t, &r); 12 | int n = cnt / (s*t); 13 | int ans = n*(t+r); 14 | cnt %= s*t; 15 | if(!cnt) { 16 | ans -= r; 17 | } else { 18 | n = cnt / s; 19 | ans += n; 20 | if(cnt%s) ans++; 21 | } 22 | printf("%d\n", ans); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /poj-cpp/3624/13967980_RE.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int V, N, f[3500], v[3500], w[3500], i, j; 9 | 10 | scanf("%d%d", &N, &V); 11 | for(i=0; i=v[i]; j--){ 16 | f[j] = max(f[j], f[j-v[i]]+w[i]); 17 | } 18 | } 19 | printf("%d\n", f[V]); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /poj-cpp/3624/13967984_AC_297MS_568K.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int V, N, f[35000], v[35000], w[35000], i, j; 9 | 10 | scanf("%d%d", &N, &V); 11 | for(i=0; i=v[i]; j--){ 16 | f[j] = max(f[j], f[j-v[i]]+w[i]); 17 | } 18 | } 19 | printf("%d\n", f[V]); 20 | 21 | return 0; 22 | } -------------------------------------------------------------------------------- /poj-cpp/3624/14718840_AC_266MS_440K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | const int maxn = 13000; 8 | 9 | int V, N, f[maxn], v[maxn], w[maxn]; 10 | 11 | int main() 12 | { 13 | int i, j; 14 | 15 | memset(f, 0, sizeof(f)); 16 | scanf("%d%d", &N, &V); 17 | for(i=0; i=v[i]; j--){ 22 | f[j] = max(f[j], f[j-v[i]]+w[i]); 23 | } 24 | } 25 | printf("%d\n", f[V]); 26 | 27 | return 0; 28 | } -------------------------------------------------------------------------------- /poj-cpp/3627/14814057_RE.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int cow[10005]; 7 | 8 | int cmp(int a, int b) 9 | { 10 | return a > b; 11 | } 12 | 13 | int main() 14 | { 15 | int N, B; 16 | 17 | scanf("%d%d", &N, &B); 18 | for(int i=0; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | int cow[20005]; 7 | 8 | int cmp(int a, int b) 9 | { 10 | return a > b; 11 | } 12 | 13 | int main() 14 | { 15 | int N, B; 16 | 17 | scanf("%d%d", &N, &B); 18 | for(int i=0; i 2 | 3 | int main() 4 | { 5 | int N, B, cow[20]; 6 | scanf("%d%d", &N, &B); 7 | for(int i=0; i=B && sum-B 2 | #include 3 | 4 | using namespace std; 5 | 6 | int arr[30]; 7 | 8 | int main() 9 | { 10 | int T, N; 11 | 12 | scanf("%d", &T); 13 | while(T--) { 14 | scanf("%d", &N); 15 | for(int i=0; i> 1; 19 | int sum = 0; 20 | sum += arr[m]-arr[0] + arr[N-1]-arr[m]; 21 | printf("%d\n", sum*2); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/3637/14891874_AC_94MS_428K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int buy[20010], N; 7 | 8 | int main() 9 | { 10 | int T; 11 | scanf("%d", &T); 12 | while(T--) { 13 | scanf("%d", &N); 14 | for(int i=0; i=0; i-=3) { 19 | ans += buy[i]; 20 | } 21 | printf("%d\n", ans); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/3650/14678748_AC_0MS_340K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char ch; 6 | 7 | while((ch=getchar()) != '#') { 8 | if(ch==' ') printf("%%20"); 9 | else if(ch=='!') printf("%%21"); 10 | else if(ch=='$') printf("%%24"); 11 | else if(ch=='%') printf("%%25"); 12 | else if(ch=='(') printf("%%28"); 13 | else if(ch==')') printf("%%29"); 14 | else if(ch=='*') printf("%%2a"); 15 | else putchar(ch); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/3663/14734761_AC_47MS_436K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int len[20005]; 8 | int N, S; 9 | 10 | int main() 11 | { 12 | scanf("%d%d", &N, &S); 13 | for(int i=0; i 2 | 3 | int main() 4 | { 5 | int m, n, arr1[20], arr2[20], i, j, cnt, na, ma; 6 | 7 | scanf("%d%d", &m, &n); 8 | ma = na = 0; 9 | while(m%10) { 10 | arr1[ma++] = m%10; 11 | m /= 10; 12 | } 13 | while(n%10) { 14 | arr2[na++] = n%10; 15 | n /= 10; 16 | } 17 | cnt = 0; 18 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int m, n, arr1[20], arr2[20], i, j, cnt, na, ma; 6 | 7 | scanf("%d%d", &m, &n); 8 | ma = na = 0; 9 | while(m%10) { 10 | arr1[ma++] = m%10; 11 | m /= 10; 12 | } 13 | while(n%10) { 14 | arr2[na++] = n%10; 15 | n /= 10; 16 | } 17 | cnt = 0; 18 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int m, n, arr1[20], arr2[20], i, j, cnt, na, ma; 6 | 7 | scanf("%d%d", &m, &n); 8 | ma = na = 0; 9 | while(m) { 10 | arr1[ma++] = m%10; 11 | m /= 10; 12 | } 13 | while(n) { 14 | arr2[na++] = n%10; 15 | n /= 10; 16 | } 17 | cnt = 0; 18 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int m, n; 6 | char arr1[10], arr2[10], i, j, na, ma; 7 | short cnt; 8 | 9 | scanf("%d%d", &m, &n); 10 | ma = na = 0; 11 | while(m) { 12 | arr1[ma++] = m%10; 13 | m /= 10; 14 | } 15 | while(n) { 16 | arr2[na++] = n%10; 17 | n /= 10; 18 | } 19 | cnt = 0; 20 | for(i=0; i 2 | 3 | int main() 4 | { 5 | int r, x, y; 6 | scanf("%x,%d,%d", &r, &x, &y); 7 | if(r&1< 2 | #include 3 | 4 | char maps[30] = "VWXYZABCDEFGHIJKLMNOPQRSTU"; 5 | 6 | int main() 7 | { 8 | char str[10], ch; 9 | 10 | while(scanf("%s", str)) { 11 | if(!strcmp(str, "ENDOFINPUT")) 12 | break; 13 | getchar(); 14 | while((ch=getchar())!='\n') 15 | if(ch<='Z' && ch>='A') 16 | putchar(maps[ch-'A']); 17 | else putchar(ch); 18 | putchar('\n'); 19 | scanf("%s", str); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /poj-cpp/3751/14865453_AC_0MS_356K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int ye, mo, da, ho, mi, se, T, ok; 6 | 7 | scanf("%d", &T); 8 | while(T--) { 9 | scanf("%d/%d/%d-%d:%d:%d", &ye, &mo, &da, &ho, &mi, &se); 10 | if(ho>=12) ok = 1; 11 | else ok = 0; 12 | if(ho>12) ho -= 12; 13 | else if(ho==0) ho = 12; 14 | printf("%02d/%02d/%02d-%02d:%02d:%02d", mo, da, ye, ho, mi, se); 15 | printf("%s\n", ok ? "pm": "am"); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /poj-cpp/3800/14908262_AC_0MS_-784K.c: -------------------------------------------------------------------------------- 1 | main(){} -------------------------------------------------------------------------------- /poj-cpp/3903/13929229_WA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[150000], cnt[150000], N, i, j, maxs; 9 | 10 | while(~scanf("%d", &N)){ 11 | for(i=0; i 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(){ 8 | int num[150000], t[150000], cnt[150000], N, i, j, maxs; 9 | 10 | while(~scanf("%d", &N)){ 11 | for(i=0; i 2 | 3 | int gcd(int a, int b) 4 | { 5 | return b ? gcd(b, a%b) : a; 6 | } 7 | 8 | int main() 9 | { 10 | int a, b, c, d; 11 | char op; 12 | while(~scanf("%d/%d%c%d/%d", &a, &b, &op, &c, &d)) { 13 | int e = b/gcd(b, d)*d; 14 | a *= e/b; c *= e/d; 15 | if(op=='+') a += c; 16 | else a -= c; 17 | int f = gcd(a, e); 18 | a /= f; e /= f; 19 | if(e<0) {e *= -1; a *= -1;} 20 | if(0==a%e) printf("%d\n", a/e); 21 | else printf("%d/%d\n", a, e); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /poj-cpp/3980/14256915_CE.cc: -------------------------------------------------------------------------------- 1 | main(){int a,b;for(;scanf("%d%d",&a,&b);printf("%d\n",a%b));} -------------------------------------------------------------------------------- /poj-cpp/3980/14256917_OLE.c: -------------------------------------------------------------------------------- 1 | main(){int a,b;for(;scanf("%d%d",&a,&b);printf("%d\n",a%b));} -------------------------------------------------------------------------------- /poj-cpp/3980/14256920_AC_125MS_160K.c: -------------------------------------------------------------------------------- 1 | main(){int a,b;for(;~scanf("%d%d",&a,&b);printf("%d\n",a%b));} -------------------------------------------------------------------------------- /poj-cpp/3980/14323047_WA.c: -------------------------------------------------------------------------------- 1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));} -------------------------------------------------------------------------------- /poj-cpp/3980/14323048_AC_110MS_148K.c: -------------------------------------------------------------------------------- 1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a%b));} -------------------------------------------------------------------------------- /poj-cpp/3981/14723653_AC_0MS_336K.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char str[1024]; 7 | 8 | while(gets(str)) { 9 | int l = strlen(str); 10 | for(int i=0; i