| Show all threads Hide all threads Show all messages Hide all messages |
| Test 14 | Zergatul | 1438. Time Limit Exceeded | 17 Jul 2021 18:22 | 2 |
not bad Edited by author 17.07.2021 18:23 |
| i solve this for O(n * log n) | Anton | 1297. Palindrome | 17 Jul 2021 16:43 | 1 |
|
| Я написал эту программу на языке программирования C #. Программный код написан четко. Я также проверил в Visual Studio. Но он сказал, что это неправильно на этом сайте. Пожалуйста, проверьте! | Shavkat | 2056. Scholarship | 16 Jul 2021 18:53 | 1 |
using System; namespace a { class Program { static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine()); double[] A = new double[n]; double S = 0; for (int i = 0; i < n; i++) { A[i]=Convert.ToInt64(Console.ReadLine()); } for (int i = 0; i < n; i++) { S = S + A[i]; } double B = S / n; for (int i = 0; i < n; i++) { if (A[i] == 3) { Console.WriteLine("None"); goto finish; } } if (B >= 4.5) { Console.WriteLine("High"); goto finish; } for (int j = 0; j < n; j++) { if (A[j] == 5) { Console.WriteLine("Named"); goto finish; } } Console.WriteLine("Common"); finish: ; } } } |
| Simple DP | guilty spark | 1091. Tmutarakan Exams | 16 Jul 2021 18:47 | 1 |
DP[i][j][k] = count of sets of length i ending at number j with total gcd of k initialize with dp[1][n][n] = 1 for every n >= 2 && n <= s ans is summation of all dp[K][num][g] where g > 1 and num between 2 and s Edited by author 16.07.2021 18:48 Edited by author 16.07.2021 18:48 Edited by author 16.07.2021 18:48 |
| WA Test 5 | Julik | 1604. Country of Fools | 16 Jul 2021 17:54 | 4 |
Mb you forgot to sort your array or vector before start printing anything |
| Python 3 solution | faysalf | 1083. Factorials!!! | 16 Jul 2021 09:03 | 1 |
#I don't know why i start from lk+7. If anyone knew about that, please notify me. import sys n,k = sys.stdin.readline().split() n = int(n) lk = len(k) res = 1 for i in range(lk+7,-1,-1): t = n - i*lk if t>0: res *= t sys.stdout.write("%d\n"%res) Edited by author 16.07.2021 09:03 |
| If you have WA! | 107th | 1031. Railway Tickets | 15 Jul 2021 17:11 | 16 |
If you have WA on test #3 or on test #1 or on test #2 you must use DP! Else if you have WA on test #4 you must use unsigned int or int 64 or long. If you have WA on test #8 you must change start and finish points ( 6-2 and 2-6 is equal ) !^_^! Thanks a lot for WA 8.I got AC.^^ Thank you. I got WA at #8.And I have ACed now; Thank you from reminding! Thank you for your suggestion Thank you very very much! If you have WA8 and use Binary Search - check that it work properly, i.e. return far station instead of nearest Edited by author 03.12.2010 00:05 thank u very much for the 2nd suggestion. first i got wa4 and then wa8..your message help a lot! thank you. Thanks a lot for WA #8! It's really tricky. first i got wa14 and forgot to use long long.your message help a lot! thank you. |
| I hate the time limit | Savchuk Nickolay | 2002. Test Task | 14 Jul 2021 17:34 | 2 |
l1=[] l2=[] l3=[] for i in range(0,1000): l3.append(False) def funct(a): b=a.split() if b[0]=='register': if b[1] not in l1: l1.append(b[1]) l2.append(b[2]) print("success: new user added") else: print("fail: user already exists") elif b[0]=="login": if b[1] not in l1: print("fail: no such user") else: k=l1.index(b[1]) if l3[k]: print("fail: already logged in") else: if l2[k]==b[2]: l3[k]=True print("success: user logged in") else: print("fail: incorrect password") elif b[0]=="logout": k=l1.index(b[1]) if l3[k]: l3[k]=False print("success: user logged out") else: print("fail: already logged out") f=int(input()) for m in range(0,f): n=input() funct(n) f**king time limit!!! List is O(n) lookup, while dict is O(log n), so use that |
| O(n) DP solution | andreyDagger | 1222. Chernobyl’ Eagles | 14 Jul 2021 14:43 | 1 |
using DP you can achieve O(n) |
| how | Rodion | 1601. AntiCAPS | 13 Jul 2021 19:20 | 2 |
how Rodion 14 Sep 2020 22:33 как сделать ввод на питоне в этой задаче? how to make python input in this task? Re: how qumusabel 13 Jul 2021 19:20 |
| Easy problem | Anton | 1203. Scientific Conference | 13 Jul 2021 18:37 | 1 |
Use scanline and sort events by right border abd after that just count segments that their l > now so after this make now = r, ans++; firstly ans = 0 and now = 0; Sorry for my English i'm from Russia |
| The shortest program | Alex Tolstov (Vologda STU) | 1408. Polynomial Multiplication | 8 Jul 2021 18:51 | 13 |
My AC program in Java has 396 lines =) And you?))) C++, 144 lines, 3026 characters (including comments, 15 empty lines, and the tracing utilities). pascal 196 o(∩_∩)o... It's not the shortest, but I am really proud of it! Edited by author 22.09.2009 21:13 Java - 330 :) Good architecture is the key for the shortest program and saving nerves.IMHO Edited by author 04.02.2010 21:26 That's funny. This is the first question that comes to mind after the AC. (300 PASCAL lines) Java 186 Edited by author 29.11.2020 17:38 Edited by author 29.11.2020 17:43 Python (74) is really good at these kinds of problems. p1 = Polynomial.parse(input()) p2 = Polynomial.parse(input()) print(p1*p2) |
| test 16 | Dark_Sun | 2152. Tax Fees | 8 Jul 2021 11:03 | 1 |
please tell me the 16 test |
| WA #9 | Stankov | 1756. One and a Half Diggers | 5 Jul 2021 02:03 | 4 |
WA #9 Stankov 13 Mar 2010 15:21 I have Wa #9 please give some tests Re: WA #9 Oleg Strekalovsky [Vologda SPU] 26 Apr 2010 19:57 Try to find minimum amount of peoples with complexity o(1) like that: if ((m * d1) % d2 == 0) { b = (m * d1) / d2; } else { b = (m * d1) / d2 + 1; } Edited by author 26.04.2010 19:58 i've changed for(int j=1; j<=i; ++j) cout<<floor(fr)<<' '; for(int j=i+1; j<=d2; ++j) cout<<ceil(fr)<<' '; to for(int j=1; j<=i; ++j) cout<<fixed<<setprecision(0)<<floor(fr)<<' '; for(int j=i+1; j<=d2; ++j) cout<<fixed<<setprecision(0)<<ceil(fr)<<' '; |
| could anybody tell me where the wrong from?? thanks!! | shawn | 1404. Easy to Hack! | 3 Jul 2021 08:58 | 1 |
Edited by author 03.07.2021 11:15 |
| be careful about "%" | Vlad | 1243. Divorce of the Seven Dwarfs | 29 Jun 2021 11:47 | 2 |
in python: -5 % 7 == 2 in c++: -5 % 7 == -5 |
| WA 6 | 💮meanlessnessener`~ | 1316. Electronic Auction | 29 Jun 2021 02:02 | 1 |
WA 6 💮meanlessnessener`~ 29 Jun 2021 02:02 For God's sake, use ans/100 instead of ans*0.01f But i don't know why |
| Your Mistake (Hint, no solution) | Euler | 2035. Another Dress Rehearsal | 27 Jun 2021 20:09 | 1 |
Maybe you forgot that the order of the numbers in the answer is important. |
| approach | Pavel | 1864. Get-Together at Den's | 24 Jun 2021 04:19 | 1 |
you can implement your simple fraction class and use it instead of floating point numbers |
| To admins (and python coders) | yyll | 1006. Square Frames | 23 Jun 2021 20:48 | 2 |
I don't know why, but in Python, code points of frame characters are: upper_left = 1066 upper_right = 1111 lower_left = 1040 lower_right = 1065 horizontal = 1044 vertical = 1110 That's really strange, because there are no common codecs encode those characters as such. Could Admin fix this or at lease give some explanations please? Also, don't put non-ascii characters in your source code, but use: c == chr(1066) or ord(c) == 1066 ord('┌') == 9484 list('┌'.encode('cp437')) == [218] list('┌'.encode('utf_16_le')) == [12, 37] # 12+37*256 == 9484 and Unicode code point is: U+250C == 9484 |