Common BoardShow all threads Hide all threads Show all messages Hide all messages | Delete account | lareon | | 27 Jan 2020 11:24 | 1 | Please, delete my account. I don't need it anymore. | Delete account | OnlyNoiseOnWires | | 27 Jan 2020 11:23 | 1 | Please, delete my account. I don't need it anymore. | solved! | Shams Ivon | 1404. Easy to Hack! | 27 Jan 2020 01:15 | 1 | solved! Shams Ivon 27 Jan 2020 01:15 but I couldn't find any way to delete the post Edited by author 27.01.2020 01:24 Edited by author 27.01.2020 01:24 Edited by author 27.01.2020 01:24 | WA #3. I'm out of tests | Timofey | 1750. Pakhom and the Gully | 26 Jan 2020 20:14 | 1 | I've passed all the tests the forum had. Can someone give me more | For those at whom the wrong answer to the 12th test. | vin | 1021. Sacrament of the Sum | 24 Jan 2020 20:01 | 2 | Try the following 2 tests: 2 0 10000 2 20000 10000 and 2 0 10000 2 0 -10000 What answer is issued by your program? Edited by author 14.02.2013 20:37 YES, YES and look like its right? | Solution | Roland | 1725. Sold Out! | 23 Jan 2020 16:02 | 13 | Very easy:) *first if k>n/2 make it smaller n/2: k=n-k+1 *then the answer is (n-k-2)
(......[Vasya].......[n-1][n] if [n-1] and [n] sit,then all people between [Vasya] and [n-1] will stumble at Vasya. And this will be the maximal answer ) *special case: n=2 => answer is 0 i dnt understand ur soln. why it be so?? the prog sttmnt says visitor chooses left || right end based on minimal no. of people s/he need to stumble upon. so let be test: 10 3 ur soln gives: 5 let last 2 and 1st 2 beseated. now why rest people should choose left end. prog sttmnt says it shd be right end. because only 2 need to be stumbled upon if right else 3. bt ur soln gives ac. so i thnk the prog sttmnt is all wrong || i am weak in english || the author is!!! Edited by author 29.11.2009 17:00 Roland is right example: 6 (1 Man, 2 Man, 3 empty, 4 empty, 5 empty, 6 You); answer - 3 Can you explain how do you get answer 3 for test 6,1? My solution: Veeeee Veeee1 V2eee1 V2ee31 V24e31 V24531, Where V - Vasya, e - empty place, 1,2,3... - visitors. Numbers 2 and 4 will stumble Vasyas feet, so my answer is 2. Veeeee Veeee1 Veee21 Vee321 Ve4321 V54321 The worst case. Answer - 3. Why 3? i think it have to be 4. Like Veeee1 - 0, Veee21 - 1, Vee321 - 2, Ve4321 - 3, V54321 - 4. The first case has the same problem tho Nvm, i get it. (the last sentence in first paragraph) Edited by author 23.01.2020 16:05 I think is 2 (1 man, 2 man ,3 empty, 4 man,5 man, 6 you) ,the 3man may from left Edited by author 11.09.2016 19:43 Edited by author 11.09.2016 19:43 I don`t understand why it works. Example: 10 4 ###[Vasya]###### At worst viewers with the numbers 1, 2 will come first: [1][2]#[Vasya]###### and viewer 3 stumbles over Vasya`s feets. Next come viewers with the numbers 9 and 10: [1][2][3][Vasya]####[9][10] and viewers 5, 6, 7, 8 stumble over feets. So the answer is 5, but your program (AC program!) gives 4... Edited by author 08.12.2010 14:45 Next come viewers with the numbers 9 and 10: [1][2][3][Vasya]####[9][10] and viewers 5, 6, 7, 8 stumble over feets. You should consider only those viewers who stumble Vasya's feet. Write order for this test. ###[Vasya]###### ###[Vasya]#####[1] ###[Vasya]####[2][1] ###[Vasya]###[3!][2][1] ###[Vasya]##[4!][3!][2][1] ###[Vasya]#[5!][4!][3!][2][1] ###[Vasya][6!][5!][4!][3!][2][1] Edited by author 14.12.2010 09:37 Edited by author 30.08.2011 05:38 | Test 10 hint | Yan_Olerinskiy | 1131. Copying | 23 Jan 2020 02:30 | 1 | | W21 - test case | android_ | 1917. Titan Ruins: Deadly Accuracy | 22 Jan 2020 23:16 | 4 | Hello My solution failed on test 21. Passed next cases: 5 5 2 2 2 3 4 0 0 5 4 4 1 4 1 2 3 2 5 4 2 2 1 1 1 5 2 5 7 4 1 4 1 2 3 1 10 18 2 2 2 2 2 2 2 2 2 2 0 0 If you have any idea please let me know. Thank you Edited by author 21.08.2015 10:49 5 8 2 2 2 1 2 5 2 Edited by author 24.08.2019 14:48 I passed all those tests, but have WA2 :D | WA #4;can anyone help? | jim | 1925. British Scientists Save the World | 21 Jan 2020 23:10 | 2 | #include <iostream> using namespace std; int main() { int n, k; int i; int show, type; int showTotal = 0, typeTotal = 0; int neededType; cin >> n >> k; for ( i = 1; i <= n; i++) { cin >> show >> type; if (show - type == 2) showTotal = typeTotal = 0; else { showTotal += show; typeTotal += type + 2; } } neededType = k + showTotal - typeTotal - 2; if (neededType > 0 && neededType < 101) cout << neededType << endl; else { cout << "Big Bang!" << endl; } return 0; } maybe problem in this neededType > 0 || neededType < 101 UPD: result must be only bigger than zero! i have AC) Edited by author 21.01.2020 23:21 | Why my code doesn't work?Sequence is wrong,but only'16 3'and'20 3'. Even the '22 4' and '26 4' are right. | jingyi Ma | 1100. Final Standings | 21 Jan 2020 17:21 | 2 | #include <iostream> using namespace std; int main() { int n,a[100],b[100],c,d,i,j; cin>>n; for(i=0;i<n;i++) cin>>a[i]>>b[i]; for(i=0;i<n;i++) for(j=i+1;j<n;j++) if(b[i]<b[j]) { c=b[i]; b[i]=b[j]; b[j]=c; d=a[i]; a[i]=a[j]; a[j]=d; } for(i=0;i<n;i++) cout<<a[i]<<' '<<b[i]<<'\n'; return 0; } Help me! I'm die. Sorrry,my English is poor. I will try my best to understand you. Sort declared in the task is stable. Your sort isn't stable Let we have scores: ("team1", 10), ("team2", 10), ("team3", 15). Your code when i=0, j=2 swaps team1, team3: ("team3", 15). ("team2", 10), ("team1", 10). Note: when you fix your sort you'll face the fact real bubble sort is too slow. | If you have WA 3 | Smilodon_am [Obninsk INPE] | 1297. Palindrome | 21 Jan 2020 12:40 | 2 | Try this simple test: 11123 Answer: 111 | WA 7 | Kostuan1989 | 2002. Test Task | 20 Jan 2020 11:08 | 1 | WA 7 Kostuan1989 20 Jan 2020 11:08 Please help with wrong answer 7. Possible input? | why i get Output limit exceeded on test 1 | rana hossain | 1001. Reverse Root | 18 Jan 2020 18:48 | 1 | #include<stdio.h> #include<math.h> int main() { unsigned long long int a[1000],i=0,b,c; double s; while(scanf("%llu",&b)!=EOF) { a[i]=b; i++; c=i; } for(i=c;i>=0;i--) { s=sqrt(a[i]); printf("%.4lf\n",s); } return 0; } | Метод отжига TL 16 | Toshpulatov (MSU Tashkent) | 1512. Zinium | 18 Jan 2020 18:21 | 1 | Использую метод отжига и у меня ТЛ 16 тест, в кф проверил что у меня на макс тесте работает не более 2с. Возник вопрос, админы специально поставили такое ограничение чтобы метод отжига не проходил ? | solution C++ | Der1cle | 2005. Taxi for Programmers | 17 Jan 2020 16:48 | 1 | #include <iostream> #include <string> #include <vector> #include <set> #include <map> #include <cmath> #include <deque> #include <queue> #include <algorithm> #include <iterator> #include <bitset> #include <iomanip> #include <functional> #include <list> #include <cctype> #include <array> #include <algorithm> using namespace std; int main() { int n; n = 5; vector<vector<int>> vec(n); for (int i = 0; i < n; ++i) { vec[i].resize(n); for (int j = 0; j < n; j++) { cin >> vec[i][j]; } } cout << min(min(min(vec[0][0] + vec[1][0] + vec[2][1] + vec[2][3] + vec[3][4], vec[0][0] + vec[3][0] + vec[2][3] + vec[1][2] + vec[1][4]), vec[0][0] + vec[0][2] + vec[1][2] + vec[1][3] + vec[3][4]), vec[0][0] + vec[0][2] + vec[2][3] + vec[1][3] + vec[1][4]) << endl; if (min(min(min(vec[0][0] + vec[1][0] + vec[2][1] + vec[2][3] + vec[3][4], vec[0][0] + vec[3][0] + vec[2][3] + vec[1][2] + vec[1][4]), vec[0][0] + vec[0][2] + vec[1][2] + vec[1][3] + vec[3][4]), vec[0][0] + vec[0][2] + vec[2][3] + vec[1][3] + vec[1][4]) == vec[0][0] + vec[1][0] + vec[2][1] + vec[2][3] + vec[3][4]) { cout << "1 2 3 4 5"; } else if(min(min(min(vec[0][0] + vec[1][0] + vec[2][1] + vec[2][3] + vec[3][4], vec[0][0] + vec[3][0] + vec[2][3] + vec[1][2] + vec[1][4]), vec[0][0] + vec[0][2] + vec[1][2] + vec[1][3] + vec[3][4]), vec[0][0] + vec[0][2] + vec[2][3] + vec[1][3] + vec[1][4]) == vec[0][0] + vec[3][0] + vec[2][3] + vec[1][2] + vec[1][4]) { cout << "1 4 3 2 5"; } else if (min(min(min(vec[0][0] + vec[1][0] + vec[2][1] + vec[2][3] + vec[3][4], vec[0][0] + vec[3][0] + vec[2][3] + vec[1][2] + vec[1][4]), vec[0][0] + vec[0][2] + vec[1][2] + vec[1][3] + vec[3][4]), vec[0][0] + vec[0][2] + vec[2][3] + vec[1][3] + vec[1][4]) == vec[0][0] + vec[0][2] + vec[1][2] + vec[1][3] + vec[3][4]) { cout << "1 3 2 4 5"; } else { cout << "1 3 4 2 5"; } cout << endl; } | WA5 What is wrong? help pls. | Dmitry_Terenichev | 1131. Copying | 16 Jan 2020 21:13 | 2 | var n,k,ch,im:int64; begin read(n,k); n:=n-1; ch:=0; im:=1; while n>0 do begin if im<=k then begin n:=n-im; im:=im*2; ch:=ch+1; end; if im>k then begin n:=n-k; im:=im+k; ch:=ch+1; end; end; writeln(ch); end. well, i've also had WA 5, i tried to enter 4 2 and got 3 instead of 2. i found the mistake but then i got WA 14. i tried 6 4 and got 4 instead of 3 and understood that i had corrected the code wrong and only then i got AC. Edited by author 16.01.2020 21:20 Edited by author 16.01.2020 21:20 | If you have WA #14 | Insectophob | 1272. Non-Yekaterinburg Subway | 16 Jan 2020 17:10 | 2 | I hope these tests will be useful for you :) 4 5 0 3 4 1 2 3 1 2 4 and 7 7 0 1 2 1 3 2 4 2 5 3 6 3 7 4 7 The output must be 0 in both cases, but if you've done something wrong, it can be -1. Make sure your determination of connected components isn't wrong. you gave the wrong 1 test here's the correct 4 4 0 3 4 1 2 3 1 2 4 answer : 0 | This should be enough to get AC without thinking | Gilles Deleuze | 1459. Archer's Travel | 16 Jan 2020 16:28 | 1 | vector<vector<int64_t>> sequence = { {1,1,1,1,1,1,1,1,1,1,1,1}, {1,0,2,0,4,0,8,0,16,0,32,0}, {1,2,6,14,37,92,236,596,1517,3846,9770,24794}, // next is 62953 {1,0,14,0,154,0,1696,0,18684,0,205832,0}, // next is 2267544 }; The solution is a linear recurrence. Output is multiplied by 2. Edited by author 16.01.2020 16:32 | WA32 | АРТЕМ | 1877. Bicycle Codes | 15 Jan 2020 02:50 | 1 | WA32 АРТЕМ 15 Jan 2020 02:50 I wrote a stupid solution and got wa32. Help please! | If blossom's writer gets WA12 ... | Mickkie | 1099. Work Scheduling | 13 Jan 2020 22:19 | 2 | In my case this test may help you 16 19 1 2 2 3 3 4 4 5 5 1 1 6 6 7 7 8 8 9 9 10 10 6 5 11 11 12 12 13 13 4 3 14 14 15 15 16 16 2 The sequence of contraction affects the solution if you do not repeat the process after release the blossom. if you contract (6,7,8,9,10), (4,5,11,12,13), (2,3,14,15,16) first you get maximum matching. but if you contract (1,2,3,4,5) first and don't repeat the process after release it you don't get to the maximum. Hope this helps. Thank you for this case! I didn't realize that the blossoms should be reset in each iteration. |
|
|