├── OldStuff ├── POI │ ├── 1998 │ │ └── PLE.CPP │ ├── 2000 │ │ ├── pas │ │ ├── pas.o │ │ └── pas.cpp │ ├── 2001 │ │ └── ANT.CPP │ └── 2002 │ │ ├── MIN.CPP │ │ └── IZO.CPP ├── CodeChef │ ├── chmod │ ├── shiro │ ├── cntsols │ ├── shiro.o │ ├── .fuse_hidden0000003f00000004 │ ├── .fuse_hidden000000730000000a │ ├── .fuse_hidden000000760000000b │ └── .fuse_hidden0000007a0000000c ├── SPOJ │ ├── PT07X.CPP │ ├── challenge │ │ ├── sizecon.c │ │ └── expr2.c │ ├── new11 │ │ └── qmax3vn.cpp │ ├── new15 │ │ └── acpc10g.cpp │ ├── new6 │ │ ├── ofortune.cpp │ │ ├── gny07h.cpp │ │ └── gny07f.cpp │ ├── new10 │ │ ├── lagrange.cpp │ │ ├── tcount3.c │ │ ├── fence1.cpp │ │ ├── knightsr.cpp │ │ ├── triomino.cpp │ │ ├── mergsort.cpp │ │ └── mcoins.cpp │ ├── new12 │ │ └── alicecub.bfs.cpp │ ├── KAMIL.CPP │ ├── BCEASY.C │ ├── TEST.CPP │ ├── FCTRL.CPP │ ├── new8 │ │ └── act.cpp │ ├── EIGHTS.CPP │ ├── HUBULLU.CPP │ ├── DIVSUM.CPP │ ├── new7 │ │ ├── quadarea.cpp │ │ ├── lastdig.cpp │ │ └── patheads.cpp │ ├── new │ │ ├── gny07a.cpp │ │ ├── palace.cpp │ │ └── mkmoney.cpp │ ├── EASYPROB.TEXT │ ├── ADDREV.CPP │ ├── MKLABELS.CPP │ ├── ICODER.CPP │ ├── CANDY3.CPP │ ├── CANTON.CPP │ ├── new4 │ │ └── gcd2.cpp │ ├── COWCAR.CPP │ ├── new1 │ │ ├── gny07b.cpp │ │ └── scales.cpp │ ├── PERMUT2.CPP │ ├── CYLINDER.CPP │ ├── ONP.CPP │ ├── new5 │ │ ├── grocery.cpp │ │ └── dragoncu.cpp │ ├── new3 │ │ ├── broul.cpp │ │ └── sprime.cpp │ ├── ABSYS.CPP │ ├── AIBOHP.CPP │ ├── ASSIST.CPP │ ├── EXCHNG.CPP │ ├── ROADNET.CPP │ ├── FCTRL2.CPP │ └── REPEATS.CPP ├── PSN │ ├── 1996 │ │ └── HUN030.PAS │ ├── 1998 │ │ ├── POR010.PAS │ │ └── POR014.PAS │ ├── 1999 │ │ ├── TUR004.PAS │ │ ├── TUR009.PAS │ │ ├── TUR033.PAS │ │ ├── TUR055.PAS │ │ ├── TUR061.PAS │ │ ├── TUR068.PAS │ │ ├── TUR069.PAS │ │ ├── TUR094.PAS │ │ ├── TUR096.PAS │ │ ├── TUR098.PAS │ │ └── TUR099.PAS │ ├── 2000 │ │ ├── CHN001.PAS │ │ ├── CHN007.PAS │ │ ├── CHN010.PAS │ │ ├── CHN018.PAS │ │ ├── CHN019.PAS │ │ ├── CHN023.PAS │ │ ├── CHN042.PAS │ │ ├── CHN045.PAS │ │ ├── CHN051.PAS │ │ ├── CHN061.PAS │ │ ├── CHN064.PAS │ │ ├── CHN066.PAS │ │ ├── CHN089.PAS │ │ └── CHN108.PAS │ ├── 2001 │ │ ├── FND001.PAS │ │ ├── FND022.CPP │ │ ├── FND033.PAS │ │ ├── FND039.PAS │ │ ├── FND054.PAS │ │ ├── FND065.PAS │ │ ├── FND070.PAS │ │ └── FND088.PAS │ ├── 2002 │ │ ├── KOR001.PAS │ │ ├── KOR012.PAS │ │ ├── KOR013.PAS │ │ ├── KOR024.PAS │ │ ├── KOR028.PAS │ │ ├── KOR030.PAS │ │ ├── KOR032.PAS │ │ ├── KOR038.PAS │ │ ├── KOR042.PAS │ │ ├── KOR045.PAS │ │ ├── KOR064.PAS │ │ ├── KOR065.PAS │ │ ├── KOR066.PAS │ │ ├── KOR071.PAS │ │ ├── KOR074.PAS │ │ ├── KOR076.PAS │ │ ├── KOR083.PAS │ │ ├── KOR086.PAS │ │ ├── KOR090.PAS │ │ ├── KOR093.PAS │ │ ├── KOR096.PAS │ │ ├── KOR110.PAS │ │ ├── KOR113.PAS │ │ ├── KOR131.PAS │ │ └── KOR132.PAS │ ├── 2003 │ │ ├── USA009.PAS │ │ ├── USA011.PAS │ │ ├── USA013.CPP │ │ ├── USA021.PAS │ │ ├── USA038.PAS │ │ ├── USA039.PAS │ │ ├── USA048.PAS │ │ ├── USA049.PAS │ │ ├── USA051.PAS │ │ ├── USA051.cpp │ │ ├── USA052.PAS │ │ ├── USA053.PAS │ │ ├── USA056.PAS │ │ ├── USA060.PAS │ │ ├── USA062.PAS │ │ ├── USA064.PAS │ │ ├── USA065.PAS │ │ ├── USA069.PAS │ │ ├── USA094.PAS │ │ └── USA102.PAS │ ├── 2004 │ │ ├── GRE010.PAS │ │ ├── GRE017.PAS │ │ ├── GRE018.PAS │ │ ├── GRE025.PAS │ │ ├── GRE030.PAS │ │ ├── GRE032.PAS │ │ ├── GRE035.PAS │ │ ├── GRE036.PAS │ │ ├── GRE039.PAS │ │ ├── GRE043.PAS │ │ ├── GRE058.PAS │ │ ├── GRE065.PAS │ │ ├── GRE071.PAS │ │ ├── GRE073.PAS │ │ ├── GRE077.PAS │ │ ├── GRE081.PAS │ │ ├── GRE086.PAS │ │ ├── GRE089.PAS │ │ ├── GRE090.CPP │ │ ├── GRE102.PAS │ │ ├── GRE123.PAS │ │ ├── GRE124.PAS │ │ └── GRE125.PAS │ ├── 2005 │ │ ├── POL004.PAS │ │ ├── POL006.CPP │ │ ├── POL006.PAS │ │ ├── POL007.PAS │ │ ├── POL010.CPP │ │ ├── POL013.PAS │ │ ├── POL015.PAS │ │ ├── POL016.PAS │ │ ├── POL018.PAS │ │ ├── POL019.PAS │ │ ├── POL020.PAS │ │ ├── POL023.PAS │ │ ├── POL024.PAS │ │ ├── POL025.PAS │ │ ├── POL026.PAS │ │ ├── POL029.PAS │ │ ├── POL032.CPP │ │ ├── POL032.PAS │ │ ├── POL033.PAS │ │ ├── POL035.PAS │ │ ├── POL036.PAS │ │ ├── POL038.PAS │ │ ├── POL039.PAS │ │ ├── POL041.PAS │ │ ├── POL042.PAS │ │ ├── POL043.PAS │ │ ├── POL045.PAS │ │ ├── POL046.PAS │ │ ├── POL047.PAS │ │ ├── POL048.PAS │ │ ├── POL051.PAS │ │ ├── POL066.PAS │ │ ├── POL069.PAS │ │ ├── POL070.PAS │ │ ├── POL071.PAS │ │ ├── POL072.PAS │ │ ├── POL075.PAS │ │ ├── POL076.PAS │ │ ├── POL077.CPP │ │ ├── POL077.PAS │ │ ├── POL078.PAS │ │ ├── POL079.PAS │ │ ├── POL084.PAS │ │ ├── POL085.PAS │ │ ├── POL089.PAS │ │ ├── POL090.PAS │ │ ├── POL093.PAS │ │ └── POL094.CPP │ ├── 2006 │ │ ├── MEX008.PAS │ │ ├── MEX009.PAS │ │ ├── MEX015.PAS │ │ ├── MEX016.PAS │ │ ├── MEX017.PAS │ │ ├── MEX018.PAS │ │ ├── MEX019.PAS │ │ ├── MEX021.PAS │ │ ├── MEX027.PAS │ │ ├── MEX030.PAS │ │ ├── MEX032.PAS │ │ ├── MEX042.PAS │ │ ├── MEX045.PAS │ │ ├── MEX046.PAS │ │ ├── MEX048.PAS │ │ ├── MEX049.PAS │ │ ├── MEX054.PAS │ │ ├── MEX062.PAS │ │ ├── MEX066.PAS │ │ ├── MEX082.PAS │ │ ├── MEX084.PAS │ │ ├── MEX085.PAS │ │ ├── MEX086.PAS │ │ ├── MEX088.PAS │ │ ├── MEX089.PAS │ │ ├── MEX090.PAS │ │ ├── MEX091.PAS │ │ ├── MEX092.PAS │ │ ├── MEX093.PAS │ │ ├── MEX094.CPP │ │ ├── MEX097.PAS │ │ ├── MEX098.PAS │ │ ├── MEX099.PAS │ │ ├── MEX102.PAS │ │ ├── MEX103.PAS │ │ ├── MEX105.PAS │ │ ├── MEX106.PAS │ │ ├── MEX107.PAS │ │ ├── MEX128.PAS │ │ ├── MEX129.PAS │ │ ├── MEX148.PAS │ │ └── MEX128a.PAS │ ├── 2007 │ │ ├── CRO001.CPP │ │ ├── CRO002.CPP │ │ ├── CRO004.CPP │ │ ├── CRO009.PAS │ │ ├── CRO011.PAS │ │ ├── CRO013.PAS │ │ ├── CRO014.PAS │ │ ├── CRO016.PAS │ │ ├── CRO017.PAS │ │ ├── CRO018.PAS │ │ ├── CRO019.CPP │ │ ├── CRO020.PAS │ │ ├── CRO022.CPP │ │ ├── CRO023.PAS │ │ ├── CRO024.PAS │ │ ├── CRO025.CPP │ │ ├── CRO026.PAS │ │ ├── CRO027.PAS │ │ ├── CRO028.PAS │ │ ├── CRO029.PAS │ │ ├── CRO031.PAS │ │ ├── CRO032.CPP │ │ ├── CRO034.CPP │ │ ├── CRO035.PAS │ │ ├── CRO036.PAS │ │ ├── CRO038.CPP │ │ ├── CRO041.CPP │ │ ├── CRO043.CPP │ │ ├── CRO044.CPP │ │ ├── CRO044.PAS │ │ ├── CRO048.PAS │ │ ├── CRO049.PAS │ │ ├── CRO052.CPP │ │ ├── CRO053.CPP │ │ ├── CRO054.PAS │ │ ├── CRO055.PAS │ │ ├── CRO056.PAS │ │ ├── CRO057.PAS │ │ ├── CRO058.CPP │ │ ├── CRO059.CPP │ │ ├── CRO060.CPP │ │ ├── CRO061.CPP │ │ ├── CRO065.CPP │ │ ├── CRO067.CPP │ │ ├── CRO068.PAS │ │ ├── CRO069.CPP │ │ ├── CRO070.CPP │ │ ├── CRO071.CPP │ │ ├── CRO073.CPP │ │ ├── CRO074.CPP │ │ ├── CRO078.CPP │ │ ├── CRO081.CPP │ │ ├── CRO083.CPP │ │ ├── CRO085.CPP │ │ ├── CRO086.CPP │ │ ├── CRO087.CPP │ │ ├── CRO091.CPP │ │ ├── CRO106.CPP │ │ ├── CRO107.CPP │ │ ├── CRO108.CPP │ │ ├── CRO109.CPP │ │ ├── CRO110.CPP │ │ ├── CRO111.CPP │ │ ├── CRO113.CPP │ │ ├── CRO114.CPP │ │ ├── CRO119.CPP │ │ ├── CRO120.CPP │ │ ├── CRO121.CPP │ │ ├── CRO122.CPP │ │ ├── CRO123.CPP │ │ ├── CRO125.CPP │ │ ├── CRO126.CPP │ │ ├── CRO127.CPP │ │ ├── CRO128.CPP │ │ ├── CRO129.CPP │ │ ├── CRO130.CPP │ │ ├── CRO134.CPP │ │ ├── CRO137.CPP │ │ ├── CRO138.CPP │ │ ├── CRO140.CPP │ │ ├── CRO143.CPP │ │ ├── CRO004a.CPP │ │ ├── CRO129a.CPP │ │ └── CRO002_CHECK.CPP │ └── 2008 │ │ ├── EGY019.CPP │ │ ├── EGY023.CPP │ │ ├── EGY026.CPP │ │ └── EGY031.CPP ├── Others │ └── CopaUCI2008 │ │ └── A.CPP ├── MIPT │ ├── new │ │ ├── Happy Tickets.htm │ │ ├── Happy Tickets_files │ │ │ ├── 6259 │ │ │ ├── IGP.jpg │ │ │ ├── Q07_75.jpg │ │ │ ├── Q08_89.jpg │ │ │ ├── Q11_78.gif │ │ │ ├── Q12_76.jpg │ │ │ ├── Tickets1.jpg │ │ │ ├── Tickets2.jpg │ │ │ ├── Tickets3.jpg │ │ │ ├── Tickets4.gif │ │ │ ├── Tickets5.gif │ │ │ ├── Tickets6.gif │ │ │ ├── Tickets7.gif │ │ │ ├── Tickets8.gif │ │ │ ├── counter.xhtml │ │ │ └── narod_init.js │ │ └── mipt124.cpp │ ├── MIPT000.CPP │ ├── MIPT001.CPP │ ├── new2 │ │ ├── mipt027.cpp │ │ ├── mipt100.cpp │ │ ├── mipt086.cpp │ │ ├── mipt201.cpp │ │ ├── mipt047.cpp │ │ ├── mipt059.cpp │ │ └── mipt101.cpp │ ├── MIPT008.CPP │ ├── MIPT026.CPP │ ├── MIPT027.CPP │ ├── MIPT002.CPP │ ├── MIPT006.CPP │ └── MIPT004.CPP ├── USACO │ ├── 2005 │ │ ├── MAR │ │ │ ├── BRONZE │ │ │ │ ├── DNA.CPP │ │ │ │ ├── PAL.CPP │ │ │ │ └── NPTWO.CPP │ │ │ ├── GOLD │ │ │ │ ├── ELEVATOR.CPP │ │ │ │ └── YOGFAC.CPP │ │ │ └── SILVER │ │ │ │ ├── ALIBI.CPP │ │ │ │ ├── YOGURT.CPP │ │ │ │ ├── OUTOFHAY_PRIM.CPP │ │ │ │ ├── OUTOFHAY_KRUSKAL.CPP │ │ │ │ └── OUTOFHAY_PRIM2.CPP │ │ ├── DEC_OK │ │ │ ├── SILVER │ │ │ │ ├── NI.CPP │ │ │ │ ├── CLEAN.CPP │ │ │ │ └── SCALES.CPP │ │ │ ├── BRONZE │ │ │ │ ├── ALIGN.CPP │ │ │ │ ├── BOWL.CPP │ │ │ │ ├── ROOTS.CPP │ │ │ │ └── PKTRI1.CPP │ │ │ └── GOLD │ │ │ │ ├── EXPAND.CPP │ │ │ │ ├── LAYOUT.CPP │ │ │ │ └── CPATTERN.CPP │ │ ├── FEB │ │ │ └── SILVER │ │ │ │ ├── FCOUNT.CPP │ │ │ │ ├── ACQUIRE_BFS.CPP │ │ │ │ └── ACQUIRE_DIJKSTRA.CPP │ │ ├── NOV_OK │ │ │ ├── GOLD │ │ │ │ ├── TWALK.CPP │ │ │ │ ├── ASTEROID.CPP │ │ │ │ ├── ASTEROID1.CPP │ │ │ │ └── ONTHERUN.CPP │ │ │ ├── SILVER │ │ │ │ ├── ANTS.CPP │ │ │ │ ├── ACROBAT.CPP │ │ │ │ └── SKYLINE.CPP │ │ │ └── BRONZE │ │ │ │ ├── NUMGRID.CPP │ │ │ │ ├── PASSWD.CPP │ │ │ │ └── SATPIX.CPP │ │ └── OCT │ │ │ ├── SILVER │ │ │ ├── ALLOW.CPP │ │ │ └── NEARFR.CPP │ │ │ └── BRONZE │ │ │ └── BIGFACT.CPP │ ├── 2006 │ │ ├── OCT_OK │ │ │ ├── ACNG.CPP │ │ │ ├── GUESS.PAS │ │ │ ├── PIE1.CPP │ │ │ ├── SKATE.CPP │ │ │ ├── LINEUP.CPP │ │ │ ├── MOAT_GRAHAM-SCAN.CPP │ │ │ └── MOAT_JARVIS-MARCH.CPP │ │ ├── NOV │ │ │ ├── GOLD │ │ │ │ ├── BLOCK.CPP │ │ │ │ ├── PLANK.CPP │ │ │ │ └── COWFOOD.CPP │ │ │ └── BRONZE │ │ │ │ ├── BRAND3.CPP │ │ │ │ ├── COWTAG.CPP │ │ │ │ └── SCRBL.CPP │ │ ├── DEC │ │ │ └── BRONZE │ │ │ │ └── DREAM.CPP │ │ └── JAN │ │ │ ├── BRONZE │ │ │ ├── BOWLS.CPP │ │ │ └── STUMPS.CPP │ │ │ ├── GOLD │ │ │ └── ROPING.CPP │ │ │ └── SILVER │ │ │ ├── DDAYZ.CPP │ │ │ └── PROM.CPP │ ├── 2007 │ │ ├── FEB │ │ │ └── BRONZE │ │ │ │ ├── BRONLILY.CPP │ │ │ │ └── BUYFREE.CPP │ │ └── OCT_OK │ │ │ ├── MONEY.CPP │ │ │ ├── SQUARES.CPP │ │ │ └── SECPAS.CPP │ ├── 2008 │ │ ├── OPEN │ │ │ ├── GOLD │ │ │ │ └── pieface_lib.h │ │ │ └── SILVER │ │ │ │ └── RATF.CPP │ │ └── MAR_OK │ │ │ ├── SILVER │ │ │ └── RIVER.CPP │ │ │ └── BRONZE │ │ │ └── STATS.CPP │ ├── 2009 │ │ └── MAR │ │ │ └── baying.cpp │ └── Training │ │ ├── CONCOM.PAS │ │ ├── FACT4.CPP │ │ ├── RIDE.PAS │ │ ├── SUBSET.PAS │ │ ├── FRAC1.PAS │ │ ├── INFLATE.PAS │ │ ├── MONEY.PAS │ │ └── NUMTRI.PAS ├── CEOI │ ├── 2003 │ │ └── square_lib.h │ ├── 2005 │ │ └── KEYS.CPP │ └── 2006 │ │ └── libmean.h ├── SARATOV │ ├── sgu105.CPP │ ├── sgu184.CPP │ ├── sgu123.CPP │ ├── sgu107.CPP │ ├── sgu126.cpp │ ├── sgu163.CPP │ ├── sgu222.CPP │ ├── sgu127.CPP │ ├── sgu102.CPP │ ├── sgu117.CPP │ ├── sgu133.CPP │ ├── sgu249.CPP │ └── sgu248.CPP ├── Croacia │ ├── 2004 │ │ └── PILOTI.CPP │ └── OPEN_2007-2008 │ │ ├── 1 │ │ └── CETVRTAa.CPP │ │ ├── 2 │ │ ├── CRNE.CPP │ │ └── BIJELE.CPP │ │ ├── 4 │ │ └── VECI.CPP │ │ ├── 5 │ │ └── PASCAL.CPP │ │ └── 6 │ │ ├── PARKING.CPP │ │ └── SEMAFORI.CPP ├── IOI │ ├── 2000 │ │ └── PALIN.CPP │ ├── 2005 │ │ ├── MEA.CPP │ │ └── REC.CPP │ └── 2007 │ │ └── FLOOD_CHECK.CPP ├── TIMUS │ └── AC │ │ ├── 1654.cpp │ │ ├── 1306.nlgn.cpp │ │ ├── 1100.stl.cpp │ │ ├── 1494.cpp │ │ └── 1220.cpp ├── Baltic │ ├── 1995 │ │ └── RECT.CPP │ └── 2003 │ │ └── LAMPS.CPP └── ACM Home April 2012 │ ├── SPOJ │ └── ieeebgam.cpp │ └── Codeforces │ └── CROC Qualification │ └── b.cpp ├── Codeforces ├── 41 │ └── E[ 3-cycles ].cpp ├── 58 │ ├── C[ Trees ].cpp │ ├── B[ Coins ].cpp │ └── A[ Chat room ].cpp ├── 117 │ └── B[ Very Interesting Game ].cpp ├── 158 │ ├── A[ Next Round ].cpp │ ├── B[ Taxi ].cpp │ └── D[ Ice Sculptures ].cpp ├── 165 │ └── C[ Another Problem on Strings ].cpp ├── 172 │ └── B[ Pseudorandom Sequence Period ].cpp ├── 258 │ └── A[ Little Elephant and Bits ].cpp ├── 296 │ └── A[ Yaroslav and Permutations ].cpp ├── 337 │ └── A[ Puzzles ].scala ├── 346 │ └── A[ Alice and Bob ].cpp ├── 362 │ └── B[ Petya and Staircases ].cpp ├── 406 │ └── A[ Unusual Product ].cpp ├── 414 │ ├── B[ Mashmokh and ACM ].cpp │ └── A[ Mashmokh and Numbers ].cpp ├── 420 │ └── A[ Start Up ].scala ├── 452 │ └── A[ Eevee ].cpp ├── 472 │ ├── A[ Design Tutorial: Learn from Math ].cpp │ └── B[ Design Tutorial: Learn from Life ].cpp ├── 480 │ └── A[ Exams ].scala ├── 493 │ ├── D[ Vasya and Chess ].cpp │ └── B[ Vasya and Wrestling ].cpp ├── 513 │ └── A[ Game ].cpp ├── 516 │ └── A[ Drazil and Factorial ].cpp ├── 526 │ ├── B[ Om Nom and Dark Park ].cpp │ └── A[ King of Thieves ].cpp ├── 549 │ └── A[ Face Detection ].cpp ├── 553 │ └── B[ Kyoya and Permutation ].cpp └── 573 │ └── A[ Bear and Poker ].cpp ├── TopCoder └── Single Round Match 663 │ └── ABBADiv1.sample ├── README.md └── HackerRank └── ProjectEuler └── AC ├── Problem8.scala ├── Problem1.scala ├── Problem7.scala ├── Problem2.scala ├── Problem6.scala ├── Problem5.scala └── Problem9.scala /OldStuff/POI/2000/pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/POI/2000/pas -------------------------------------------------------------------------------- /OldStuff/CodeChef/chmod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/CodeChef/chmod -------------------------------------------------------------------------------- /OldStuff/CodeChef/shiro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/CodeChef/shiro -------------------------------------------------------------------------------- /OldStuff/POI/2000/pas.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/POI/2000/pas.o -------------------------------------------------------------------------------- /OldStuff/SPOJ/PT07X.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/SPOJ/PT07X.CPP -------------------------------------------------------------------------------- /OldStuff/CodeChef/cntsols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/CodeChef/cntsols -------------------------------------------------------------------------------- /OldStuff/CodeChef/shiro.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/CodeChef/shiro.o -------------------------------------------------------------------------------- /OldStuff/PSN/1996/HUN030.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1996/HUN030.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1998/POR010.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1998/POR010.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1998/POR014.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1998/POR014.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR004.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR004.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR009.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR009.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR033.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR033.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR055.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR055.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR061.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR061.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR068.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR068.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR069.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR069.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR094.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR094.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR096.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR096.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR098.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR098.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/1999/TUR099.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/1999/TUR099.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN001.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN001.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN007.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN007.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN010.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN010.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN018.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN018.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN019.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN019.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN023.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN023.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN042.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN042.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN045.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN045.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN051.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN051.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN061.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN061.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN064.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN064.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN066.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN066.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN089.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN089.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2000/CHN108.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2000/CHN108.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND001.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND001.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND022.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND022.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND033.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND033.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND039.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND039.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND054.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND054.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND065.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND065.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND070.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND070.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2001/FND088.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2001/FND088.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR001.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR001.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR012.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR012.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR013.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR013.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR024.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR024.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR028.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR028.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR030.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR030.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR032.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR032.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR038.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR038.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR042.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR042.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR045.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR045.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR064.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR064.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR065.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR065.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR066.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR066.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR071.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR071.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR074.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR074.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR076.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR076.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR083.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR083.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR086.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR086.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR090.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR090.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR093.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR093.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR096.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR096.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR110.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR110.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR113.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR113.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR131.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR131.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2002/KOR132.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2002/KOR132.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA009.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA009.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA011.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA011.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA013.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA013.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA021.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA021.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA038.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA038.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA039.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA039.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA048.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA048.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA049.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA049.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA051.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA051.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA051.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA051.cpp -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA052.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA052.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA053.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA053.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA056.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA056.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA060.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA060.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA062.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA062.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA064.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA064.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA065.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA065.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA069.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA069.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA094.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA094.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2003/USA102.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2003/USA102.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE010.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE010.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE017.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE017.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE018.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE018.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE025.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE025.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE030.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE030.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE032.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE032.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE035.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE035.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE036.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE036.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE039.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE039.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE043.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE043.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE058.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE058.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE065.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE065.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE071.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE071.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE073.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE073.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE077.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE077.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE081.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE081.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE086.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE086.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE089.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE089.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE090.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE090.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE102.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE102.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE123.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE123.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE124.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE124.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2004/GRE125.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2004/GRE125.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL004.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL004.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL006.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL006.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL006.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL006.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL007.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL007.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL010.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL010.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL013.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL013.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL015.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL015.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL016.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL016.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL018.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL018.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL019.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL019.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL020.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL020.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL023.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL023.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL024.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL024.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL025.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL025.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL026.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL026.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL029.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL029.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL032.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL032.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL032.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL032.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL033.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL033.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL035.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL035.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL036.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL036.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL038.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL038.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL039.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL039.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL041.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL041.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL042.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL042.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL043.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL043.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL045.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL045.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL046.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL046.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL047.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL047.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL048.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL048.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL051.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL051.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL066.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL066.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL069.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL069.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL070.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL070.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL071.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL071.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL072.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL072.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL075.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL075.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL076.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL076.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL077.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL077.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL077.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL077.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL078.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL078.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL079.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL079.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL084.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL084.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL085.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL085.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL089.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL089.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL090.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL090.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL093.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL093.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2005/POL094.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2005/POL094.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX008.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX008.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX009.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX009.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX015.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX015.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX016.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX016.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX017.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX017.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX018.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX018.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX019.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX019.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX021.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX021.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX027.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX027.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX030.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX030.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX032.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX032.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX042.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX042.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX045.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX045.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX046.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX046.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX048.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX048.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX049.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX049.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX054.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX054.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX062.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX062.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX066.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX066.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX082.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX082.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX084.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX084.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX085.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX085.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX086.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX086.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX088.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX088.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX089.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX089.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX090.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX090.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX091.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX091.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX092.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX092.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX093.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX093.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX094.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX094.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX097.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX097.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX098.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX098.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX099.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX099.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX102.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX102.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX103.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX103.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX105.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX105.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX106.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX106.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX107.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX107.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX128.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX128.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX129.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX129.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX148.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX148.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO001.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO001.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO002.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO002.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO004.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO004.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO009.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO009.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO011.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO011.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO013.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO013.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO014.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO014.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO016.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO016.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO017.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO017.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO018.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO018.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO019.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO019.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO020.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO020.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO022.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO022.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO023.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO023.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO024.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO024.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO025.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO025.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO026.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO026.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO027.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO027.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO028.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO028.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO029.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO029.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO031.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO031.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO032.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO032.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO034.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO034.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO035.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO035.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO036.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO036.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO038.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO038.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO041.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO041.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO043.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO043.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO044.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO044.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO044.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO044.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO048.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO048.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO049.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO049.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO052.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO052.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO053.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO053.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO054.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO054.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO055.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO055.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO056.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO056.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO057.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO057.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO058.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO058.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO059.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO059.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO060.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO060.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO061.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO061.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO065.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO065.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO067.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO067.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO068.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO068.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO069.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO069.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO070.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO070.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO071.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO071.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO073.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO073.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO074.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO074.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO078.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO078.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO081.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO081.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO083.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO083.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO085.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO085.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO086.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO086.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO087.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO087.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO091.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO091.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO106.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO106.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO107.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO107.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO108.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO108.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO109.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO109.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO110.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO110.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO111.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO111.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO113.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO113.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO114.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO114.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO119.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO119.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO120.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO120.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO121.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO121.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO122.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO122.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO123.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO123.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO125.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO125.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO126.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO126.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO127.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO127.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO128.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO128.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO129.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO129.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO130.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO130.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO134.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO134.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO137.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO137.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO138.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO138.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO140.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO140.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO143.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO143.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2006/MEX128a.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2006/MEX128a.PAS -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO004a.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO004a.CPP -------------------------------------------------------------------------------- /OldStuff/PSN/2007/CRO129a.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/PSN/2007/CRO129a.CPP -------------------------------------------------------------------------------- /OldStuff/SPOJ/challenge/sizecon.c: -------------------------------------------------------------------------------- 1 | #import 2 | int a,b,d;main(){cin>>d;while(d--&&cin>>a)b+=a>?0;cout<2?a+b:s%4>1?a*b:a-b)){}} 2 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new12/alicecub.bfs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/SPOJ/new12/alicecub.bfs.cpp -------------------------------------------------------------------------------- /OldStuff/USACO/2006/OCT_OK/ACNG.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/OCT_OK/ACNG.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/OCT_OK/GUESS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/OCT_OK/GUESS.PAS -------------------------------------------------------------------------------- /OldStuff/USACO/2006/OCT_OK/PIE1.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/OCT_OK/PIE1.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/OCT_OK/SKATE.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/OCT_OK/SKATE.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/Training/CONCOM.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/Training/CONCOM.PAS -------------------------------------------------------------------------------- /OldStuff/USACO/2005/MAR/BRONZE/DNA.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/MAR/BRONZE/DNA.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/MAR/BRONZE/PAL.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/MAR/BRONZE/PAL.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/NOV/GOLD/BLOCK.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/NOV/GOLD/BLOCK.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/NOV/GOLD/PLANK.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/NOV/GOLD/PLANK.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/OCT_OK/LINEUP.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/OCT_OK/LINEUP.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/DEC_OK/SILVER/NI.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/DEC_OK/SILVER/NI.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/FEB/SILVER/FCOUNT.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/FEB/SILVER/FCOUNT.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/MAR/BRONZE/NPTWO.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/MAR/BRONZE/NPTWO.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/MAR/GOLD/ELEVATOR.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/MAR/GOLD/ELEVATOR.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/MAR/GOLD/YOGFAC.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/MAR/GOLD/YOGFAC.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/MAR/SILVER/ALIBI.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/MAR/SILVER/ALIBI.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/MAR/SILVER/YOGURT.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/MAR/SILVER/YOGURT.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/NOV_OK/GOLD/TWALK.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/NOV_OK/GOLD/TWALK.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/OCT/SILVER/ALLOW.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/OCT/SILVER/ALLOW.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2005/OCT/SILVER/NEARFR.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2005/OCT/SILVER/NEARFR.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/DEC/BRONZE/DREAM.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/DEC/BRONZE/DREAM.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/JAN/BRONZE/BOWLS.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/JAN/BRONZE/BOWLS.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/JAN/BRONZE/STUMPS.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/JAN/BRONZE/STUMPS.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/JAN/GOLD/ROPING.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/JAN/GOLD/ROPING.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/JAN/SILVER/DDAYZ.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/JAN/SILVER/DDAYZ.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/JAN/SILVER/PROM.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/JAN/SILVER/PROM.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/NOV/BRONZE/BRAND3.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/NOV/BRONZE/BRAND3.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/NOV/BRONZE/COWTAG.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/NOV/BRONZE/COWTAG.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/NOV/BRONZE/SCRBL.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/NOV/BRONZE/SCRBL.CPP -------------------------------------------------------------------------------- /OldStuff/USACO/2006/NOV/GOLD/COWFOOD.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/USACO/2006/NOV/GOLD/COWFOOD.CPP -------------------------------------------------------------------------------- /OldStuff/MIPT/new/Happy Tickets_files/6259: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mukel/ProgrammingContests/HEAD/OldStuff/MIPT/new/Happy Tickets_files/6259 -------------------------------------------------------------------------------- /OldStuff/SPOJ/KAMIL.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | int i,j,c;main(){for(i=10;i;printf("%d\n",1< 7 | 8 | int main() { 9 | 10 | int n; 11 | scanf( "%d", &n ); 12 | printf( "%d\n", n / 3 * 2 + ( n % 3 == 2 ) ); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /OldStuff/CodeChef/.fuse_hidden0000003f00000004: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm $0 4 | 5 | "./cntsols" 6 | 7 | echo " 8 | 9 | ------------------ 10 | (program exited with code: $?)" 11 | 12 | 13 | echo "Press return to continue" 14 | #to be more compatible with shells like dash 15 | dummy_var="" 16 | read dummy_var 17 | -------------------------------------------------------------------------------- /OldStuff/CodeChef/.fuse_hidden000000730000000a: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm $0 4 | 5 | "./chmod" 6 | 7 | echo " 8 | 9 | ------------------ 10 | (program exited with code: $?)" 11 | 12 | 13 | echo "Press return to continue" 14 | #to be more compatible with shells like dash 15 | dummy_var="" 16 | read dummy_var 17 | -------------------------------------------------------------------------------- /OldStuff/CodeChef/.fuse_hidden000000760000000b: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm $0 4 | 5 | "./chmod" 6 | 7 | echo " 8 | 9 | ------------------ 10 | (program exited with code: $?)" 11 | 12 | 13 | echo "Press return to continue" 14 | #to be more compatible with shells like dash 15 | dummy_var="" 16 | read dummy_var 17 | -------------------------------------------------------------------------------- /OldStuff/CodeChef/.fuse_hidden0000007a0000000c: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm $0 4 | 5 | "./chmod" 6 | 7 | echo " 8 | 9 | ------------------ 10 | (program exited with code: $?)" 11 | 12 | 13 | echo "Press return to continue" 14 | #to be more compatible with shells like dash 15 | dummy_var="" 16 | read dummy_var 17 | -------------------------------------------------------------------------------- /OldStuff/MIPT/MIPT000.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 2 - 2 - 2008 4 | MIPT #000 "Sum of two integers" 5 | */ 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main() { 11 | int a, b; 12 | cin >> a >> b; 13 | cout << a + b << endl; 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/TEST.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 17 - 7 - 2007 4 | SPOJ #1 "Life, the Universe, and Everything" 5 | */ 6 | #include 7 | using namespace std; 8 | int main() { 9 | int x; 10 | while ( ( cin >> x ) && x != 42 ) 11 | cout << x << endl; 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /OldStuff/CEOI/2006/libmean.h: -------------------------------------------------------------------------------- 1 | #ifndef _MEANDIAN_H 2 | #define _MEANDIAN_H 3 | 4 | /*#ifdef __cplusplus 5 | extern "C" { 6 | #endif*/ 7 | 8 | int Init(); 9 | int Meandian(int, int, int, int); 10 | void Solution(const int *); 11 | 12 | /*#ifdef __cplusplus 13 | } 14 | #endif 15 | */ 16 | #endif /* _MEANDIAN_H */ 17 | -------------------------------------------------------------------------------- /OldStuff/MIPT/MIPT001.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 2 - 2 - 2008 4 | MIPT #001 "Max of Integers" 5 | */ 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main() { 11 | int max_n, x; 12 | for ( cin >> max_n; cin >> x; max_n >?= x ); 13 | cout << max_n << endl; 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu184.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 15 - 2 - 2008 4 | Saratov #184 "Patties" 5 | */ 6 | #include 7 | 8 | int main() { 9 | 10 | int a, b, c, d, e, f; 11 | scanf( "%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f ); 12 | printf( "%d\n", a/d 2 | using namespace std; 3 | 4 | int main() { 5 | ios_base::sync_with_stdio(0); 6 | cin.tie(0); 7 | 8 | int n1, n2; 9 | cin >> n1 >> n2; 10 | if (n1 <= n2) 11 | cout << "Second" << endl; 12 | else 13 | cout << "First" << endl; 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new2/mipt027.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | acm.mipt.ru 4 | MIPT #27 "Odd number" 5 | */ 6 | #include 7 | 8 | int N, x, ans; 9 | 10 | int main() 11 | { 12 | for (scanf( "%d", &N ); N--;) 13 | { 14 | scanf( "%d", &x ); 15 | ans ^= x; 16 | } 17 | 18 | printf( "%d\n", ans ); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/FCTRL.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 17 - 7 - 2007 4 | SPOJ #11 "Factorial" 5 | */ 6 | #include 7 | using namespace std; 8 | int T, N, zeros; 9 | int main() { 10 | for ( cin >> T; T; T-- ) { 11 | zeros = 0; 12 | for ( cin >> N; N; zeros += N /= 5 ); 13 | cout << zeros << endl; 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new10/fence1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | SPOJ # 4 | 23 - 5 - 2009 5 | */ 6 | #include 7 | #include 8 | 9 | const double PI = acos( -1 ); 10 | 11 | int main() { 12 | 13 | while (1) { 14 | int L; 15 | scanf( "%d", &L ); if ( !L ) break ; 16 | printf( "%.2lf\n", (L * L) / PI / 2 ); 17 | } 18 | 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /OldStuff/Croacia/OPEN_2007-2008/4/VECI.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | TASK: VECI 4 | */ 5 | #include 6 | 7 | using namespace std; 8 | 9 | string st; 10 | 11 | int main() { 12 | 13 | cin >> st; 14 | 15 | if ( next_permutation( st.begin(), st.end() ) ) 16 | cout << st << endl; 17 | else cout << "0" << endl; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Codeforces/493/D[ Vasya and Chess ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | int main() { 9 | ios_base::sync_with_stdio(false); 10 | cin.tie(0); 11 | int N; 12 | cin >> N; 13 | if (N % 2 == 0) cout << "white" << endl << "1 2" << endl; 14 | else 15 | cout << "black" << endl; 16 | return 0; 17 | } -------------------------------------------------------------------------------- /OldStuff/MIPT/new/mipt124.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | MIPT #124 "Sudoku" 4 | */ 5 | #include 6 | 7 | #define REP(i, n) for (int i = 0; i < (int)(n); ++i) 8 | 9 | int main() 10 | { 11 | int n; scanf( "%d", &n ); 12 | REP(i, n) 13 | REP(j, n) 14 | { 15 | REP(k, n * n) printf( "%d ", (k + i + j * n) % (n*n) + 1 ); 16 | printf( "\n" ); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /OldStuff/POI/2000/pas.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | int K, sum; 6 | char S[1 << 20]; 7 | int dp[1 << 20]; 8 | long long ans; 9 | int main(){ 10 | scanf("%d %s", &K, S); 11 | dp[0] = 1; 12 | for (int i = 0; S[i]; ++dp[sum], ++i) 13 | if ((sum += (S[i] - '0'))>= K)ans += dp[sum] - K; 14 | cout << ans << endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new8/act.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | SPOJ #359 "Alpha Centauri Tennis" 4 | 5 - 3 - 2009 5 | */ 6 | #include 7 | #include 8 | 9 | const int MAXN = 60000; 10 | 11 | int T; 12 | char S[MAXN]; 13 | 14 | int main() { 15 | 16 | scanf( "%d", &T ); 17 | while ( T-- ) scanf( "%*d %s", &S ), printf( "%c\n", S[strlen(S) - 1] ); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Codeforces/258/A[ Little Elephant and Bits ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | string S; 5 | int pos; 6 | 7 | int main() { 8 | 9 | cin >> S; 10 | for (int i = 0; i < S.size(); ++i) 11 | if (S[i] == '0') 12 | { 13 | pos = i; 14 | break; 15 | } 16 | 17 | for (int i = 0; i < S.size(); ++i) 18 | if (i != pos) cout << S[i]; 19 | 20 | cout << endl; 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /OldStuff/Croacia/OPEN_2007-2008/2/CRNE.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 24 - 11 - 2007 4 | COCI 2007 Contest 2 "CRNE" 5 | */ 6 | #include 7 | 8 | int cuts, x, sol; 9 | 10 | int main() { 11 | 12 | scanf( "%d", &cuts ); 13 | 14 | x = cuts / 2 + 1; 15 | 16 | sol = x * x; 17 | if ( cuts & 1 ) sol += x; 18 | 19 | printf( "%d\n", sol ); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Codeforces/165/C[ Another Problem on Strings ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | int K, sum; 6 | char S[1 << 20]; 7 | int dp[1 << 20]; 8 | long long ans; 9 | int main(){ 10 | scanf("%d %s", &K, S); 11 | dp[0] = 1; 12 | for (int i = 0; S[i]; ++dp[sum], ++i) 13 | if ((sum += (S[i] - '0'))>= K) ans += dp[sum - K]; 14 | cout << ans << endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu123.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 11 - 2 - 2008 4 | Saratov #123 "The sum" 5 | */ 6 | #include 7 | 8 | int n, i; 9 | int fib[50]; 10 | 11 | int main() { 12 | 13 | scanf( "%d", &n ); 14 | 15 | fib[1] = 1; 16 | for ( i = 2; i <= n + 2; i++ ) 17 | fib[i] = fib[i - 1] + fib[i - 2]; 18 | 19 | printf( "%d\n", fib[n + 2] - 1 ); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/EIGHTS.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 20 - 7 - 2007 4 | SPOJ #1030 "Triple Fat Ladies" 5 | */ 6 | #include 7 | 8 | int T; 9 | long long N; 10 | int end[4] = { 192, 442, 692, 942 }; 11 | 12 | int main() { 13 | 14 | for ( scanf( "%d", &T ); T; T-- ) { 15 | scanf( "%lld", &N ); 16 | N--; 17 | printf( "%lld\n", N / 4 * 1000 + end[N & 3] ); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/HUBULLU.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 1 - 12 - 2007 4 | SPOJ #1028 "Hubulullu" 5 | */ 6 | #include 7 | 8 | const char* name[2] = 9 | { "Airborne", "Pagfloyd" }; 10 | 11 | int T, N, P; 12 | 13 | int main() { 14 | 15 | for ( scanf( "%d", &T ); T; T-- ) { 16 | scanf( "%d %d", &N, &P ); 17 | printf( "%s wins.\n", name[P] ); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /TopCoder/Single Round Match 663/ABBADiv1.sample: -------------------------------------------------------------------------------- 1 | -- Example 0 2 | A 3 | BABA 4 | 5 | Possible 6 | -- Example 1 7 | BAAAAABAA 8 | BAABAAAAAB 9 | 10 | Possible 11 | -- Example 2 12 | A 13 | ABBA 14 | 15 | Impossible 16 | -- Example 3 17 | AAABBAABB 18 | BAABAAABAABAABBBAAAAAABBAABBBBBBBABB 19 | 20 | Possible 21 | -- Example 4 22 | AAABAAABB 23 | BAABAAABAABAABBBAAAAAABBAABBBBBBBABB 24 | 25 | Impossible 26 | -- Example 5 27 | ABBA 28 | AB 29 | 30 | Possible 31 | -------------------------------------------------------------------------------- /Codeforces/41/E[ 3-cycles ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | int n, t = 0; 6 | cin >> n; 7 | 8 | for(int i = 1; i <= n; i++) 9 | t += ((i) / 2); 10 | 11 | cout << t << endl; 12 | 13 | for(int i = 1; i <= n; i++) 14 | for(int j = i + 1; j <= n; j += 2) 15 | cout << i << " " << j << endl; 16 | // system("pause"); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new2/mipt100.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | MIPT #100 "Nim Game -- who is the winner?" 4 | */ 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | int N, nimSum, x; 11 | 12 | int main() 13 | { 14 | for (cin >> N; N--;) 15 | { 16 | cin >> x; 17 | nimSum ^= x; 18 | } 19 | 20 | if (nimSum) cout << "First"; else cout << "Second"; 21 | cout << " wins."; 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/DIVSUM.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 17 - 7 - 2007 4 | SPOJ #74 "Divisor Summation" 5 | */ 6 | #include 7 | #define MAXV 500001 8 | int T, i, j; 9 | int sum[MAXV]; 10 | int main() { 11 | for ( i = 1; i + i < MAXV; i++ ) 12 | for ( j = i + i; j < MAXV; j += i ) sum[j] += i; 13 | for ( scanf( "%d", &T ); T; T-- ) { 14 | scanf( "%d", &j ); 15 | printf( "%d\n", sum[j] ); 16 | } 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /Codeforces/58/C[ Trees ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int frist[100005]; 4 | 5 | int n, m=0; 6 | 7 | int Frist(int k, int i){ 8 | if (i<=(n-1)/2){ 9 | return k-i; 10 | } 11 | else 12 | return k - (n - (i + 1)); 13 | } 14 | 15 | int main(){ 16 | scanf("%d",&n); 17 | for (int i=0; i0){ 21 | frist[p]++; 22 | if (frist[p]>m) 23 | m=frist[p]; 24 | } 25 | } 26 | printf("%d",n-m); 27 | } -------------------------------------------------------------------------------- /Codeforces/337/A[ Puzzles ].scala: -------------------------------------------------------------------------------- 1 | object Main { 2 | val in = { 3 | val lines = scala.io.Source.stdin.getLines() 4 | lines map (_ split ' ') filter (_.nonEmpty) flatten 5 | } 6 | def nextInt = in.next().toInt 7 | def main(args: Array[String]): Unit = { 8 | val K, N = nextInt 9 | val x = Seq.fill(N)(nextInt).sorted 10 | val ans = x zip (x drop (K-1)) map { case (a, b) => b - a } 11 | println(ans.min) 12 | } 13 | } -------------------------------------------------------------------------------- /OldStuff/Croacia/OPEN_2007-2008/2/BIJELE.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 24 - 11 - 2007 4 | COCI 2007 Contest 2 "BIJELE" 5 | */ 6 | #include 7 | 8 | int main() { 9 | 10 | int target[6] = { 1, 1, 2, 2, 2, 8 }; 11 | 12 | for ( int i = 0; i < 6; i++ ) { 13 | int cant; 14 | scanf( "%d", &cant ); 15 | printf( "%d", target[i] - cant ); 16 | printf( ( i == 5 ) ? "\n" : " " ); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /OldStuff/PSN/2008/EGY019.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 5 - 3 - 2008 4 | PSN 2008 #19 "Suburbios" 5 | */ 6 | #include 7 | #include 8 | 9 | int n, k, i; 10 | double digits; 11 | 12 | int main() { 13 | scanf( "%d %d", &n, &k ); 14 | for ( i = k + 1; i <= n; i++ ) 15 | sol += log10( i ); 16 | for ( i = 2; i <= n - k; i++ ) 17 | sol -= log10( i ); 18 | printf( "%.0lf\n", ceil( sol + 1e-8 ) ); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Programming contests 2 | My solutions to some problems for programming contests/online judges. 3 | 4 | The most part is from my early years 2007-2012. 5 | 6 | I include solutions to problems from OJ since I disagree with the outdated model. I strongly believe in the 7 | democratization of programming contests: knowledge should be available to everyone. 8 | 9 | I you are problem author and would like me to remove a solution to your problem (e.g. used in interviews) please contact me. 10 | -------------------------------------------------------------------------------- /OldStuff/Croacia/OPEN_2007-2008/5/PASCAL.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | ID: mukel 3 | TASK: PASCAL 4 | LANG: C++ 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int n, i; 12 | 13 | int main() { 14 | 15 | cin >> n; 16 | for ( i = 2; i * i <= n; i++ ) 17 | if ( n % i == 0 ) { 18 | cout << n - ( n / i ) << endl; 19 | exit( 0 ); 20 | } 21 | 22 | cout << n - 1 << endl; 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new7/quadarea.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | 13 - 1 - 2009 4 | SPOJ #2716 "Maximal Quadrilateral Area" 5 | */ 6 | #include 7 | #include 8 | 9 | int T; 10 | double a, b, c, d; 11 | int main() { 12 | 13 | for ( scanf( "%d", &T ); T--; ) { 14 | scanf( "%lf %lf %lf %lf", &a, &b, &c, &d ); 15 | double P = ( a + b + c + d ) / 2; 16 | printf( "%lf\n", sqrt( (P - a) * (P - b) * (P - c) * (P - d) ) ); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /OldStuff/IOI/2000/PALIN.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 8 - 6 - 2008 4 | IOI 2000 "Palindrome" 5 | */ 6 | #include 7 | int N, i, j, dp[2][6000]; 8 | char st[6000]; 9 | int main() { 10 | scanf( "%d%s", &N, &st ); 11 | for ( i = N - 1; i >= 0; i-- ) 12 | for ( j = N - 1; j >= 0; j-- ) 13 | if ( st[i] == st[N - j - 1] ) 14 | dp[i&1][j] = dp[i&1^1][j + 1] + 1; 15 | else dp[i&1][j] = dp[i&1^1][j] >? dp[i&1][j + 1]; 16 | printf( "%d\n", N - dp[0][0] ); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new/gny07a.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | SPOJ #2523 "Mispelling" 4 | 6 - 9 - 2008 5 | */ 6 | #include 7 | 8 | #define REP( i, n ) \ 9 | for ( int i = 0; i < (n); i++ ) 10 | 11 | const int MAXLEN = 100; 12 | 13 | int T, pos; 14 | char st[MAXLEN]; 15 | 16 | int main() { 17 | 18 | scanf( "%d", &T ); 19 | REP( i, T ) { 20 | scanf( "%d %s", &pos, &st ); 21 | st[pos - 1] = '\0'; 22 | printf( "%d %s%s\n", i + 1, st, st + pos ); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /HackerRank/ProjectEuler/AC/Problem8.scala: -------------------------------------------------------------------------------- 1 | object Solution { 2 | 3 | val in = { 4 | val lines = scala.io.Source.stdin.getLines 5 | lines flatMap (_ split ' ' filter (_.nonEmpty)) 6 | } 7 | 8 | def nextInt = in.next.toInt 9 | 10 | def main(args: Array[String]): Unit = { 11 | val testCount = nextInt 12 | for (test <- 1 to testCount) { 13 | val N, K = nextInt 14 | val digits = in.next map (_.asDigit) 15 | val products = digits.sliding(K) map (_.product) 16 | println(products.max) 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/EASYPROB.TEXT: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | REMOVE THIS COMMENT TO SUBMIT!! 4 | 5 | Alfonso Alfonso Peterssen 6 | 24 - 7 - 2007 7 | SPOJ #1688 "A Very Easy Problem!" 8 | */ 9 | 137=2(2(2)+2+2(0))+2(2+2(0))+2(0) 10 | 1315=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0) 11 | 73=2(2(2)+2)+2(2+2(0))+2(0) 12 | 136=2(2(2)+2+2(0))+2(2+2(0)) 13 | 255=2(2(2)+2+2(0))+2(2(2)+2)+2(2(2)+2(0))+2(2(2))+2(2+2(0))+2(2)+2+2(0) 14 | 1384=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2)+2(2(2)+2(0))+2(2+2(0)) 15 | 16385=2(2(2+2(0))+2(2)+2)+2(0) 16 | -------------------------------------------------------------------------------- /HackerRank/ProjectEuler/AC/Problem1.scala: -------------------------------------------------------------------------------- 1 | import scala.io.Source 2 | 3 | object Solution { 4 | val in = { 5 | val lines = Source.stdin.getLines 6 | lines flatMap (_ split ' ' filter (_.nonEmpty)) 7 | } 8 | def nextInt = in.next.toInt 9 | 10 | def sum(n: Int): Long = 1L * n * (n + 1) / 2 11 | 12 | def main(args: Array[String]): Unit = { 13 | val testCount = nextInt 14 | for (test <- 1 to testCount) { 15 | val N = nextInt - 1 16 | val ans = sum(N/3)*3 + sum(N/5)*5 - sum(N/15)*15 17 | println(ans) 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /OldStuff/MIPT/MIPT008.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 2 - 2 - 2008 4 | MIPT #003 "Brackets" 5 | */ 6 | #include 7 | 8 | using namespace std; 9 | 10 | int i, cnt; 11 | string st; 12 | 13 | int main() { 14 | 15 | cin >> st; 16 | for ( i = 0; i < st.size(); i++ ) { 17 | if ( st[i] == '(' ) 18 | cnt++; 19 | else cnt--; 20 | if ( cnt < 0 ) break; 21 | } 22 | 23 | cout << ( cnt ? "NO" : "YES" ) << endl; 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu107.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 4 - 3 - 2008 4 | Saratov #107 "987654321 problem" 5 | */ 6 | #include 7 | 8 | int n; 9 | 10 | int main() { 11 | 12 | scanf( "%d", &n ); 13 | if ( n < 9 ) 14 | printf( "0\n" ); 15 | else if ( n == 9 ) 16 | printf( "8\n" ); 17 | else { 18 | printf( "72" ); 19 | for ( n -= 10; n > 0; n-- ) 20 | putchar( '0' ); 21 | printf( "\n" ); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/ADDREV.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 17 - 7 - 2007 4 | SPOJ #42 "Adding Reversed Numbers" 5 | */ 6 | #include 7 | using namespace std; 8 | 9 | int rev( int x ) { 10 | int r = 0; 11 | for ( ; x; x /= 10 ) 12 | r = r * 10 + x % 10; 13 | return r; 14 | } 15 | 16 | int main() { 17 | 18 | int T, A, B; 19 | 20 | for ( cin >> T; T; T-- ) { 21 | cin >> A >> B; 22 | cout << rev( rev( A ) + rev( B ) ) << endl; 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new7/lastdig.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | 25 - 1 - 2009 4 | SPOJ #3442 "The last digit" 5 | */ 6 | #include 7 | 8 | int T, A, B; 9 | 10 | int power( int x, int n ) { 11 | if ( n == 0 ) return 1; 12 | int tmp = power( x, n / 2 ); 13 | tmp *= tmp; 14 | if ( n % 2 ) tmp *= x; 15 | return tmp % 10; 16 | } 17 | 18 | int main() { 19 | scanf( "%d", &T ); 20 | while ( T-- ) { 21 | scanf( "%d %d", &A, &B ); 22 | printf( "%d\n", power( A, B ) ); 23 | } 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /OldStuff/USACO/2007/OCT_OK/MONEY.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | PROG: money 3 | LANG: C++ 4 | ID: a2peter1 5 | */ 6 | #include 7 | using namespace std; 8 | 9 | int M, C, i; 10 | long long dp[10001], val; 11 | 12 | ifstream fin ( "money.in" ); 13 | ofstream fout ( "money.out" ); 14 | 15 | int main() { 16 | 17 | dp[0] = 1; 18 | for ( fin >> C >> M; C; C-- ) { 19 | fin >> val; 20 | for ( i = val; i <= M; i++ ) 21 | dp[i] += dp[i - val]; 22 | } 23 | 24 | fout << dp[M] << endl; 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /Codeforces/158/A[ Next Round ].cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | VK Cup 2012 Qualification Round 1 4 | */ 5 | #include 6 | 7 | using namespace std; 8 | 9 | #define REP(i, n) for (int i = 0; i < (int)(n); ++i) 10 | 11 | const int 12 | MAXN = 1 << 6; 13 | 14 | int N, K; 15 | int score[MAXN]; 16 | 17 | int main() 18 | { 19 | cin >> N >> K; 20 | REP(i, N) cin >> score[i]; 21 | 22 | int i = 0; 23 | while (i < N && score[i] > 0 && score[i] >= score[K - 1]) 24 | ++i; 25 | 26 | cout << i << endl; 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /OldStuff/PSN/2008/EGY023.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | TASK: GAP 4 | */ 5 | #include 6 | 7 | int n, lo, hi; 8 | 9 | bool prime( int x ) { 10 | for ( int i = 2; i * i <= x; i++ ) 11 | if ( x % i == 0 ) 12 | return 0; 13 | return 1; 14 | } 15 | 16 | int main() { 17 | 18 | scanf( "%d", &n ); 19 | for ( lo = n; !prime( lo ); lo-- ); 20 | for ( hi = n; !prime( hi ); hi++ ); 21 | printf( "%d\n", hi - lo ); 22 | fflush( stdout ); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /OldStuff/TIMUS/AC/1654.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | Team: UH++ 4 | Timus Online Judge 5 | 1654. Cipher Message 6 | */ 7 | #include 8 | 9 | const int MAXN = 200005; 10 | 11 | char S[MAXN]; 12 | 13 | int main() 14 | { 15 | scanf( "%s", &S ); 16 | 17 | int pos = 0; 18 | for (int i = 0; S[i]; i++) 19 | { 20 | S[pos++] = S[i]; 21 | while (pos > 1 && S[pos - 1] == S[pos - 2]) 22 | pos -= 2; 23 | } 24 | 25 | S[pos++] = '\0'; 26 | 27 | printf( "%s\n", S ); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/MKLABELS.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 1 - 12 - 2007 4 | SPOJ #1870 "Making Labels" 5 | */ 6 | #include 7 | using namespace std; 8 | 9 | const int sol[] = 10 | { -1, 1, 1, 3, 16, 125, 1296, 16807, 262144, 4782969, 100000000 }; 11 | 12 | int T, N; 13 | 14 | int main() { 15 | 16 | while ( ++T ) { 17 | scanf( "%d", &N ); 18 | if ( !N ) break; 19 | printf( "Case %d, N = %d, # of different labelings = %d\n", T, N, sol[N] ); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /OldStuff/IOI/2005/MEA.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 15 - 6 - 2008 4 | IOI 205 "Mean Sequence" 5 | Very Easy!!! 6 | */ 7 | #include 8 | const int oo = 1 << 30; 9 | int N, x, lo, hi, kk; 10 | int main() { 11 | lo = -oo; 12 | hi = +oo; 13 | for ( scanf( "%d", &N ); N && lo <= hi; N-- ) { 14 | scanf( "%d", &x ); 15 | if ( N & 1 ) 16 | lo >?= kk - x; 17 | else hi 2 | using namespace std; 3 | 4 | const int 5 | MAXK = 1 << 12; 6 | 7 | int N; 8 | int a[MAXK]; 9 | int ans; 10 | 11 | int main() { 12 | ios_base::sync_with_stdio(0); 13 | 14 | cin >> N; 15 | for (int i = 2; i <= (1 << (N+1)) - 1; ++i) 16 | cin >> a[i]; 17 | 18 | for (int i = (1 << N) - 1; i >= 1; --i) { 19 | a[i] += max(a[2 * i], a[2 * i + 1]); 20 | ans += abs(a[2 * i] - a[2 * i + 1]); 21 | } 22 | 23 | cout << ans << endl; 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new10/knightsr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | SPOJ #3389 "The Knights of the Round Circle" 4 | 20 - 5 - 2009 5 | */ 6 | #include 7 | 8 | const int MAXN = 1 << 17; 9 | 10 | int N; 11 | double dp[MAXN]; 12 | 13 | int main() { 14 | 15 | for( int i = 2; i < MAXN; i++ ) 16 | dp[i] = ( dp[i - 1] + 1.0 / i ); 17 | 18 | while (1) { 19 | scanf( "%d", &N ); if ( !N ) break ; 20 | printf( "With %d competitors, a Jedi Knight will be replaced approximately %.2lf times.\n\n", N, dp[N] ); 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new10/triomino.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | SPOJ #2961 "Triomino Game" 4 | 20 - 5 - 2009 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | const int 12 | MAXW = 28, 13 | win[MAXW] = {0,1,4,7,12,14,16,17,23,28,33,39,44,50,56,60,66,67,82,86,93,98,102,142,146,152,179,524}; 14 | 15 | int T, N; 16 | 17 | int main() { 18 | 19 | scanf( "%d", &T ); 20 | while ( T-- ) { 21 | scanf( "%d", &N ); 22 | printf( "%c\n", count( win, win + MAXW, N ) ? 'Y' : 'X' ); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /Codeforces/480/A[ Exams ].scala: -------------------------------------------------------------------------------- 1 | object Main { 2 | 3 | val in = { 4 | val lines = scala.io.Source.stdin.getLines 5 | lines map (_ split ' ') filter (_.nonEmpty) flatten 6 | } 7 | 8 | def nextInt = in.next.toInt 9 | 10 | def main(args: Array[String]): Unit = { 11 | 12 | val N = nextInt 13 | val vals = Array.fill(N){ 14 | val a, b = nextInt 15 | (a, b) 16 | }.sorted 17 | 18 | var best = 0 19 | for ((a, b) <- vals) { 20 | if (b >= best) best = b 21 | else best = a 22 | } 23 | 24 | println(best) 25 | } 26 | } -------------------------------------------------------------------------------- /Codeforces/526/A[ King of Thieves ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() { 5 | ios_base::sync_with_stdio(0); 6 | 7 | int N; 8 | cin >> N; 9 | 10 | string s; 11 | cin >> s; 12 | 13 | for (int i = 1; i < N; ++i) 14 | for (int j = 0; j < N; ++j) { 15 | int cnt = 0; 16 | for (int k = j; k < N && s[k] == '*'; cnt++, k += i); 17 | if (cnt >= 5) { 18 | cout << "yes" << endl; 19 | exit(0); 20 | } 21 | } 22 | 23 | cout << "no" << endl; 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /OldStuff/IOI/2005/REC.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 16 - 6 - 2008 4 | IOI 2005 "Rectangle Game" 5 | */ 6 | #include "rec.h" 7 | #include 8 | using std::swap; 9 | 10 | int x, y; 11 | 12 | int main() { 13 | 14 | for (;;) { 15 | direction dir = horizontal; 16 | x = dimension_x(); 17 | y = dimension_y(); 18 | if ( y > x ) { swap( x, y ); dir = vertical; } 19 | for ( int i = 0; y + ((y + 1) << i) < x; i++ ) 20 | y += ((y + 1) << i); 21 | cut( dir, y ); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /HackerRank/ProjectEuler/AC/Problem7.scala: -------------------------------------------------------------------------------- 1 | object Solution { 2 | 3 | val in = { 4 | val lines = scala.io.Source.stdin.getLines 5 | lines flatMap (_ split ' ' filter (_.nonEmpty)) 6 | } 7 | 8 | def nextInt = in.next.toInt 9 | 10 | val primes: Stream[Int] = 2 #:: (Stream.from(3, 2) filter (n => primes.view takeWhile (p => p*p <= n) forall (n % _ != 0))) 11 | 12 | def main(args: Array[String]): Unit = { 13 | val testCount = nextInt 14 | val p = primes take 10000 toArray 15 | 16 | for (test <- 1 to testCount) { 17 | val N = nextInt 18 | println(p(N - 1)) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu126.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | 11 - 2 - 2009 4 | SGU #126 "Boxes" 5 | */ 6 | #include 7 | #include 8 | 9 | const int LIMIT = 10000; 10 | 11 | int A, B, ans; 12 | 13 | void solution( int x ) { 14 | printf( "%d\n", x ); 15 | exit( 0 ); 16 | } 17 | 18 | int main() { 19 | 20 | scanf( "%d %d", &A, &B ); 21 | while ( A && B ) { 22 | if ( A < B ) A^=B^=A^=B; // swap 23 | A -= B; 24 | B *= 2; 25 | ans++; 26 | if ( ans > LIMIT ) solution( -1 ); 27 | } 28 | 29 | solution( ans ); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu163.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 14 - 2 - 2008 4 | Saratov #163 "Wise King" 5 | */ 6 | #include 7 | 8 | int P, N, i, j, x, pot, sol; 9 | 10 | int main() { 11 | 12 | scanf( "%d %d", &N, &P ); 13 | for ( i = 0; i < N; i++ ) { 14 | scanf( "%d", &x ); 15 | if ( x > 0 || ( x < 0 && !( P & 1 ) ) ) { 16 | pot = 1; 17 | for ( j = 0; j < P; j++ ) 18 | pot *= x; 19 | sol += pot; 20 | } 21 | } 22 | 23 | printf( "%d\n", sol ); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/ICODER.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 10 - 11 - 2007 4 | SPOJ #1881 "Instruction Decoder" 5 | */ 6 | #include 7 | 8 | int N, i, x, sol; 9 | char op[4]; 10 | 11 | int main() { 12 | 13 | for (;;) { 14 | 15 | sol = 16; 16 | 17 | scanf( "%d", &N ); 18 | if ( N == 0 ) break; 19 | 20 | for ( i = 0; i < N; i++ ){ 21 | scanf( "%s %d", &op, &x ); 22 | if ( op[0] == 'M' ) 23 | for ( ; sol && !( x & 1 ); sol--, x >>= 1 ); 24 | } 25 | 26 | printf( "%d\n", 1 << sol ); 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /HackerRank/ProjectEuler/AC/Problem2.scala: -------------------------------------------------------------------------------- 1 | import scala.io.Source 2 | 3 | object Solution { 4 | val in = { 5 | val lines = Source.stdin.getLines 6 | lines flatMap (_ split ' ' filter (_.nonEmpty)) 7 | } 8 | 9 | def nextInt = in.next.toInt 10 | def nextLong = in.next.toLong 11 | 12 | val fibs: Stream[Long] = 1L #:: fibs.scanLeft(2L)(_ + _) 13 | 14 | def main(args: Array[String]): Unit = { 15 | val testCount = nextInt 16 | for (test <- 1 to testCount) { 17 | val N = nextLong 18 | val evenFibs = fibs takeWhile (_ <= N) filter (_ % 2 == 0) 19 | println(evenFibs.sum) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/CANDY3.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 5 - 1 - 2007 4 | SPOJ #2148 "Candy III" 5 | Just for fun 6 | */ 7 | #include 8 | 9 | int T, N, i; 10 | long long candies, sum; 11 | 12 | int main() { 13 | 14 | for ( scanf( "%d", &T ); T; T-- ) { 15 | 16 | sum = 0; 17 | 18 | scanf( "%d", &N ); 19 | for ( i = 0; i < N; i++ ) { 20 | scanf( "%lld", &candies ); 21 | sum = ( sum + candies % N ) % N; 22 | } 23 | 24 | printf( sum ? "NO\n" : "YES\n" ); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /OldStuff/USACO/2007/OCT_OK/SQUARES.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | PROG: squares 3 | LANG: C++ 4 | ID: a2peter1 5 | */ 6 | #include 7 | using namespace std; 8 | 9 | const int MAXB = 500; 10 | 11 | int N, i, j, sol; 12 | 13 | ifstream fin ( "squares.in" ); 14 | ofstream fout ( "squares.out" ); 15 | 16 | int sqr( int x ) { return x * x; } 17 | 18 | int main() { 19 | 20 | fin >> N; 21 | 22 | for ( i = 1; i <= MAXB; i++ ) 23 | for ( j = i + 1; j <= MAXB; j++ ) 24 | if ( sqr( j ) - sqr( i ) == N ) 25 | sol++; 26 | 27 | fout << sol << endl; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /Codeforces/117/B[ Very Interesting Game ].cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | Codeforces Beta Round #88 4 | */ 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | typedef long long int64; 11 | 12 | #define FOR(i, l, h) for (int i = (int)(l); i <= (int)(h); ++i) 13 | 14 | int main() 15 | { 16 | int a, b, mod; 17 | 18 | scanf( "%d %d %d", &a, &b, &mod ); 19 | 20 | FOR(s1, 0, min(a, mod - 1)) 21 | if ((mod - (s1 * (int64)1e9) % mod) % mod > b) 22 | { 23 | printf( "1 %09d", s1 ); 24 | return 0; 25 | } 26 | 27 | printf( "2\n" ); 28 | 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /Codeforces/296/A[ Yaroslav and Permutations ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main() { 6 | 7 | int N; 8 | cin >> N; 9 | 10 | int seq[N]; 11 | 12 | for (int i = 0; i < N; ++i) 13 | cin >> seq[i]; 14 | 15 | sort(seq, seq + N); 16 | 17 | int maxCount = 0; 18 | for (int i = 0, j; i < N; i = j) { 19 | for (j = i + 1; j < N && seq[j] == seq[i]; ++j); 20 | maxCount = max(maxCount, j - i); 21 | } 22 | 23 | printf( (maxCount > (N+1)/2) ? "NO\n" : "YES\n" ); 24 | 25 | return 0; 26 | } -------------------------------------------------------------------------------- /OldStuff/MIPT/MIPT026.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 18 - 7 - 2008 4 | MIPT #026 "Operations" 5 | */ 6 | #include 7 | 8 | const int 9 | MAXN = 2000010, 10 | oo = (int)1e9; 11 | 12 | int N; 13 | int dp[MAXN]; 14 | 15 | int solve( int x ) { 16 | if ( x < 4 ) return x; 17 | if ( dp[x] ) return dp[x]; 18 | if ( x % 2 == 0 ) 19 | return dp[x] = solve( x / 2 ) + 1; 20 | return dp[x] = ( solve( x - 1 ) 7 | 8 | int n, i, ch, last; 9 | 10 | int main() { 11 | 12 | scanf( "%d", &n ); 13 | for ( i = 0; i < n - 1; i++ ) { 14 | scanf( "%s", &ch ); 15 | if ( ch == '+' && last == '-' ) putchar( '(' ); 16 | if ( ch == '-' && last == '+' ) putchar( ')' ); 17 | putchar( '-' ); 18 | last = ch; 19 | } 20 | 21 | if ( ch == '+' ) 22 | putchar( ')' ); 23 | 24 | putchar( '\n' ); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/CANTON.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 17 - 7 - 2007 4 | SPOJ #302 "Count on Cantor" 5 | */ 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int T, N, sq, t; 11 | 12 | int main() { 13 | 14 | for ( cin >> T ; T; T-- ) { 15 | 16 | cin >> N; 17 | 18 | sq = trunc( sqrt( 8 * N ) - 1 ) / 2; 19 | t = N - sq * ( sq + 1 ) / 2; 20 | 21 | cout << "TERM " << N << " IS "; 22 | if ( sq & 1 ) 23 | cout << t << "/" << sq - t + 2 << endl; 24 | else cout << sq - t + 2 << "/" << t << endl; 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /Codeforces/346/A[ Alice and Bob ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int N; 7 | int a[100]; 8 | 9 | int gcd(int a, int b) 10 | { 11 | return b ? gcd(b, a % b) : a; 12 | } 13 | 14 | int main() 15 | { 16 | cin >> N; 17 | for (int i = 0; i < N; ++i) 18 | cin >> a[i]; 19 | 20 | int g = a[0]; 21 | for (int i = 1; i < N; ++i) 22 | g = gcd(g, a[i]); 23 | 24 | int m = *max_element(a, a + N); 25 | 26 | int ans = m / g - N; 27 | 28 | cout << (ans % 2 == 1 ? "Alice" : "Bob"); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new4/gcd2.cpp: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | int T, A, B; 4 | int main() { 5 | for( scanf( "%d", &T ); T--; ) { 6 | char line[300]; 7 | scanf( "%d %s", &A, &line ); 8 | int len = strlen( line ); 9 | if ( A == 0 ) { 10 | printf( "%s\n", line ); 11 | continue; 12 | } 13 | if ( line[0] == '0' ) { 14 | printf( "%d\n", A ); 15 | continue; 16 | } 17 | B = 0; 18 | for ( int i = 0; i < len; i++ ) 19 | B = ( B * 10 + line[i] - '0' ) % A; 20 | while( A && B ) if ( B %= A ) A %= B; 21 | printf( "%d\n", A + B ); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new2/mipt086.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | acm.mipt.ru 4 | MIPT #86 "Anti-factorial" 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | int ans; 11 | 12 | int main() 13 | { 14 | string f; cin >> f; 15 | if (f == "1") ans = 1; else 16 | if (f == "2") ans = 2; else 17 | if (f == "6") ans = 3; else 18 | if (f == "24") ans = 4; else 19 | if (f == "120") ans = 5; else 20 | if (f == "720") ans = 6; else 21 | { 22 | for (double l = 0; l < f.size(); l += log10(++ans)); 23 | ans--; 24 | } 25 | 26 | cout << ans << endl; 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new2/mipt201.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | MIPT #201 "Number of solutions" 4 | */ 5 | #include 6 | 7 | using namespace std; 8 | 9 | typedef long long int64; 10 | 11 | int N; 12 | int64 ans; 13 | int cant[1 << 21]; 14 | 15 | int main() 16 | { 17 | cin >> N; 18 | 19 | for (int i = 0; i <= N; i++) 20 | for (int j = 0; 2 * j + i <= N; j++) 21 | cant[2 * j + i]++; 22 | 23 | for (int i = 0; 3 * i <= N; i++) 24 | for (int j = 0; 4 * j + 3 * i <= N; j++) 25 | ans += cant[N - (4 * j + 3 * i)]; 26 | 27 | cout << ans << endl; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu222.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 13 - 5 - 2008 4 | Saratov #222 "Little Rooks" 5 | */ 6 | #include 7 | 8 | int N, K; 9 | long long sol, factK; 10 | 11 | int main() { 12 | 13 | scanf( "%d %d", &N, &K ); 14 | 15 | if ( K > N ) { 16 | printf( "0\n" ); 17 | return 0; 18 | } 19 | 20 | factK = 1; 21 | for ( int i = 1; i <= K; i++ ) 22 | factK = factK * i; 23 | 24 | sol = 1; 25 | for ( int i = N - K + 1; i <= N; i++ ) 26 | sol *= i; 27 | 28 | printf( "%I64d\n", sol * sol / factK ); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new6/gny07h.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 9 - 7 - 2007 4 | */ 5 | #include 6 | 7 | int T, N; 8 | int dp[2], S[2], A[2]; 9 | int main() { 10 | scanf( "%d", &T ); 11 | for ( int tc = 1; tc <= T; tc++ ) { 12 | scanf( "%d", &N ); 13 | dp[1] = S[1] = A[1] = 0; 14 | dp[0] = S[0] = A[0] = 1; 15 | int j; 16 | for ( int i = 1; i <= N; i++ ) { 17 | j = i & 1; 18 | int j1 = ( i - 1 ) & 1; 19 | dp[j] = dp[j] + dp[j1] + 2 * S[j] + A[j]; 20 | S[j] = S[j1] + dp[j]; 21 | A[j] = A[j] + dp[j]; 22 | } 23 | printf( "%d %d\n", tc, dp[j] ); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu127.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 11 - 2 - 2008 4 | Saratov #127 "Telephone directory" 5 | */ 6 | #include 7 | 8 | const int MAXN = 8000; 9 | 10 | int N, K, i, sol; 11 | int freq[10]; 12 | char ls[MAXN][10]; 13 | 14 | int main() { 15 | 16 | scanf( "%d %d", &K, &N ); 17 | for ( i = 0; i < N; i++ ) 18 | scanf( "%s", &ls[i] ); 19 | 20 | for ( i = 0; i < N; i++ ) 21 | freq[ ls[i][0] - '0' ]++; 22 | 23 | for ( i = 0; i < 10; i++ ) 24 | sol += ( freq[i] + K - 1 ) / K; 25 | 26 | printf( "%d\n", sol + 2 ); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/COWCAR.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 6 - 7 - 2008 4 | SPOJ #2714 "Cow Cars" 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | #define REP( i, n ) \ 12 | for ( int i = 0; i < (n); i++ ) 13 | 14 | const int MAXN = 100000; 15 | 16 | int N, M, D, L, sol; 17 | int S[MAXN]; 18 | 19 | int main() { 20 | scanf( "%d %d %d %d", &N, &M, &D, &L ); 21 | REP( i, N ) 22 | scanf( "%d", S + i ); 23 | sort( S, S + N ); 24 | REP( i, N ) 25 | if ( S[i] - D * ( sol / M ) >= L ) 26 | sol++; 27 | printf( "%d\n", sol ); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /OldStuff/USACO/Training/FACT4.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | ID: a2peter1 3 | PROG: fact4 4 | LANG: C++ 5 | */ 6 | #include 7 | using namespace std; 8 | 9 | #define problem "fact4" 10 | 11 | int N, i, j, f2, f5, sol; 12 | 13 | int main() { 14 | ifstream fin (problem ".in"); 15 | fin >> N; 16 | 17 | sol = 1; 18 | for (i = 2; i <= N; i++) { 19 | for (j = i; !(j % 2); j /= 2, f2++) ; 20 | for ( ; !(j % 5); j /= 5, f5++) ; 21 | sol = (sol * j) % 10; 22 | } 23 | 24 | for ( ; f2 > f5; sol = (sol * 2) % 10, f2--) ; 25 | 26 | ofstream fout (problem ".out"); 27 | fout << sol << endl; 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /OldStuff/POI/2002/IZO.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 29 - 2 - 2008 4 | POI 2002 Stage II "Insulator" 5 | */ 6 | #include 7 | #include 8 | 9 | using std::sort; 10 | 11 | const int MAXN = 100000; 12 | 13 | int n, i, sol; 14 | int s[MAXN]; 15 | 16 | int main() { 17 | 18 | scanf( "%d", &n ); 19 | for ( i = 0; i < n; i++ ) 20 | scanf( "%d", s + i ); 21 | 22 | sort( s, s + n ); 23 | 24 | for ( i = 0; i < n / 2; i++ ) 25 | sol += 2 * s[n - i - 1]; 26 | 27 | if ( n & 1 ) 28 | sol += s[n / 2]; 29 | 30 | printf( "%d\n", sol ); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /HackerRank/ProjectEuler/AC/Problem6.scala: -------------------------------------------------------------------------------- 1 | object Solution { 2 | 3 | val in = { 4 | val lines = scala.io.Source.stdin.getLines 5 | lines flatMap (_ split ' ' filter (_.nonEmpty)) 6 | } 7 | 8 | def nextInt = in.next.toInt 9 | 10 | def main(args: Array[String]): Unit = { 11 | val testCount = nextInt 12 | 13 | val MAXN = 10000 14 | def square(x: Long) = x * x 15 | val nums = 1L to MAXN 16 | 17 | val sumOfSquares = (nums map square).scanLeft(0L)(_ + _) 18 | val squareOfSum = nums.scanLeft(0L)(_ + _) map square 19 | 20 | for (test <- 1 to testCount) { 21 | val N = nextInt 22 | println(squareOfSum(N) - sumOfSquares(N)) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new1/gny07b.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | SPOJ #2524 "Conversions" 4 | 10 - 9 - 2008 5 | */ 6 | #include 7 | 8 | int T; 9 | double val; 10 | char unit[5]; 11 | 12 | int main() { 13 | 14 | scanf( "%d", &T ); 15 | for ( int t = 1; t <= T; t++ ) { 16 | scanf( "%lf %s", &val, &unit ); 17 | if ( unit[0] == 'k' ) printf( "%d %.4lf lb\n", t, val * 2.2046 ); else 18 | if ( unit[1] == 'b' ) printf( "%d %.4lf kg\n", t, val * 0.4536 ); else 19 | if ( unit[0] == 'l' ) printf( "%d %.4lf g\n", t, val * 0.2642 ); else 20 | if ( unit[0] == 'g' ) printf( "%d %.4lf l\n", t, val * 3.7854 ); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /Codeforces/58/B[ Coins ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | const int maxi = 1000000; 8 | 9 | vector primes; 10 | bool bprimes[maxi+10]; 11 | 12 | int Criba(){ 13 | for (int i=2; i*i1){ 29 | printf("%d ",n); 30 | while ((n%primes[k])!=0) k++; 31 | n/=primes[k]; 32 | } 33 | printf("%d",n); 34 | } -------------------------------------------------------------------------------- /HackerRank/ProjectEuler/AC/Problem5.scala: -------------------------------------------------------------------------------- 1 | import scala.math.log 2 | 3 | object Solution { 4 | 5 | val in = { 6 | val lines = scala.io.Source.stdin.getLines 7 | lines flatMap (_ split ' ' filter (_.nonEmpty)) 8 | } 9 | 10 | def nextInt = in.next.toInt 11 | 12 | val primes = Seq(2, 3, 5, 7, 11, 13, 17 ,19, 23, 29, 31, 37) 13 | 14 | def main(args: Array[String]): Unit = { 15 | val testCount = nextInt 16 | for (test <- 1 to testCount) { 17 | val N = nextInt 18 | val primesExp = primes zip (primes map (p => (log(N) / log(p)).toInt)) 19 | val powers = primesExp map { case (p, e) => math.pow(p, e).toLong } 20 | println(powers.product) 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /OldStuff/MIPT/MIPT027.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 18 - 7 - 2008 4 | MIPT #027 "Odd number" 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | #define REP( i, n ) \ 12 | for ( int i = 0; i < (n); i++ ) 13 | 14 | const int MAXX = 1000001; 15 | 16 | int N, x; 17 | bitset< MAXX > odd; 18 | 19 | int main() { 20 | 21 | scanf( "%d", &N ); 22 | REP( i, N ) { 23 | scanf( "%d", &x ); 24 | odd.flip( x ); 25 | } 26 | 27 | REP( i, MAXX ) 28 | if ( odd[i] ) { 29 | printf( "%d\n", i ); 30 | break; 31 | } 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/PERMUT2.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 17 - 7 - 2007 4 | SPOJ #379 "Ambiguous Permutations" 5 | */ 6 | #include 7 | 8 | #define MAXN 100000 9 | 10 | int N, i; 11 | int seq[MAXN], pos[MAXN]; 12 | 13 | int main() { 14 | 15 | scanf( "%d", &N ); 16 | while ( N ) { 17 | 18 | for ( i = 0; i < N; i++ ) { 19 | scanf( "%d", &seq[i] ); 20 | pos[ --seq[i] ] = i; 21 | } 22 | 23 | for ( i = 0; i < N; i++ ) 24 | if ( pos[i] != seq[i] ) break; 25 | 26 | if ( i < N ) printf( "not " ); 27 | printf( "ambiguous\n" ); 28 | 29 | scanf( "%d", &N ); 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /Codeforces/573/A[ Bear and Poker ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int N; 5 | int a[1 << 17]; 6 | 7 | int main() { 8 | ios_base::sync_with_stdio(0); 9 | cin.tie(0); 10 | 11 | cin >> N; 12 | for (int i = 0; i < N; ++i) { 13 | cin >> a[i]; 14 | while (a[i] % 2 == 0) a[i] /= 2; 15 | while (a[i] % 3 == 0) a[i] /= 3; 16 | } 17 | 18 | for (int i = 0; i < N; ++i) 19 | if (a[i] != a[0]) { 20 | cout << "No" << endl; 21 | return 0; 22 | } 23 | 24 | cout << "Yes" << endl; 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new/palace.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | SPOJ #1183 "Accomodate the palace" 4 | 4 - 9 - 2008 5 | */ 6 | #include 7 | 8 | typedef long long int64; 9 | 10 | const int MODULO = 98777; 11 | 12 | int T, N; 13 | 14 | template< typename T > 15 | T sqr( T x ) { return x * x; } 16 | 17 | int64 pow( int a, int64 b ) { 18 | if ( b == 0 ) return 1; 19 | int64 x = sqr( pow( a, b / 2 ) ) % MODULO; 20 | if ( b & 1 ) x = x * a % MODULO; 21 | return x; 22 | } 23 | 24 | int main() { 25 | 26 | for ( scanf( "%d", &T ); T--; ) { 27 | scanf( "%d", &N ); 28 | printf( "%d\n", pow( 2, sqr( N - 1 ) ) ); 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new10/mergsort.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | SPOJ "MERGSORT" 4 | 19 - 5 - 2009 5 | */ 6 | #include 7 | #include 8 | 9 | const int MAXN = 1 << 17; 10 | 11 | int N, vals[MAXN], tmp[MAXN]; 12 | 13 | void msort( int a[], int N ) { 14 | if ( N < 2 ) return ; 15 | msort( a, N/2 ); msort( a + N/2, N - N/2 ); 16 | std::merge( a, a + N/2, a + N/2, a + N, tmp ); 17 | for (int i = 0; i < N; i++) 18 | a[i] = tmp[i]; 19 | } 20 | 21 | int main() { 22 | 23 | while ( scanf( "%d", &vals[N] ) == 1 ) N++; 24 | msort( vals, N ); 25 | for (int i = 0; i < N; i++) 26 | printf( "%d ", vals[i] ); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu102.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 11 - 2 - 2008 4 | Saratov #102 "Coprimes" 5 | */ 6 | #include 7 | 8 | const int MAXN = 10000; 9 | 10 | int N, i, j; 11 | bool mark[MAXN + 1]; 12 | int euler[MAXN + 1]; 13 | 14 | int main() { 15 | 16 | scanf( "%d", &N ); 17 | 18 | for ( i = 0; i <= N; i++ ) 19 | euler[i] = i; 20 | for ( i = 2; i <= N; i++ ) 21 | if ( !mark[i] ) 22 | for ( j = i; j <= N; j += i ) { 23 | euler[j] = euler[j] / i * ( i - 1 ); 24 | mark[j] = true; 25 | } 26 | 27 | printf( "%d\n", euler[N] ); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new1/scales.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | SPOJ #153 "Balancing the Stone" 4 | 7 - 9 - 2008 5 | */ 6 | #include 7 | 8 | #define REP( i, n ) \ 9 | for ( int i = 0; i < (n); i++ ) 10 | 11 | const int MAXL = 10000001; 12 | 13 | int T, N, L, D; 14 | char M[MAXL]; 15 | int dp[2]; 16 | 17 | int main() { 18 | 19 | for ( scanf( "%d", &T ); T--; ) { 20 | scanf( "%d %d %d", &N, &L, &D ); 21 | scanf( "%s", &M ); 22 | dp[0] = 1; dp[1] = 0; 23 | REP( i, N - L ) 24 | dp[1] = ( dp[0] + dp[1] ) % D; 25 | REP( i, L ) 26 | dp[ M[i] == '0' ] = ( dp[0] + dp[1] ) % D; 27 | printf( "%d\n", dp[0] ); 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /OldStuff/USACO/Training/RIDE.PAS: -------------------------------------------------------------------------------- 1 | { 2 | ID: a2peter1 3 | PROG: ride 4 | LANG: PASCAL 5 | } 6 | {$B-,I-,Q-,R-,S-} 7 | const 8 | problem = 'ride'; 9 | var 10 | s : string; 11 | i,A,B : longint; 12 | 13 | begin 14 | assign(input,problem + '.in'); reset(input); 15 | assign(output,problem + '.out'); rewrite(output); 16 | 17 | readln(s); A := 1; 18 | for i := 1 to length(s) 19 | do A := A * (ord(s[i]) - 64) mod 47; 20 | readln(s); B := 1; 21 | for i := 1 to length(s) 22 | do B := B * (ord(s[i]) - 64) mod 47; 23 | 24 | if A = B 25 | then writeln('GO') 26 | else writeln('STAY'); 27 | 28 | close(output); 29 | end.{main} -------------------------------------------------------------------------------- /OldStuff/SPOJ/CYLINDER.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 24 - 11 - 2007 4 | SPOJ #1681 "Cylinder" 5 | Gracias a Manuel Candales 6 | */ 7 | #include 8 | #include 9 | using namespace std; 10 | 11 | double sqr( double x ) { 12 | return x * x; 13 | } 14 | 15 | int main() { 16 | 17 | cout.precision( 3 ); 18 | 19 | double A, B; 20 | while ( cin >> A >> B, A, B ) 21 | cout << fixed 22 | << ( ( sqr( ( ( double )A / 2 ) ? 23 | ( sqr( A / M_PI / 2 ) * ( B - 2 * ( A / M_PI / 2 ) ) * M_PI ) ) 24 | << endl; 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new2/mipt047.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | acm.mipt.ru 4 | MIPT #47 "Self-describing sequence" 5 | */ 6 | #include 7 | 8 | using namespace std; 9 | 10 | const int 11 | MAXN = 1 << 20; 12 | 13 | int K; 14 | int f[MAXN]; 15 | 16 | int main() 17 | { 18 | scanf( "%d", &K ); 19 | 20 | int cur = 1; 21 | f[cur++] = 1; // 1 22 | f[cur++] = 2; // 2 23 | f[cur++] = 2; // 3 24 | 25 | for (int i = 1;; i++) 26 | { 27 | if ((K -= f[i]) <= 0) 28 | { 29 | printf( "%d\n", i ); 30 | break; 31 | } 32 | if (i >= 3) 33 | for (int j = 0; cur < MAXN && j < f[i]; j++) 34 | f[cur++] = i; 35 | } 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /OldStuff/Croacia/OPEN_2007-2008/6/PARKING.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 12 - 4 - 2008 4 | TASK: PARKING 5 | */ 6 | #include 7 | 8 | int i, j, lo, hi; 9 | int money; 10 | int cost[4]; 11 | int trucks[200]; 12 | 13 | int main() { 14 | 15 | for ( i = 1; i <= 3; i++ ) 16 | scanf( "%d", &cost[i] ); 17 | 18 | for ( i = 1; i <= 3; i++ ) { 19 | scanf( "%d %d", &lo, &hi ); 20 | for ( j = lo; j < hi; j++ ) 21 | trucks[j]++; 22 | } 23 | 24 | for ( i = 0; i <= 100; i++ ) 25 | money += trucks[i] * cost[ trucks[i] ]; 26 | 27 | printf( "%d\n", money ); 28 | 29 | return 0; 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new2/mipt059.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | acm.mipt.ru 4 | MIPT #59 "CD" 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | #define REP(i, n) for (int i = 0; i < (int)(n); ++i) 12 | 13 | const int 14 | MAXN = 20; 15 | 16 | int T, N, ans; 17 | int track[MAXN]; 18 | int sum[1 << MAXN]; 19 | 20 | int main() 21 | { 22 | cin >> T >> N; 23 | REP(i, N) cin >> track[i]; 24 | 25 | REP(i, (1 << N)) if (i) 26 | { 27 | int pos = __builtin_ctz(i); 28 | sum[i] = sum[i - (1 << pos)] + track[pos]; 29 | if (sum[i] <= T) ans = max(ans, sum[i]); 30 | } 31 | 32 | cout << ans << endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/ONP.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 17 - 7 - 2007 4 | SPOJ #4 "Transform the Expression" 5 | */ 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int T, pos; 11 | string expr, sol; 12 | 13 | void eval() { 14 | char sign, ch; 15 | while ( ( ch = expr[ ++pos ] ) != ')' ) 16 | if ( ch == '(' ) eval(); 17 | else if ( ch >= 'a' && ch <= 'z' ) cout << ch; 18 | else sign = ch; 19 | cout << sign; 20 | } 21 | 22 | int main() { 23 | 24 | for ( cin >> T; T; T-- ) { 25 | cin >> expr; 26 | pos = 0; 27 | sol.clear(); 28 | eval(); 29 | cout << endl; 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new10/mcoins.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | SPOJ #3885 "Coins Game" 4 | 21 - 5 - 2009 5 | */ 6 | #include 7 | 8 | #define REP( i, n ) for ( int i = 0; i < (n); i++ ) 9 | 10 | const int MAXN = 1 << 20; 11 | 12 | int N, A, B; 13 | bool dp[MAXN]; 14 | 15 | int main() { 16 | 17 | scanf( "%d %d %d", &A, &B, &N ); 18 | 19 | REP( i, MAXN ) { 20 | if ( i - 1 >= 0 ) dp[i] |= !dp[i - 1]; 21 | if ( i - A >= 0 ) dp[i] |= !dp[i - A]; 22 | if ( i - B >= 0 ) dp[i] |= !dp[i - B]; 23 | } 24 | 25 | REP( i, N ) { 26 | int val; 27 | scanf( "%d", &val ); 28 | printf( "%c", dp[val] ? 'A' : 'B' ); 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /Codeforces/58/A[ Chat room ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char s[1005]; 4 | int c = 0; 5 | 6 | int main(){ 7 | scanf("%s",s); 8 | for (int i=0; s[i]; i++){ 9 | if (c==0){ 10 | if (s[i]=='h'){ 11 | c++; 12 | continue; 13 | } 14 | } 15 | if (c==1){ 16 | if (s[i]=='e'){ 17 | c++; 18 | continue; 19 | } 20 | } 21 | if (c==2){ 22 | if (s[i]=='l'){ 23 | c++; 24 | continue; 25 | } 26 | } 27 | if (c==3){ 28 | if (s[i]=='l'){ 29 | c++; 30 | continue; 31 | } 32 | } 33 | if (c==4){ 34 | if (s[i]=='o'){ 35 | c++; 36 | continue; 37 | } 38 | } 39 | } 40 | if (c==5) printf("YES"); 41 | else printf("NO"); 42 | } -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu117.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 3 - 2 - 2008 4 | Saratov #117 "Counting" 5 | */ 6 | #include 7 | 8 | int N, M, K, x, sol; 9 | 10 | int power( int x, int n, int MOD ) { 11 | int p = 1; 12 | for ( ; n; n /= 2 ) { 13 | if ( n & 1 ) 14 | p = ( p * x ) % MOD; 15 | x = ( x * x ) % MOD; 16 | } 17 | return p; 18 | } 19 | 20 | int main() { 21 | 22 | scanf( "%d %d %d", &N, &M, &K ); 23 | while ( N-- ) { 24 | scanf( "%d", &x ); 25 | if ( power( x, M, K ) == 0 ) 26 | sol++; 27 | } 28 | 29 | printf( "%d\n", sol ); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new6/gny07f.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | SPOJ #2528 "Monkey Vines" 4 | 29 - 9 - 2008 5 | */ 6 | #include 7 | #include 8 | #include 9 | 10 | using std::max; 11 | 12 | const int MAXLEN = 200; 13 | 14 | int T, pos; 15 | int cant, sol; 16 | char line[MAXLEN]; 17 | 18 | int main() { 19 | 20 | T = atoi( gets( line ) ); 21 | for ( int tc = 1; tc <= T; tc++ ) { 22 | gets( line ); 23 | sol = cant = 0; 24 | for ( int i = 0; line[i]; i++ ) 25 | if ( line[i] == '[' ) { 26 | cant++; 27 | sol = max( sol, cant ); 28 | } 29 | else 30 | cant--; 31 | printf( "%d %d\n", tc, 1 << sol ); 32 | } 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /OldStuff/USACO/Training/SUBSET.PAS: -------------------------------------------------------------------------------- 1 | { 2 | ID: a2peter1 3 | PROG: subset 4 | LANG: PASCAL 5 | } 6 | {$B-,I-,Q-,R-,S-} 7 | const 8 | problem = 'subset'; 9 | MaxS = 800; 10 | var 11 | N,S,i,j : longint; 12 | C : array[0..MaxS] of int64; 13 | 14 | begin 15 | assign(input,problem + '.in'); reset(input); 16 | assign(output,problem + '.out'); rewrite(output); 17 | 18 | readln(N); 19 | 20 | S := N * (N + 1) div 2; 21 | if odd(S) then writeln(0) 22 | else begin 23 | C[0] := 1; S := S div 2 - N; 24 | for i := 1 to N - 1 do 25 | for j := S downto i 26 | do inc(C[j],C[j - i]); 27 | writeln(C[S]); 28 | end;{else} 29 | 30 | close(output); 31 | end.{main} 32 | -------------------------------------------------------------------------------- /OldStuff/USACO/2008/MAR_OK/SILVER/RIVER.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 18 - 3 - 2008 4 | USACO MAR08 Silver "River Crossing" 5 | */ 6 | #include 7 | 8 | const int MAXN = 3000; 9 | 10 | int n, i, j; 11 | int v[MAXN], dp[MAXN]; 12 | 13 | int main() { 14 | 15 | scanf( "%d %d", &n, &v[0] ); 16 | for ( i = 1; i <= n; i++ ) { 17 | scanf( "%d", &v[i] ); 18 | v[i] += v[i - 1]; 19 | } 20 | 21 | for ( i = 1; i <= n; i++ ) { 22 | dp[i] = ( 1 << 29 ); 23 | for ( j = 1; j <= i; j++ ) 24 | dp[i] N) or (b + d > N) then exit; 15 | print(a,b,a + c,b + d); 16 | writeln(a + c,'/',b + d); 17 | print(a + c,b + d,c,d); 18 | end;{print} 19 | 20 | begin 21 | assign(input,problem + '.in'); reset(input); 22 | assign(output,problem + '.out'); rewrite(output); 23 | 24 | readln(N); 25 | 26 | {Farey sequence} 27 | writeln('0/1'); 28 | print(0,1,1,1); 29 | writeln('1/1'); 30 | 31 | close(output); 32 | end.{main} 33 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu133.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 11 - 2 - 2008 4 | Saratov #133 "Border" 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | const int MAXN = 20000; 12 | 13 | int N, i, max_y, sol; 14 | pair< int, int > ls[MAXN]; 15 | 16 | int main() { 17 | 18 | scanf( "%d", &N ); 19 | for ( i = 0; i < N; i++ ) 20 | scanf( "%d %d", 21 | &ls[i].first, 22 | &ls[i].second ); 23 | 24 | sort( ls, ls + N ); 25 | 26 | for ( i = 0; i < N; 27 | max_y >?= ls[i].second, i++ ) 28 | if ( max_y > ls[i].second ) 29 | sol++; 30 | 31 | printf( "%d\n", sol ); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /OldStuff/SARATOV/sgu249.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 16 - 5 - 2008 4 | Saratov #249 "Matrix" 5 | */ 6 | #include 7 | 8 | const int MAXC = 20; 9 | 10 | #define REP( i, n ) \ 11 | for ( int i = 0; i < (n); i++ ) 12 | 13 | int F, C, sz; 14 | int seq[1 << MAXC]; 15 | 16 | int main() { 17 | 18 | scanf( "%d %d", &F, &C ); 19 | 20 | seq[sz++] = 0; 21 | REP( i, F >? C ) { 22 | REP( j, sz ) 23 | seq[sz + j] = ( 1 << i ) + seq[sz - j - 1]; 24 | sz *= 2; 25 | } 26 | 27 | REP( i, 1 << F ) 28 | REP( j, 1 << C ) 29 | printf( j < ( 1 << C ) - 1 ? "%d " : "%d\n", 30 | ( seq[i] << C ) + seq[j] ); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new5/grocery.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | SPOJ #1685 "Grocery store" 4 | 22 - 9 - 2008 5 | */ 6 | #include 7 | 8 | #define FOR( i, s, e ) for ( int i = (s); i <= (e); i++ ) 9 | 10 | long long S, P; 11 | 12 | int main() { 13 | FOR( a, 8, 125 ) 14 | FOR( b, a, 592 ) { 15 | if (a+b>600 || a*b>20000) break; 16 | FOR( c, b, 884 ) { 17 | S = a+b+c; if (S>1225) break; 18 | P = a*b*c; if (P>3500000) break; 19 | S *= 1000000; 20 | P -= 1000000; 21 | if (P<=0 || S%P) continue; 22 | long long d = S / P; 23 | if (d 2000000000) continue; 25 | printf( "%.2lf %.2lf %.2lf %.2lf\n", a/100., b/100., c/100., d/100. ); 26 | } 27 | } 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /Codeforces/158/B[ Taxi ].cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | VK Cup 2012 Qualification Round 1 4 | */ 5 | #include 6 | 7 | using namespace std; 8 | 9 | int N, cnt[5]; 10 | 11 | int main() 12 | { 13 | cin >> N; 14 | for (int i = 0; i < N; ++i) 15 | { 16 | int x; cin >> x; 17 | cnt[x]++; 18 | } 19 | 20 | int ans = cnt[4]; 21 | while (cnt[2] >= 2) cnt[2] -= 2, ans++; 22 | while (cnt[1] && cnt[3]) cnt[1]--, cnt[3]--, ans++; 23 | 24 | while (cnt[1] >= 2 && cnt[2]) cnt[1] -= 2, cnt[2]--, ans++; 25 | 26 | if (cnt[1] == 1 && cnt[2]) cnt[1]--, cnt[2]--, ans++; 27 | while (cnt[1]) cnt[1] -= min(cnt[1], 4), ans++; 28 | 29 | ans += cnt[3]; 30 | ans += cnt[2]; 31 | 32 | cout << ans << endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /OldStuff/Croacia/OPEN_2007-2008/1/CETVRTAa.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso Alfonso Peterssen 3 | 4 - 11 - 2007 4 | COCI 2007 Contest 1 "CETVRTA" 5 | */ 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int i, j, k, l; 11 | int x[3], y[3]; 12 | 13 | int main() { 14 | 15 | for ( i = 0; i < 3; i++ ) 16 | cin >> x[i] >> y[i]; 17 | 18 | for ( i = 1; i < 3; i++ ) 19 | for ( j = 0; j < i; j++ ) 20 | if ( x[i] == x[j] ) 21 | for ( k = 1; k < 3; k++ ) 22 | for ( l = 0; l < k; l++ ) 23 | if ( y[k] == y[l] ) { 24 | cout << x[3 - i - j] << " " << y[3 - k - l] << endl; 25 | /* Suicide */ 26 | return 0; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /OldStuff/MIPT/MIPT002.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 17 - 7 - 2008 4 | MIPT #002 "Set Intersection" 5 | */ 6 | #include 7 | 8 | #define REP( i, n ) \ 9 | for ( int i = 0; i < (n); i++ ) 10 | 11 | const int MAXC = 1000001; 12 | 13 | int x; 14 | bool output; 15 | bool used[MAXC][2]; 16 | 17 | int main() { 18 | 19 | while ( scanf( "%d", &x ) && x != -1 ) used[x][0] = true; 20 | while ( scanf( "%d", &x ) && x != -1 ) used[x][1] = true; 21 | 22 | REP( i, MAXC ) 23 | if ( used[i][0] && used[i][1] ) { 24 | printf( "%d ", i ); 25 | output = true; 26 | } 27 | 28 | if ( !output ) 29 | printf( "empty\n" ); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /OldStuff/POI/1998/PLE.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 12 - 5 - 2008 4 | POI 1998 Stage II "Frogman" 5 | */ 6 | #include 7 | #include 8 | 9 | const int MAXN = 80; 10 | 11 | int O, N, T; 12 | int dp[MAXN][MAXN]; 13 | 14 | int main() { 15 | 16 | scanf( "%d %d", &O, &N ); 17 | scanf( "%d", &T ); 18 | 19 | memset( dp, 63, sizeof( dp ) ); 20 | dp[0][0] = 0; 21 | while ( T-- ) { 22 | int i, j, x, y, w; 23 | scanf( "%d %d %d", &x, &y, &w ); 24 | for ( i = O; i >= 0; i-- ) 25 | for ( j = N; j >= 0; j-- ) 26 | dp[i][j] ? 0][j - y >? 0] + w; 27 | } 28 | 29 | printf( "%d\n", dp[O][N] ); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /OldStuff/USACO/Training/INFLATE.PAS: -------------------------------------------------------------------------------- 1 | { 2 | ID: a2peter1 3 | PROG: inflate 4 | LANG: PASCAL 5 | } 6 | {$B-,I-,Q-,R-,S-} 7 | const 8 | problem = 'inflate'; 9 | MaxN = 10000; 10 | var 11 | N,M,i,j : longint; 12 | C,points,time : array[0..MaxN] of longint; 13 | 14 | begin 15 | assign(input,problem + '.in'); reset(input); 16 | assign(output,problem + '.out'); rewrite(output); 17 | 18 | readln(M,N); 19 | for i := 1 to N do 20 | readln(points[i],time[i]); 21 | 22 | for i := 1 to M do 23 | for j := 1 to N do 24 | if (time[j] <= i) and (C[i - time[j]] + points[j] > C[i]) 25 | then C[i] := C[i - time[j]] + points[j]; 26 | 27 | writeln(C[M]); 28 | 29 | close(output); 30 | end.{main} 31 | -------------------------------------------------------------------------------- /OldStuff/USACO/Training/MONEY.PAS: -------------------------------------------------------------------------------- 1 | { 2 | ID: a2peter1 3 | PROG: money 4 | LANG: PASCAL 5 | } 6 | {$B-,I-,Q-,R-,S-} 7 | const 8 | problem = 'money'; 9 | MaxN = 25; 10 | MaxM = 10000; 11 | var 12 | N,M,i,j : longint; 13 | C : array[0..MaxM] of int64; 14 | coin : array[0..MaxN] of longint; 15 | 16 | begin 17 | assign(input,problem + '.in'); reset(input); 18 | assign(output,problem + '.out'); rewrite(output); 19 | 20 | readln(N,M); 21 | for i := 1 to N 22 | do read(coin[i]); 23 | 24 | C[0] := 1; 25 | for i := 1 to N do 26 | for j := 1 to M do 27 | if coin[i] <= j then 28 | C[j] := C[j] + C[j - coin[i]]; 29 | 30 | writeln(C[M]); 31 | 32 | close(output); 33 | end.{main} -------------------------------------------------------------------------------- /Codeforces/472/A[ Design Tutorial: Learn from Math ].cpp: -------------------------------------------------------------------------------- 1 | // Alfonso2 Peterssen (mukel) 2 | #include 3 | using namespace std; 4 | 5 | typedef long long int64; 6 | 7 | const int 8 | MAXN = 1000005; 9 | 10 | int N; 11 | bool mark[MAXN]; 12 | 13 | int main() { 14 | ios_base::sync_with_stdio(0); 15 | cin.tie(0); 16 | 17 | cin >> N; 18 | 19 | for (int i = 2; i < MAXN; ++i) 20 | if (!mark[i]) { 21 | for (int j = 2 * i; j < MAXN; j += i) 22 | mark[j] = true; 23 | } 24 | 25 | for (int i = 4; i < N; ++i) 26 | if (mark[i] && N - i > 3 && mark[N - i]) 27 | { 28 | cout << i << " " << N - i << endl; 29 | return 0; 30 | } 31 | 32 | 33 | return 0; 34 | } -------------------------------------------------------------------------------- /Codeforces/406/A[ Unusual Product ].cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int N, Q; 5 | int d[1 << 10]; 6 | 7 | int main() 8 | { 9 | ios::sync_with_stdio(0); 10 | cin.tie(0); 11 | 12 | scanf( "%d", &N ); 13 | 14 | for (int i = 0; i < N; ++i) 15 | for (int j = 0; j < N; ++j) 16 | { 17 | int x; 18 | scanf("%d", &x); 19 | if (i == j) 20 | d[i] = x; 21 | } 22 | 23 | int ans = count(d, d + N, 1) & 1; 24 | 25 | scanf( "%d", &Q); 26 | while (Q--) 27 | { 28 | int op; scanf( "%d", &op ); 29 | if (op <= 2) 30 | { 31 | int x; 32 | scanf( "%d", &x ); 33 | ans ^= 1; 34 | } else 35 | printf("%d", ans); 36 | } 37 | 38 | printf("\n"); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /OldStuff/Baltic/1995/RECT.CPP: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | 8 - 5 - 2008 4 | Baltic 1995 TASK: RECT 5 | */ 6 | #include 7 | 8 | int K, X, Y, sol; 9 | long long x1, x2, y1, y2; 10 | 11 | int main() { 12 | 13 | scanf( "%d %d %d", &K, &X, &Y ); 14 | 15 | x1 = 0; y1 = 0; 16 | x2 = 0; y2 = 1; 17 | do { 18 | if ( sol % 4 == 0 ) x2 += K * ( y2 - y1 ); // right 19 | if ( sol % 4 == 1 ) y2 += K * ( x2 - x1 ); // up 20 | if ( sol % 4 == 2 ) x1 -= K * ( y2 - y1 ); // left 21 | if ( sol % 4 == 3 ) y1 -= K * ( x2 - x1 ); // down 22 | sol++; 23 | } while ( x1 > X || x2 < X || 24 | y1 > Y || y2 < Y ); 25 | 26 | printf( "%d\n", sol ); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /OldStuff/SPOJ/new3/broul.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen 3 | SPOJ #1001 "Babylonian Roulette" 4 | 15 - 9 - 2008 5 | */ 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace std; 11 | 12 | int P, B, E; 13 | 14 | int main() { 15 | 16 | for (;;) { 17 | scanf( "%d %d %d", &P, &B, &E ); 18 | if ( !P && !B && !E ) break; 19 | int money = abs( E - P ); 20 | int g3 = money / ( 3 * B ); 21 | money -= g3 * 3 * B; 22 | int g2 = money / ( 2 * B ); 23 | money -= g2 * 2 * B; 24 | int g1 = money / ( 1 * B ); 25 | money -= g1 * 1 * B; 26 | if ( money != 0 ) 27 | printf( "No accounting tablet\n" ); 28 | else 29 | printf( "%d\n", g1 + g2 + g3 ); 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /OldStuff/TIMUS/AC/1306.nlgn.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | Team: UH++ 4 | Timus Online Judge 5 | 1306. Sequence Median 6 | */ 7 | #include 8 | #include 9 | 10 | #define REP(i, n) for (int i = 0; i < (int)(n); ++i) 11 | 12 | int N; 13 | std::priority_queue< int > pq; 14 | 15 | int main() 16 | { 17 | scanf( "%d", &N ); 18 | REP(i, N) 19 | { 20 | int x; 21 | scanf( "%d", &x ); 22 | pq.push(x); 23 | while (pq.size() > N / 2 + 1) 24 | pq.pop(); 25 | } 26 | 27 | if (N & 1) 28 | printf( "%d.0\n", pq.top() ); 29 | else 30 | { 31 | int a = pq.top(); pq.pop(); 32 | int b = pq.top(); 33 | printf( "%.1lf\n", ((double)a + b) / 2 ); 34 | } 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new2/mipt101.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen(mukel) 3 | acm.mipt.ru 4 | MIPT #101 "Stone Game -- who is the winner?" 5 | */ 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | #define REP(i, n) for (int i = 0; i < (int)(n); ++i) 12 | 13 | // SG = n % 3 14 | int calcSG(string n) 15 | { 16 | // bignum % 3 17 | int m3 = 0; 18 | REP(i, n.size()) m3 = (m3 * 10 + (n[i] - '0')) % 3; 19 | return m3; 20 | } 21 | 22 | int N, nimSum; 23 | 24 | int main() 25 | { 26 | for (cin >> N; N--;) 27 | { 28 | string x; cin >> x; 29 | nimSum ^= calcSG(x); 30 | } 31 | 32 | if (nimSum) printf( "First" ); 33 | else printf( "Second" ); 34 | 35 | printf( " wins.\n" ); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /OldStuff/USACO/Training/NUMTRI.PAS: -------------------------------------------------------------------------------- 1 | { 2 | ID: a2peter1 3 | PROG: numtri 4 | LANG: PASCAL 5 | } 6 | {$B-,I-,Q-,R-,S-} 7 | const 8 | problem = 'numtri'; 9 | MaxN = 1001; 10 | var 11 | N,i,j : longint; 12 | C : array[0..MaxN,0..MaxN] of longint; 13 | 14 | begin 15 | assign(input,problem + '.in'); reset(input); 16 | assign(output,problem + '.out'); rewrite(output); 17 | 18 | readln(N); 19 | for i := 1 to N do 20 | for j := 1 to i do read(C[i,j]); 21 | 22 | for i := N - 1 downto 1 do 23 | for j := 1 to i do 24 | if C[i + 1,j] > C[i + 1,j + 1] 25 | then inc(C[i,j],C[i + 1,j]) 26 | else inc(C[i,j],C[i + 1,j + 1]); 27 | 28 | writeln(C[1,1]); 29 | 30 | close(output); 31 | end.{main} -------------------------------------------------------------------------------- /Codeforces/158/D[ Ice Sculptures ].cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Alfonso2 Peterssen (mukel) 3 | VK Cup 2012 Qualification Round 1 4 | */ 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | #define REP(i, n) for (int i = 0; i < (int)(n); ++i) 11 | 12 | const int 13 | MAXN = 1 << 15; 14 | 15 | int N; 16 | int T[MAXN]; 17 | int value[MAXN]; 18 | int ans; 19 | 20 | int main() 21 | { 22 | cin >> N; 23 | REP(i, N) cin >> T[i], ans += T[i]; 24 | 25 | for (int i = 3; i <= N; ++i) 26 | if (N % i == 0) 27 | { 28 | int offset = N / i; 29 | REP(j, offset) value[j] = 0; 30 | REP(j, N) value[j % offset] += T[j]; 31 | ans = max(ans, *max_element(value, value + offset)); 32 | } 33 | 34 | cout << ans << endl; 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /OldStuff/MIPT/new/Happy Tickets_files/narod_init.js: -------------------------------------------------------------------------------- 1 | function y5_onContent(B){var A='