Common Board| Show all threads Hide all threads Show all messages Hide all messages | | runtime error | abir_10t | 1086. Cryptography | 11 Aug 2016 01:43 | 1 | #include<stdio.h> #include<math.h> int main() { long long int i,n,arr[100000]={0},j,t,a,sum,x; arr[0]=1; arr[1]=1; for(i=2; i<=sqrt(30000); i++) { if(arr[i]==0) { for(j=i+i; j<=30000; j=j+i) { if(arr[j]==0) arr[j]=1; } } } scanf("%lld",&t); for(i=1; i<=t; i++) { sum=0; scanf("%lld",&a); for(j=2; j<=a; j++) { if(arr[j]==0) { sum=sum+j; } } x=sum; if(sum==n) { for(sum=x+1; ; sum++) { if(arr[sum]==0) { x=x+sum; break; } } printf("%lld\n",sum); } else if(sum%2==0) { for(sum=x+1; ; sum++) { if(arr[sum]==0) { x=x+sum; break; } } printf("%lld\n",sum); } else printf("%lld\n",sum); } return 0; } | | What's the correct answer for the input a1 h1 0 0 10 0 0 10 ? | Igor Dex | 1016. Cube on the Walk | 10 Aug 2016 22:47 | 8 | i think the answer is : 0 a1 b1 b2 a2 a1 b1 c1 d1 e1 f1 g1 h1 i think you are wrong. My program tell that the minimal path is 20! My solution got AC. And it's answer for this input is: 0 a1 a2 b2 c2 c1 b1 b2 c2 d2 d1 c1 c2 d2 e2 e1 d1 d2 e2 f2 f1 e1 e2 f2 g2 g1 f1 f2 g2 h2 h1 i got ac, my answer is 0 a1 a2 b2 b1 a1 a2 a3 b3 b2 a2 a3 a4 b4 b3 a3 a4 a5 b5 b4 a4 a5 a6 b6 b5 a5 a6 a7 b7 b6 a6 a7 b7 b8 a8 a7 b7 b8 a8 a7 b7 c7 c8 b8 b7 c7 d7 d8 c8 c7 d7 e7 e8 d8 d7 e7 f7 f8 e8 e7 f7 g7 g8 f8 f7 g7 h7 h8 g8 g7 h7 h8 g8 g7 g6 h6 h7 g7 g6 g5 h5 h6 g6 g5 g4 h4 h5 g5 g4 g3 h3 h4 g4 g3 g2 h2 h3 g3 g2 g1 h1 my answer is: 0 a1 a2 b2 c2 c1 b1 b2 c2 d2 d1 c1 c2 d2 e2 e1 d1 d2 e2 f2 f1 e1 e2 f2 g2 g1 f1 f2 g2 h2 h1 g1 g2 h2 h1 my ac answer is : 0 a1 a2 b2 c2 c1 b1 b2 c2 d2 d1 c1 c2 d2 e2 e1 d1 d2 e2 f2 f1 e1 e2 f2 g2 g1 f1 f2 g2 h2 h1 g1 g2 h2 h1 I got you all beat, my answer is: 0 a1 b1 b2 a2 a1 b1 b2 b3 a3 a2 b2 b3 b4 a4 a3 b3 b4 b5 a5 a4 b4 b5 b6 a6 a5 b5 b6 b7 a7 a6 b6 b7 b8 a8 a7 b7 b8 a8 a7 b7 c7 c8 b8 b7 c7 d7 d8 c8 c7 d7 e7 e8 d8 d7 e7 f7 f8 e8 e7 f7 g7 g8 f8 f7 g7 h7 h8 g8 g7 h7 h8 g8 g7 h7 h8 g8 f8 f7 g7 g8 f8 e8 e7 f7 f8 e8 d8 d7 e7 e8 d8 c8 c7 d7 d8 c8 b8 b7 c7 c8 b8 a8 a7 a6 b6 b7 c7 c6 b6 b7 c7 d7 d6 c6 c7 d7 e7 e6 d6 d7 e7 f7 f6 e6 e7 f7 g7 g6 f6 f7 g7 h7 h6 g6 g5 h5 h6 g6 g5 h5 h6 g6 f6 f5 g5 g6 f6 e6 e5 f5 f6 e6 d6 d5 e5 e6 d6 c6 c5 d5 d6 c6 b6 b5 c5 c6 b6 a6 a5 a4 b4 b5 c5 c4 b4 b5 c5 d5 d4 c4 c5 d5 e5 e4 d4 d5 e5 f5 f4 e4 e5 f5 g5 g4 f4 f5 g5 h5 h4 g4 g3 h3 h4 g4 g3 h3 h4 g4 f4 f3 g3 g4 f4 e4 e3 f3 f4 e4 d4 d3 e3 e4 d4 c4 c3 d3 d4 c4 b4 b3 c3 c4 b4 a4 a3 a2 b2 b3 c3 c2 b2 b3 c3 d3 d2 c2 c3 d3 e3 e2 d2 d3 e3 f3 f2 e2 e3 f3 g3 g2 f2 f3 g3 h3 h2 g2 g1 h1 h2 g2 g1 h1 h2 g2 g1 h1 | | Got my AC with C++ solution, the same Python3 solution gets TL2 | renat-nasyrov | 1167. Bicolored Horses | 10 Aug 2016 20:31 | 2 | Dear admins (if any), I've encountered the subject. Please give me some hints how to speed up my Python solution, because I've tried all the performance tricks I know and I still get TL2. You can post some details about your solution, for example the complexity your program has. A solution with N^3 complexity should fit in time (with c++). Also post the core function (loops) of your code, maybe you have some mistakes and enter some endless loop. | | WA on test case 1......please please help | sarvin | 1100. Final Standings | 9 Aug 2016 17:45 | 3 | following is my solution in C.I have used qsort() function of library stdlib.I have checked it on all test cases but still I am not able to figure out which test case is getting wrong..please help...i have really spend a lot of time on this. #include<stdio.h> #include<stdlib.h> struct TwoInt { long int a; int b; }; typedef struct TwoInt Int; Int arr[200000]; int cmpfnc(const void* a,const void* b) { const int p=((const Int*)a)->b; const int q=((const Int*)b)->b; if(p>q) return q-p; else { if(p<q) return q-p; } return 0; } int main() { long int n; scanf("%ld",&n); long int i=0; for(i=0;i<n;i++) scanf("%ld %d",&(arr[i].a),&(arr[i].b)); qsort(arr,n,sizeof(Int),cmpfnc); for(i=0;i<n;i++) printf("%ld %d\n",arr[i].a,arr[i].b); return 0; } Is C qsort() stable? P.S. Oops. Answer to necro-post... Edited by author 09.08.2016 17:46 | | Runtime Error (Python) | JuliM | 1837. Isenbaev's Number | 9 Aug 2016 16:37 | 1 | Test 3 is RTE What can I optimise? n=int(input()) dic={} for i in range(n): team=input().split() for x in team: if x in dic: dic[x].extend((y for y in team if y!=x and y not in dic[x])) else: dic[x]=[y for y in team if y!=x] names=sorted(dic.keys()) s='Isenbaev' level = { s: 0 } k = 1 frontier = [s] while frontier: next = [] for u in frontier: for v in dic[u]: if v not in level: level[v] = k next.append(v) frontier = next k += 1 print('\n'.join((x+' '+str(level.get(x, 'undefined')) for x in names))) Edited by author 09.08.2016 16:37 | | What is right answer for test? | __Andrewy__ | 1871. Seismic Waves | 9 Aug 2016 12:11 | 5 | Who can give right answer on test? 11 0000000000000000000000000 2 444444444444444444444444 777777 2 0 11111111111111111111111 3 55 777777 8888 22222222 3 11111111111111111111111 444444444444444444444444 8888 3333 1 444444444444444444444444 444444444444444444444444 3 2 55 8888 55 3 3333 444444444444444444444444 6 6 2 22222222 444444444444444444444444 777777 3 444444444444444444444444 6 55 8888 3 11111111111111111111111 22222222 777777 999999999999999999999999 2 444444444444444444444444 55 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX My prog print: 10 0000000000000000000000000 444444444444444444444444 777777 11111111111111111111111 55 8888 22222222 3333 6 999999999999999999999999 0000000000000000000000000: 444444444444444444444444: from 0000000000000000000000000 777777: from 0000000000000000000000000 11111111111111111111111: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 55: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 8888: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 6: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 22222222: from 6 3333: from 6 999999999999999999999999: from 55 (RT @777777: RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) Edited by author 07.08.2016 20:51 Mine gives 10 0000000000000000000000000 2 11111111111111111111111 22222222 3333 444444444444444444444444 55 6 777777 8888 Why you not print 999999999999999999999999? 777777 retwitt 0000000000000000000000000, 55 retwit 777777: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (len=128<140). And what your answers on these tests? 1) 4 JaneSoboleva 2 FelixMate Try FelixMate 1 JaneSoboleva Try 0 SumSu 1 FelixMate Why Jane Soboleva not solve problems on Timus Online? Her count of problems is 784. It's not beautiful number! She must solve for >=800 problems!!! 2) 4 JaneSoboleva 2 FelixMate Try FelixMate 1 SumSu Try 0 SumSu 0 Why Jane Soboleva not solve problems on Timus Online now?Her count of problems is 784.She must solve minimum 16 problems! Gimme some break... 1) 0 (upd: should be 1 i guess, but anyway this test is incorrect since the text length > 140) 2) 4 JaneSoboleva FelixMate Try SumSu As of your first question, i solved this one a bit too long ago... i'll look into it and update this post later. Also, this thread helped me when i had WA2 http://acm.timus.ru/forum/thread.aspx?id=27267&upd=634549324304261511 — if the user has read the tweet, but can't retweet it, he still counts towards the people who know. Maybe that'll help you. UPD: okay, i get it. Your 999..9 user is not in anyone's followers list, so he shouldn't retweet the message from anyone. 444..4 and 55 can repost 999..9 if he posts something, but he never will, cause he's not a follower of anyone. Also, retweets. 10 0000000000000000000000000 --- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2 --- RT @444444444444444444444444: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 11111111111111111111111 --- RT @22222222: RT @6: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 22222222 --- RT @6: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 3333 --- RT @55: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 444444444444444444444444 --- RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 55 --- RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 6 --- RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 777777 --- RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 8888 --- RT @444444444444444444444444: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 999999999999999999999999 --- [nothing] Some of those retweets (third one only, in fact) exceed 140 symbols, but this is just debug output. Those messages don't get retweeted and don't participate in further retweeting. Still, that user has read the tweet, and so he acknowledges its existance. Edited by author 08.08.2016 21:43Thanks! I read bad problem! I thought that graph not directed. | | How did you manage to configure Java in such a weird way? | Alexey Dergunov [Samara SAU] | | 8 Aug 2016 16:01 | 1 | import java.util.Scanner; public class Sum { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); System.err.println(a + b); // !!! } } Guess the verdict. Edited by author 08.08.2016 16:02 | | Rust | PAVEL | | 7 Aug 2016 11:46 | 1 | Rust PAVEL 7 Aug 2016 11:46 Кто-нибудь пишет на Rust? | | No subject | PAVEL | | 7 Aug 2016 11:45 | 1 | | | Para el honorable Jesús Saucedo | frankzappa | 1018. Binary Apple Tree | 7 Aug 2016 11:25 | 1 | Cámara Chuy tienes que alcanzarme, este problema está bien bueno! | | TO ADMIN: the tests are weak. | zimpha | 2057. Non-palidromic cutting | 6 Aug 2016 15:38 | 1 | My brute force solution pass the tests, the run id is 6945666. Maybe you can add more strong tests. | | can't go past test # 3 | nushrat | 1083. Factorials!!! | 6 Aug 2016 07:38 | 1 | Am I making it too complicated ? can anyone tell me what's wrong with the logic ? 9 !! works ok ............. #include "stdafx.h" #include <iostream> #include <string> using namespace std; int main() { int n; string marks; int output = 1; cin >> n >> marks; int k= marks.length(); int until = n / k; if (n % k != 0) { for (int i = 0; i <= until; i++) { output *= (n - i * k); } output *= (n % k); } else if (n % k == 0) { for (int i = 0; i < k; i++) { output *= (n - i * k); } output *= k; } cout << output << endl; return 0; } Edited by author 06.08.2016 07:38 | | WA#2. What's wrong? Please help! | prime | 1197. Lonesome Knight | 5 Aug 2016 23:07 | 3 | #include <stdio.h> #include <iostream> using namespace std; int main() { int n, m, i; char l, dt; cin>>n; for(i=0;i<n;i++){
cin>>l>>dt; if(l=='a' && dt=='1' ||l=='a' && dt=='8' ||l=='h' && dt=='1' ||l=='h' && dt=='8') { m=2; cout<<m<<endl; } if(l=='a' && dt=='2' ||l=='a' && dt=='7' ||l=='b' && dt=='1' ||l=='b' && dt=='8' ||l=='g' && dt=='1'||l=='g' && dt=='8'||l=='h' && dt=='2'||l=='h' && dt=='7') { m=3; cout<<m<<endl; } if(l=='a' && dt=='3' ||l=='a' && dt=='4' ||l=='a' && dt=='5' ||l=='a' && dt=='6' ||l=='b' && dt=='2'||l=='b' && dt=='7'||l=='c' && dt=='1'||l=='d' && dt=='1'||l=='e' && dt=='1'||l=='f' && dt=='1'||l=='c' && dt=='8'||l=='d' && dt=='8'||l=='e' && dt==8||l=='f' && dt=='8'||l=='g' && dt=='7'||l=='g' && dt=='2'||l=='h' && dt=='3'||l=='h' && dt=='4'||l=='h' && dt=='5'||l=='h' && dt=='6') { m=4; cout<<m<<endl; } if(l=='b' && dt=='3' ||l=='b' && dt=='4' ||l=='b' && dt=='5' ||l=='b' && dt=='6' ||l=='c' && dt=='2' ||l=='d' && dt=='2' ||l=='e' && dt=='2' ||l=='f' && dt=='2' ||l=='c' && dt=='7' ||l=='d' && dt=='7'||l=='e' && dt=='7'||l=='f' && dt=='7'||l=='g' && dt=='3'||l=='g' && dt=='4'||l=='g' && dt=='5'||l=='g' && dt=='6') { m=6; cout<<m<<endl; } if(l=='c' && dt=='3' ||l=='c' && dt=='4' ||l=='c'&& dt=='5' ||l=='c' && dt=='6' ||l=='d' && dt=='3' ||l=='d' && dt=='4' ||l=='d' && dt=='5' ||l=='d' && dt=='6' ||l=='e' && dt=='3' ||l=='e' && dt=='4' ||l=='e' && dt=='5' ||l=='e' && dt=='6' ||l=='f' && dt=='3' ||l=='f' && dt=='4' ||l=='f' && dt=='5' ||l=='f' && dt=='6') { m=8; cout<<m<<endl; } } return 0; } I checked all values but something is wrong... That works on my IDE... Sorry, i am noob but this solution must work fine! This is bad, you shouldn't code this way. What if chessboard was 1000x1000 instead of 8x8? Check out this link http://acm.timus.ru/forum/thread.aspx?id=32538&upd=635922147004042008A test_horse function from there is more universal and it can check the amount of moves from any given x and y. You should use something like that instead. Otherwise it's very hard to tell where the error is. this cod is very hard to check. I make the folowing program for(l='a'; l<='h';l++){ for(dt='1';dt<='8';dt++){ ____________________________ this is your cod only replace cout<<m<<endl; with this one cout<<m<<' '; _____________________________ } cout<<endl; } and compare your answer 2,3,4,4,4,4,3,2, 3,4,6,6,6,6,4,3, 4,6,8,8,8,8,6,4, 4,6,8,8,8,8,6,4, 4,6,8,8,8,8,6, 4,6,8,8,8,8,6,4 3,4,6,6,6,6,4,3, 2,3,4,4,4,4,3,2 with the write answer 2,3,4,4,4,4,3,2, 3,4,6,6,6,6,4,3, 4,6,8,8,8,8,6,4, 4,6,8,8,8,8,6,4, 4,6,8,8,8,8,6,4, 4,6,8,8,8,8,6,4, 3,4,6,6,6,6,4,3, 2,3,4,4,4,4,3,2 It is evident that you miss one case e8. I add this case in the branch where m=4,and AC. And even if chessboard was 1000x1000 the best solution is precalc. Good luck.
Edited by author 05.08.2016 23:08 Edited by author 05.08.2016 23:11 Edited by author 05.08.2016 23:14 Edited by author 05.08.2016 23:19 | | WA 22 | SHAHIN2125 | 2095. Scrum | 5 Aug 2016 12:15 | 1 | WA 22 SHAHIN2125 5 Aug 2016 12:15 Please help!!! Getting WA 22 | | TO ADMIN (Problem 1456) | cash | 1456. Jedi Riddle 2 | 4 Aug 2016 14:54 | 5 | I have "Time Limit" in test #4. Can you help me. [code deleted] Edited by moderator 01.06.2006 16:14 Of course you got TLE... you algo is O(n)and certainly will get TLE Real Help! First of all we must diminish number of candidate to optimal. MathHelp:if (A^k)%N==1 => fi(N)%k==0 where fi(N)-Eiler function of N Try find in Internet effective algorith for fi(N). we can see that number of candidates diminished from 1000000000 to 2*sqrt(1000000000)~64000 Also if Nod(A,N)>0 print 0. Final trick is using divide recursion when calculating (A^K)%N=>O(log K)-time and don't forget use __int64 when form A*B Edited by author 17.08.2007 02:26 Good point svr! :) But number of ways diminishes to amount of divisors of phi(N) which is way less than 64000, and it's enough to factorize phi(N) itself to get them all recursively. Edited by author 20.08.2008 17:46 NOD is russian for GCD :-) | | The test #10 | liudy | 1045. Funny Game | 4 Aug 2016 08:44 | 1 | May be test 10 is something like 3 2 1 2 2 3 First player loses The start airport just has one airport connected. | | yo dawgs here is a problem a big one | Roman Krylov | 1014. Product of Digits | 4 Aug 2016 00:25 | 2 | So, i wrote my program for a warn-up to commercial programming, but i have a problem at this problem. It gives me wrong answer at the first test and i need your help, guys from this site. Here's the code: // Percentofpeople.cpp : Defines the entry point for the console application. // // Your task is to find the minimal positive integer number Q so that the product of digits of Q is exactly equal to N. #include <iostream> #include <string> int main() { int number; // a number that we need to get std::string answer; std::cout << "Enter the number: " << std::endl; std::cin >> number; for (int i = 9; i >= 2; i--) { while (number > 1 && number % i == 0) // if we can divide number and before it gets to 1 we'll do the following code: { answer = std::to_string(i) + answer; // add the number that divides N completely number /= i; // divide } } if (number == 1) std::cout << answer; else std::cout << -1; std::cin.get(); std::cin.get(); return 0; } I dunno how it looks but i think you'll understand it. So, where is the problem? The problem is with numbers from 1 to 9 or what? First of all, you should remove or comment out this row std::cout << "Enter the number: " << std::endl; The robot doesn't know what this text is supposed to mean, it expects only a numerical answer in the output. After this, you should be getting WA3. | | Python TL#1 | Semm | 1141. RSA Attack | 3 Aug 2016 16:31 | 2 | What's wrong with me (or with this test)? Usually test #1 is the example. I don't see where the problem could come form. I know there were other people getting TL, could you tell what's the problem. What's wrong with this problem? I translated my code on C# and it got AC 0.015. | | WA 3 | Alexander_Fedotov_TverSU | 2002. Test Task | 2 Aug 2016 23:44 | 3 | WA 3 Alexander_Fedotov_TverSU 2 Aug 2016 21:55 Help me please.. Why WA 3? I "Use this letter as a formal description of the algorithm and follow the described format of system messages" and still get Wrong Answer.. This test is correct? 7 login a 1 fail: no such user logout a fail: no such user register a 1 success: new user added login a 1 success: user logged in login a 1 fail: already logged in login a 2 fail: incorrect password register a 2 fail: user already exist Maybe you tell a counterexample or hint? Thanks. Edited by author 02.08.2016 21:56 Your last row is: fail: user already exist Correct one is: fail: user already exists Pay attention. Other than that, test seems ok to me. Re: WA 3 Alexander_Fedotov_TverSU 2 Aug 2016 23:44 Oh, god... Thank you, Oleg! I got AC. | | Дайте несколько тестов для проверки, плиз) | SMILE | 1690. Army of Mages | 2 Aug 2016 22:23 | 2 | 1) 1 1 1 5 5 0 0 2 2 0 10 => OK 3 2) 2 1 1 2 2 -1 5 0 0 0 1 100 0 0 100 54 45 67 76 99 99 => OK 2 4 3) 2 1 2 3 4 5 6 7 8 9 10 11 12 -13 -14 -15 -16 -17 -18 -19 -20 => OK 1 2 В задаче, кстати, нифига не понятен случай n=1,т.к. понятие УВАЖЕНИЯ введено для ПАР. Но в тестах подразумевается, что человек сам себя уважает(хотя пары для него нет). |
|
|