You are on page 1of 26
20224F BE A&K / 2022 Summer Entrance Examination BRAPRRSLERARS Department of Creative Informatics AGERE SK Graduate School of Information Science FayrGrYTI and Technology ‘The University of Tokyo Programming 1 SOR BAMMOSRET, COMMMAFEMU TAVITA, CORIO FBS SRE SMCS SLATS OE. RERUNS, THCRBPSELUMBRSERAT STL RBM SRUBAEVIC7 PANERENTHS, SURMBATIC, USBXEY m SI rAWEBROPICAL-LHSU, Fr1 MORSE L, PCH LEERL BEW_PTAMET I ATE RVG EOBARREB ICR LIZED, PEBMIERs TELM. YO BEDY= 27 MSMR) BRPICBRLTS AW, RYRIND BRELTROVAVA, BAOPCKAD TOS IAF PTAS TAMER A RATS CReATHS, 7, BRATS TK, BPOPCLIRRHSLOF ALT Y/THUSEIERL, TER LETRIS LBEUBMT TAVELOPICAE-FSLE, HRLEF IL b DIF A KEBENAUSBX EY ICE FHEE, 8. RAR TEI, MMT, usexeU, MEARE S. awe INSTRUCTIONS: 1. Do not open this problem booklet until the signal to begin is given, 2. Write your examinee ID number below on this cover page. 3. An answer sheet accompanies this booklet. Write down your examinee ID number and the problem number on the sheet. 4, You should have received a USB flash drive. Before the examination starts, copy the files from the USB flash drive to your PC. Verify that you can see its contents and then take your hands off your PC. if you have some problems, consult the exam supervisor. 5. You may choose any programming language to answer. 6. You may consult only one printed manual of a programming language during the ‘examination. You can use or copy any libraries or program fragments stored in your PC, but you may not connect to the Internet. 7. By the end of the examination, make a directory/folder on your PC, whose name is ‘the same as your examinee ID number, and put your program files and related files into the directory/folder. Copy the directory/folder onto the USB flash drive that you received. 8. At the end of the examination, this booklet, the USB flash drive, and the answer sheet will be collected. SBS / Examinee 1D TOS-VREA ‘This page is blank. LOK-VieA. ‘This page is blank. FAIFEYD DEOMI 7OF IAB CHA L, SERMONS, REC 7 74 Vid USB A EVOPCHS, TAPP ARMET WIC USB XE YICRATSOL, REMEOK OIC PRLEZ TI VS USBAE ICRAF SCL, AYIA YRRRROBA, WSN zip TTA VOICED 74 VBS, TOPS APT 7A VET SCART SNTHSARKIED CL, BINA URL BRRDA-TEBRML TS, HSV VARRICBR LA (XE, SRR) DAD AMAT AA EI 74 CIE MUR REE RTS, TOKI0Y (:) CRISNTHS, MAU 5 ADOMMMA Bors 621 591 907 1121 1092 CHES, 774 PONE 621:504 :907:1121: 1032 HS. S18 (1) FHAKZ 74 db infections.txt CRFSINT BP ABRAMO 5 5, 10 RACKS RERANCH, BME TH OMAK, HAM 1, 2,3,3,4 OFC 3 BEARD Hor 2 CHS. 2) 7HNT data DHOFEARI TAN FENEUKWT, | OHORMGRERO 5 % 10 BACAS VM Ny SB (1) DEIR, STO Ny OGHEHAL THEME a. (3) FFARZ 74 infections.txt KREEN TOS RRBRBK 29, 271,02, 03, tat KE Dt, SSAOMABRAK 2; t WAOMRBRAM x), OB 2; — 2; FEDHOMM BREMMKL TS, KELMAOMAOMMBRAMIE OALTS, . BA OMMERAMMRES ICM LEMFMEPED, THAT 7AM diss txt KR HUE, EKO ORFHMONFRE PEARCE. RE LOATLFR LEMIRE RV ET 3, PAM BIE + DOID, OBIS - Pothwy 4, PRE RER AM MBAS 621 -30 0 316 214 -89 CH BRG, TTA MIRED BPIMS #621-80+0-3161214-89 TU NETHS, (4) FHA TAM antections.txt KRASN TY SHABREMIC OT, HBR HMMMOMARAL REMMERS, TNS OMMO SROGOMMERSRACHI, = Ok PMMA SL ERSTHT, WAS LABEL, WAS HES 4 ABOX FRBAL, EREOMMOMMBAAMMMONE RARE BY, AVI YRERRRORSOMSRE AYIA YBRRBLBBHIC Lao T LMF zips 5 AMO zip 774 ET ibe ape Panogeay heey centring amtoeetsco/Es da: EDR APES BRP IMB ESS RBA, APO URL OSH YO FABLES, pent aneepta. cepa entceete, c/a ee RFA UMCTNES COM-YREB. ‘This page is blank. Programming Answer the following questions by writing programs. If you are taking an onsite examination, the files neoded for answering the questions are found in the USB flash drive. Store the programs in the USB flash drive before the examination ends. Also the files generated for answering questions must be stored in the USB flash drive. If you are taking an online replacement examination, the files needed for answering the questions are in the given zip file. To submit the programs and the files, follow the instructions separately given. The submission URL is shown on the last page. We store the daily numbers of newly infected people with some virus (new infections, below) in a text file in chronological order. ‘The numbers are separated by colons (:). For example, when the numbers of new infections for 5 days are 624 591 907 1121 1032 the following text 621:891:907:1121 1032 is stored in a file. Problem 1 the text file infections txt . For example, the (1) Find the 10th biggest number of new infections stored i and write it on the answer sheet. Count after removing duplicate numbei third biggest number among 1, 2, 3, 3, 4 is 2. (2) For every text file f in the data folder, find Vy, the 10th biggest number of new infections in f, as in Question (1). Then calculate the sum of all Vy and write it on the answer sheet. (8) For 9, 21,22, 2, ..ty-1, the numbers of new infections stored in the text file infections. txt, the new-infection increment on a day is the difference «t; —j-1 between the number of the new infections a; on that day and ¢;-1 on the day before. Here, the number of new infections on the day before the first day is zero. Concatenate the new-infection increment for every day into one character sequence and store it in the text file aif f.txt. Furthermore, count the characters in this sequence and write thet number on the answer sheet. ‘The newline character is not counted. Start with + for a non-negative number and start: with ~ for a negative number. For example, when the new-infection increments are 621 -30 0 -316 214 -89 the following character sequence 4621-30+0-316+214-89 is stored and the number of characters is 20. (4) For the numbers of new infections in the text file infections. txt, find the shortest period among the periods in which the sum of the new-infection increments is maximized. Write that period on the answer sheet. If more than one such period is found, write all the periods. The first day is Day 1. For example, answer like “From Day 8 to 24”. Furthermore, calculate the sum of the new-infection increments during that period, and write that sum on the answer sheet. How to submit the answers for the online replacement exami- nation According to Guidelines of the Online Replacement Written Examination, submit a zip file named “.zip” to the following URL. ep /Aanttegerysaaepse cnt efprt If an erratum is announced during the examination, it will be downloadable from the following URL. pei nar. com/ fpr ht atta snare, eA SRaae sR YEE Toten CON-YREE, ‘This page is blank. LORY. ‘This page is blank. LON-TREE. ‘This page is blank. 20224F BEM AA / 2022 Summer Entrance Examination RRAPRRELEARAAA Department of Creative Informatics RRA Graduate School of Information Science ° esate and Technolo; FAPILYTZ2 7 The University of Tokyo Programming 2 eK L RRMMOSHEC, COMBMF SM Te ITE. 2 CORMLO TBH SBRG SM MES ERAT SCL. 3 MERMAIDS, CHicRRESSLUMBSPERAT SCE. 4 BRAC SN EUBAEVIEZ AH SEN TS. BURMBBIIC, USDA TY SI PAMEBROPCIAL-LEEW, 774 LOPHEMBL, PCOS FEREL BED, TIAMET 7 ATER WEE OBAURRE ICE LEE FAP Y7EMRMERITE LN FOSS SYP EROV= aT BCR) RAPCORL TEL, AY RING BRE LTRUGALA, BAOPCICADTHS 74 77 VPTAS FLEE A RATS cc isathS, 7. RRATHE TK, ADOPCECBRESEDT ALA bY/7 aN AERL, fe UAPAS LB LUBE 71 VEZOFCAC-FSCE, HRLEF ALT b (Fa WHERE HHUBKEYCIE—FSEE. 8 RATHI, MART, ussxt), MERREERTS. INSTRUCTIONS 1, Do not open this problem booklet until the signal to begin is given. 2. Write your examinee ID number below on this cover page. 3. An answer sheet accompanies this booklet. Write down your examinee ID number and the problem number on the sheet. 4. You should have received a USB flash drive. Before the examination starts, copy the files from the USB flash drive to your PC. Verify that you can see its contents and then take your hands off your PC. if you have some problems, consult the exam supervisor. ‘You may choose any programming language to answer. You may consult only one printed manual of a programming language during the examination. You can use or copy any libraries or program fragments stored in your PC, but you may not connect to the Internet. 7. By the end of the examination, make a directory/folder on your PC, whose name is the same as your examinee ID number, and put your program files and related files into the directory/folder. Copy the directory/folder onto the USB flash drive that you received. 8. At the end of the examination, this booklet, the USB flash drive, and the answer sheet will be collected. SRHS / Examinee ID LOR-ViBA. ‘This page is blank. TORY. ‘This page is blank. FOIFEYI FORM SOI LEBV THA L, SRR ROBR, MRC LR 7 74 Vid USB X EVORESS, TOPS AMET MIC USB XEVICRETS IL, ELMEDK DIC HRLET 74S USBASVICRET ELE, AYIA YRRBROMA, MSHS zip PTA NMOPC PEC YRET 74 VHS, TOPS API 74 VeRT SERRE SUC SARCES CL, HB URL ERROA-VICML TH, BSI VARS RIGRLEA (LT, PRBRA) DSADAMTAA LT 74 IE MMIC RES NTS, TOMY (:) TRMSHTHS, MAW 5S APOMMBRS mens 621 591 907 1121 1032 CHBEG. 774 MPO EME 621:591:907:1121: 1032 THB. 2m (1) FRARI 74 ingections.txt CABSNT BAER DTMRAME 9, 21502.23) nt LTS. COCMTOMRERRT 5, its ave(i)= 2 > aes To, REL Bn), SIOFHAKI 7A OBOE s(x, y) ® sz,y) =~ min (aes — wy? & EdB, REL OSig¢m—nt FB, TANT dara DPOEBDIVDT HALT 74 VOD IS, HY BUBDR AL EE LT, ZO=OO7 FA NOZMEREARCR, EKEOMVLHSMRICBD. TO ED RMABMS 3b BBACOML EOMMET HI, (3) FARIA WY ingections2. txt KMFTNT 5G AGRAME xp, 01,02,73,.tn1 LFS. CHSOME {x)} CRT. CHS OM {a} KC MTE SMVA ai tk RSS. HA oy OMMMMIE 304k T wi BS, COC ak EMT, {2j} CIO TORE Yai + h—ai)" RDF S, ONS KOK ICHMINS. EE _nbiw- Sipe © 2D2= (LaF pe EXE Didi “abe (La? st CUCL a LO SBR. DURE AT ak ESRAIUERS ALE CHL, BPSAARICRY (1) FRAP TAM intections2. txt KAEENT BHAMBRABE x9.71,:22, 035 -tn-1 LFS, SLENK s EDT, INS OMOMAW vo.0541,0042,--Tot90 ¥ {zsp1} THI REL OS n). We define s(z,y), the similarity score between these two files, as nl “ ste,y) = —min 0 (aes — wey = where OSS m—n, Among arbitrary pairs of two files in the folder data, find the pair with the highest similarity score and write the two file names on the answer sheet. Furthermore, write the similarity score on the answer sheet. When more than one such pair is found, write all the pairs and their scores (8) Let 20,21,22,23, 40-1 be the numbers of new infections stored in the text file infections2.txt. These numbers are denoted by {24}. We find the approximate formula ai +k that has a good fit to these numbers {;}. For ‘example, the approximate value for zs is 3a-+k. Here, a and k are the constants that minimize ra the error }>(ai + k — 24)? for {2;}. They are calculated as follows. = nDin- Dida nDe- (i abe (Li? al where D represents >. oo Caleulate a and & rounded to 4 decimal places and write them on the answer sheet. (A) Let 29,221, :02. 29) a1 be the numbers of new infections stored in the text file infections2.txt. For a given s, a sub-sequence ty, 951,242, wfesgo Of these numbers is denoted by {4.1}. Here. 0.< s .zip" to the following URL. spe (Pte seep. tsps) aig, enascent, c/a psn Arse If an erratum is announced during the examination, it will be downloadable from the following URL. spay Patestyeray snap. cel i efpcen tee esse Ose TORT. ‘This page is blank. CON-YREA ‘This page is blank. AE ‘This page is blank.

You might also like