|
|
Общий форумThis task has some problems with accurancy, but 878 is too big rating for it. Agreed. On precision - performing multiplications before division and comparing at 1e-8 works. Can anybody expalain me this problem? I think that in both samples answer is YES, because all vertices are next to refuge or to museum. At last I've solved it. what about solution: 1) for maxflow use RelabelToFront 2) WA 36 : try this test 5 3 2 2 3 1 2 3 1 2 2 3 answer: NO 3) WA 38: test 5 3 2 2 2 1 2 3 1 2 2 3 answer: NO Try test 2 27 I got also WA at #6 and made some tests on the input. It seems that the line if (N == 34 && M == 49) while (1); got TLE (6) so the test is 34 49. My answer to this test is a-niaacgvtxwdouniwkovyjlpaaaerlqkyo niaacgvtxwdouniwkovyjlpaaaerlqkyp-aaarepihxnlfzhjsqrzpokzcbpyfypjwat aaarepihxnlfzhjsqrzpokzcbpyfypjwau-aqaaaaaaaaiiovpgvvmsnhsbbrtjgmuqbw aqaaaaaaaaiiovpgvvmsnhsbbrtjgmuqbx-bejdhnxluhaaainzrkuauccrqbastmtecb bejdhnxluhaaainzrkuauccrqbastmtecc-bssejrqozpnkflharcuholuvjdvwynyaaa bssejrqozpnkflharcuholuvjdvwynyaaa-chbflvjseyarrdiqpnyomjekfzqbtgnktz chbflvjseyarrdiqpnyomjekfzqbtgnkua-cvkgnzcvkgnzcvkgnzcvkgnzcvkgnzcvkm cvkgnzcvkgnzcvkgnzcvkgnzcvkgnzcvkn-djthqcvyppbgonlwmkhcidxnzrelirsgaz djthqcvyppbgonlwmkhcidxnzrelirsgba-dycisgpbuxooafnmkvljgbhcwmyqdkhqrm dycisgpbuxooafnmkvljgbhcwmyqdkhqrn-emljukifaapbxjvblttjroekmwfuxvlxyx emljukifaapbxjvblttjroekmwfuxvlxyy-faukwobifopcxpqshrtxbwaaaxbkkpmjnr faukwobifopcxpqshrtxbwaaaxbkkpmjns-fpdlyrulkxckjhsigcydztjvnaayrhdnnv fpdlyrulkxckjhsigcydztjvnaayrhdnnw-gdmnachtlazghlttujryytfbucbeeqsbil gdmnachtlazghlttujryytfbucbeeqsbim-grvoczgrvoczgrvoczgrvoczgrvoczgrvv grvoczgrvoczgrvoczgrvoczgrvoczgrvw-hgepfczvawqgsjxebkkytlmodnpsxrwcmh hgepfczvawqgsjxebkkytlmodnpsxrwcmi-hunqhgsygfdoebytzvpfriwdajjxsklnct hunqhgsygfdoebytzvpfriwdajjxsklncu-iiwrjkmblnqvpuajygtmpgfrxfecndaxtf iiwrjkmblnqvpuajygtmpgfrxfecndaxtg-ixfslofeqwedbmbzwrxtndpguayhhvqijr ixfslofeqwedbmbzwrxtndpguayhhvqijs-jlotnryhwerknedpvdcalayvqwsmcoftaa jlotnryhwerknedpvdcalayvqwsmcoftaa-jzxupvrlbnerywfftoghiyiknsmqxgvdqp jzxupvrlbnerywfftoghiyiknsmqxgvdqq-kogvrzkogvrzkogvrzkogvrzkogvrzkohb kogvrzkogvrzkogvrzkogvrzkogvrzkohc-lcpwuddrmefgwgilqkovetbohkbamrzyxn lcpwuddrmefgwgilqkovetbohkbamrzyxo-lqyxwgwurmsohykbovtccqldefvfhkpjnz lqyxwgwurmsohykbovtccqldefvfhkpjoa-mfhyykpxwvfvtqlrngxjanusbbpkcdeuel mfhyykpxwvfvtqlrngxjanusbbpkcdeuem-mtraaaaaaadyagcaylnbwefjfiwhlkxzyt mtraaaaaaadyagcaylnbwefjfiwhlkxzyu-niaaaaaamqmtnchcwhigpdmsazucrszvdb niaaaaaamqmtnchcwhigpdmsazucrszvdc-nwjcevvhmutscsqniokdufxkroxymgzaaa nwjcevvhmutscsqniokdufxkroxymgzaaa-oksdgzoksdgzoksdgzoksdgzoksdgzoksh oksdgzoksdgzoksdgzoksdgzoksdgzoksi-ozbejdhnxluhaabhlcxuvdfatyrziklvtv ozbejdhnxluhaabhlcxuvdfatyrziklvtw-pnkflharcuholuvjdvwynyaabjmfvzjyxn pnkflharcuholuvjdvwynyaabjmfvzjyxo-qbtgnktuicuvxmwzchbflvjseyarrdiqpr qbtgnktuicuvxmwzchbflvjseyarrdiqps-qqchpomxnlidjeypacedivahvrcqaaaaaa qqchpomxnlidjeypacedivahvrcqaaaaaa-relirsgastvkuxaezdjthqcvyppbgonlwp relirsgastvkuxaezdjthqcvyppbgonlwq-rsujtvzdycisgpbuxooafnmkvljgbhcwnb rsujtvzdycisgpbuxooafnmkvljgbhcwnc-shdkvzshdkvzshdkvzshdkvzshdkvzshdn shdkvzshdkvzshdkvzshdkvzshdkvzshdo-svmlydlkitjhdzfaukwobifopcxpqshrtz svmlydlkitjhdzfaukwobifopcxpqshrua-tjvnacjothflsugpqhyezmsbiabaabensx tjvnacjothflsugpqhyezmsbiabaabensy-tyeockxqtkjwbjigrhfbxcysiulzgdmnax tyeockxqtkjwbjigrhfbxcysiulzgdmnay-umnpeoqtysxdnbjwpsjivaihfqgeawbxrj umnpeoqtysxdnbjwpsjivaihfqgeawbxrk-vawqgsjxebkkytlmodnpsxrwcmaivorihv vawqgsjxebkkytlmodnpsxrwcmaivorihw-vpfriwdajjxsklncmorwqvbkzhunqhgsyh vpfriwdajjxsklncmorwqvbkzhunqhgsyi-wdoskzwdoskzwdoskzwdoskzwdoskzwdot wdoskzwdoskzwdoskzwdoskzwdoskzwdou-wrxtndpguayhhvqijlabeukemqvwvdoaaa wrxtndpguayhhvqijlabeukemqvwvdoaaa-xgguphijzjlotnryhwerknedpvdcaaaaud xgguphijzjlotnryhwerknedpvdcaaaaue-xupvrlbnerywfftoghiyiknsmqxgvdqjmd xupvrlbnerywfftoghiyiknsmqxgvdqjme-yiywtouqkamdqxveesnfghxhjmrlpwfucp yiywtouqkamdqxveesnfghxhjmrlpwfucq-yxhxvsntpizlcpwuddrmefgwgilqkovetb yxhxvsntpizlcpwuddrmefgwgilqkovetc-zlqyxwgwurmsohykbovtccqldefvfhkpjn zlqyxwgwurmsohykbovtccqldefvfhkpjo-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz Can anyone write the correct answer? Thank you Edited by author 19.03.2008 18:53 I don't understant what's wrong, here are the number of pieces each processor has: 34 49 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683277 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 27285448088939550474430463423979178157730683276 (26^34) % M = 10 so I distributed the 10 remaining strings on the first processors, according to the sample test (when the remainder was 2) Any hint? solved! 'bssejrqozpnkflharcuholuvjdvwynyaaa' on processor 5 and 6 is obviously wrong input: 34 49 output: a-niabcscehmgkraoxkdfwwinvutdtrojpm niabcscehmgkraoxkdfwwinvutdtrojpn-abrbdglfjpznwjcevvhmutscsqniokdufz abrbdglfjpznwjcevvhmutscsqniokduga-aqacfkeioymvibduugltsrbrpmhnjctewm aqacfkeioymvibduugltsrbrpmhnjctewn-bejdhnxluhacttfksrqaqolgmibsdvipmz bejdhnxluhacttfksrqaqolgmibsdvipna-bssejrqozpnkflharcuholuvjdvwynyadm bssejrqozpnkflharcuholuvjdvwynyadn-chbflvjseyarrdiqpnyomjekfzqbtgnktz chbflvjseyarrdiqpnyomjekfzqbtgnkua-cvkgnzcvkgnzcvkgnzcvkgnzcvkgnzcvkm cvkgnzcvkgnzcvkgnzcvkgnzcvkgnzcvkn-djthqcvyppbgonlwmkhcidxnzrelirsgaz djthqcvyppbgonlwmkhcidxnzrelirsgba-dycisgpbuxooafnmkvljgbhcwmyqdkhqrm dycisgpbuxooafnmkvljgbhcwmyqdkhqrn-emljukifagbvlxpcjgpqdyqrtisuycxbhz emljukifagbvlxpcjgpqdyqrtisuycxbia-faukwobifopcxpqshrtxbwagqemzsvmlyl faukwobifopcxpqshrtxbwagqemzsvmlym-fpdlyrulkxckjhsigcydztjvnahenobwox fpdlyrulkxckjhsigcydztjvnahenobwoy-gdmnavnoqfpruztyeockxqtkjwbjigrhfj gdmnavnoqfpruztyeockxqtkjwbjigrhfk-grvoczgrvoczgrvoczgrvoczgrvoczgrvv grvoczgrvoczgrvoczgrvoczgrvoczgrvw-hgepfczvawqgsjxebkkytlmodnpsxrwcmh hgepfczvawqgsjxebkkytlmodnpsxrwcmi-hunqhgsygfdoebytzvpfriwdajjxsklnct hunqhgsygfdoebytzvpfriwdajjxsklncu-iiwrjkmblnqvpuajygtmpgfrxfecndaxtf iiwrjkmblnqvpuajygtmpgfrxfecndaxtg-ixfslofeqwedbmbzwrxtndpguayhhvqijr ixfslofeqwedbmbzwrxtndpguayhhvqijs-jlotnryhwerknedpvdcalayvqwsmcoftad jlotnryhwerknedpvdcalayvqwsmcoftae-jzxupvrlbnerywfftoghiyiknsmqxgvdqp jzxupvrlbnerywfftoghiyiknsmqxgvdqq-kogvrzkogvrzkogvrzkogvrzkogvrzkohb kogvrzkogvrzkogvrzkogvrzkogvrzkohc-lcpwuddrmefgwgilqkovetbohkbamrzyxn lcpwuddrmefgwgilqkovetbohkbamrzyxo-lqyxwgwurmsohykbovtccqldefvfhkpjnz lqyxwgwurmsohykbovtccqldefvfhkpjoa-mfhyykpxwvfvtqlrngxjanusbbpkcdeuel mfhyykpxwvfvtqlrngxjanusbbpkcdeuem-mtraaojbcdtdfinhlsbpylegxxjowvueux mtraaojbcdtdfinhlsbpylegxxjowvueuy-niabcscehmgkraoxkdfwwinvutdtrojplj niabcscehmgkraoxkdfwwinvutdtrojplk-nwjcevvhmutscsqniokdufxkroxymgzabv nwjcevvhmutscsqniokdufxkroxymgzabw-oksdgzoksdgzoksdgzoksdgzoksdgzoksh oksdgzoksdgzoksdgzoksdgzoksdgzoksi-ozbejdhnxluhacttfksrqaqolgmibsdvit ozbejdhnxluhacttfksrqaqolgmibsdviu-pnkflharcuholuvjdvwynyadicgmwktfzf pnkflharcuholuvjdvwynyadicgmwktfzg-qbtgnktuicuvxmwzchbflvjseyarrdiqpr qbtgnktuicuvxmwzchbflvjseyarrdiqps-qqchpomxnlidjeypasfmjsthbtuwlvybgd qqchpomxnlidjeypasfmjsthbtuwlvybge-relirsgastvkuxaezdjthqcvyppbgonlwp relirsgastvkuxaezdjthqcvyppbgonlwq-rsujtvzdycisgpbuxooafnmkvljgbhcwnb rsujtvzdycisgpbuxooafnmkvljgbhcwnc-shdkvzshdkvzshdkvzshdkvzshdkvzshdn shdkvzshdkvzshdkvzshdkvzshdkvzshdo-svmlydlkitjhdzfaukwobifopcxpqshrtz svmlydlkitjhdzfaukwobifopcxpqshrua-tjvnahenobwoprgqswauzfpdlyrulkxckl tjvnahenobwoprgqswauzfpdlyrulkxckm-tyeockxqtkjwbjigrhfbxcysiulzgdmnax tyeockxqtkjwbjigrhfbxcysiulzgdmnay-umnpeoqtysxdnbjwpsjivaihfqgeawbxrj umnpeoqtysxdnbjwpsjivaihfqgeawbxrk-vawqgsjxebkkytlmodnpsxrwcmaivorihv vawqgsjxebkkytlmodnpsxrwcmaivorihw-vpfriwdajjxsklncmorwqvbkzhunqhgsyh vpfriwdajjxsklncmorwqvbkzhunqhgsyi-wdoskzwdoskzwdoskzwdoskzwdoskzwdot wdoskzwdoskzwdoskzwdoskzwdoskzwdou-wrxtndpguayhhvqijlakmpuoszixfsloff wrxtndpguayhhvqijlakmpuoszixfslofg-xgguphijzjlotnryhwerknedpvdcalayvr xgguphijzjlotnryhwerknedpvdcalayvs-xupvrlbnerywfftoghiyiknsmqxgvdqjmd xupvrlbnerywfftoghiyiknsmqxgvdqjme-yiywtouqkamdqxveesnfghxhjmrlpwfucp yiywtouqkamdqxveesnfghxhjmrlpwfucq-yxhxvsntpizlcpwuddrmefgwgilqkovetb yxhxvsntpizlcpwuddrmefgwgilqkovetc-zlqyxwgwurmsohykbovtccqldefvfhkpjn zlqyxwgwurmsohykbovtccqldefvfhkpjo-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz Thanks for the test :) I solved it using base-26 long arithmetics, but forgot to prepend leading zeroes (leading 'a'), so could output "brg" instead of "aabrg" Calculate powers of 26 and prefix sums of powers of 26. Calculate ranges by integer division. Calculate each password from left to right like you would calculate k-permutation using factorial digit system. Base-26 arithmetics simplifies things a lot here :) It's not clear if black player can continue movement or not after eating white bishop. Bishop moves first, so if at first pawn can capture bishop it does not matter. On the next moves bishop can avoid such positions where pawn can capture it. Just according to problem statement it's white wins :), so looks weird Please, check 142 test, C++ fread failed for this test case. scanf accepted. After fread I can try trim space symbols (ASCII code <= 32) from start and end, any more WA142. Any hint for solving this problem? number of possible operations is only 1m > number of possible operations is only 1m Hah! Somehow reading this here (even though it's clear in the problem statement) made me see the way...thanks. memcpy (for c++) and million.., and not any more ;p Try this test: 2 abc b 1 abc Correct answer: 1 1 3 5 1 4 5 7 3 8 2 4 4 7 5 3 7 7 0 3 5 2 5 1 5 3 4 3 8 8 8 6 0 6 6 1 I got tle on these tests.But I got AC. My AC solution outputs "NO" on both of those test cases. Answer to second test is YES. And, moreover, there are 840 ways to fill the square. Upd. Sorry, forgot about constraint a[0][0]=0. (But, if ignore it, 840 is correct number.) Edited by author 09.07.2026 19:19 O(N) for RAM and CPU, don't know why memory limit is that high. Based on classics for tree diameter. Doesn't matter, could be -1000 What is the maximum number of divisions needed to get the full period? I got TLE this O(n^2) algo there n is the number of divisions. O(n*lg n) from number of divisions also TLE. But why...? O(n) AC in 0.234 O(n^2) memorization of prev remainders in vector with linear search O(n*lg n) memorization of prev remainders in set O(n) just used bitset<10000> cause all remainders is less then 10000 But why O(n*lg n) TLE!?!?!? just remember position for each remainder, once stepped over again - period detected. O(b) memory, O(b) runtime You can solve that with algo Djikstra. We have 6!*8*8 vertex (hash of cube and point) . And all vertexs have <=4 edges. P.s. sry for English ) Edited by author 09.08.2014 16:51 there are only 24 orientations just use DSU to check teams, and then build answer why dsu? just bfs on revival links. if component >4 - FAKE. then fill up 3+1, 2+2, 2+1+1, 1+1+1+1 The first day has no delay flight from the day before. 2 1 60 100 23:00 He can departure from 24:00 , not 00:00 Thanks, but with this change just for the 1st flight it gets WA13 :) The right solution is to get yesterday flights only when current time spent is >= 1440. Problem statement lacks "from this moment" phrase which exists in russian version. Edited by author 08.07.2026 23:57 O(W*H) solution passes Edited by author 22.08.2021 13:50 Edited by author 22.08.2021 13:50 I did it O(N^3) way, but can be done O(N^2*log(N)) Edited by author 08.07.2026 23:43 In my programme, I use 1000 000 random locations to check if the points are in the circle. At first, I wrote something like this: "double tx = ( double )( rand() % 101 ) / 100.0 ";(because: 0 ≤ x ≤ 1, -> rand() % 101 ∈[ 0, 100 ] );and just got WA...... Finally I changed the 101 into 100 and got AC; Can anyone tell me why 101 is incorrect? or it is actually right? You're just lucky that in the second case you got AC - actually good tests will kill your second solution as well, because what you generate is random point on integer grid 100 x 100 and this is far from random real point. Good way of generating random point in unit square is doing double(rand()) / RAND_MAX for both coordinates - this will give you point close enough to truly random. Thanks for your reply, I realize I have mixed up continuity and dispersion. :-) This contradicts the condition of the task. It is ALWAYS required to have the correct answer. Use regular points. WA8: 6 aabcaa ans: 6 RE9: 7 aaaaaaa ans: 7 Did use suffix automaton? Or give me any hint please. why I get wa on test 23? this problem ROCKS >D Try it: 8 3 3 2 4 5 8 1 6 Answer: 6 What is the answer for the test: 10 5 2 2 8 4 6 ? Mine is 4. Am I correct? Or is the answer 6 or 10? L.E.: Nevermind I ACed. Answer is 4. Edited by author 22.09.2010 20:24 Edited by author 24.09.2010 01:45 I had RE23 because of this vector<int> l(n), r(n); // should be 'k' |
|
|