| Show all threads Hide all threads Show all messages Hide all messages |
| What is the test #19? Please give me a test so that I can check and correct it. Thanks ! | Check | 1793. Tray 2 | 23 Jul 2019 11:34 | 4 |
I really appreciate your help guys, please give a test, I spend so much time to solve this problem, now I don't wanna leave it like that. Now I have WA23, any ideas? Если вы отсекли тарелки (мысленно), они все равно не могут быть ближе чем им позволяют их настоящие радиусы Thank you very much. You helped me a lot. |
| WA5 | Andrewy | 1233. Amusing Numbers | 22 Jul 2019 23:41 | 1 |
WA5 Andrewy 22 Jul 2019 23:41 1)Pls, give me some tests 2)Am I right that answer < 10^18? Edited by author 22.07.2019 23:42 |
| Python Solution. | Vladislav Ershov | 2023. Donald is a postman | 21 Jul 2019 14:54 | 1 |
def bin_Search(arr, val): low = 0 high = len(arr)-1 while low <= high: mid = (low + high) // 2 if val < arr[mid]: high = mid - 1 elif val > arr[mid]: low = mid + 1 else: return True else: return False first = ["Alice", "Ariel", "Aurora", "Phil", "Peter", "Olaf", "Phoebus", "Ralph", "Robin"] first.sort() second = ["Bambi", "Belle", "Bolt", "Mulan", "Mowgli", "Mickey", "Silver", "Simba", "Stitch"] second.sort() third = ["Dumbo", "Genit", "Jiminy", "Kuzko", "Kida", "Kenai", "Tarzan", "Tiana", "Winnie"] third.sort() n = int(input()) pos = 1 steps = 0 for i in range(n): name = str(input()) if bin_Search(first, name) == True: steps += pos - 1 pos = 1 elif bin_Search(second, name) == True: if (pos - 2) < 0: steps += ((pos - 2) * -1) pos = 2 else: steps += pos - 2 pos = 2 else: if (pos - 3) < 0: steps += ((pos - 3) * -1) pos = 3 else: steps += pos - 3 pos = 3 print(steps)
In this solution i used binary search |
| Python Solution. | Vladislav Ershov | 1639. Chocolate 2 | 21 Jul 2019 14:02 | 1 |
m, n = map(int, input().split()) if (m*n) % 2 == 0: print("[:=[first]") else: print("[second]=:]") |
| Подскажите в чем трабл? | Sprint_me | 1001. Reverse Root | 21 Jul 2019 11:06 | 2 |
import sys from math import sqrt potok = sys.stdin.read() spisok = potok.split()[::-1] if sys.getsizeof(potok)>262144: print('большой объем') quit() for i in spisok: i=int(i) if i>10**18 or i<0: print('неверный диапозон') quit() res = sqrt(int(i)) print("%.4f" % res) del Edited by author 21.07.2019 11:08 |
| help!!! | Dembel {AESC USU} | 1498. Stroke at Full Speed | 20 Jul 2019 19:50 | 2 |
help!!! Dembel {AESC USU} 19 Oct 2006 18:34 Input 3 3 1 1 1 3 3 Output 0 is it correct? Re: help!!! 👨🏻💻 Spatarel Dan Constantin 20 Jul 2019 19:50 I think so. My AC solution outputs 0. It should be noted that the problem statement doesn't mention what happens if you can't get next to the demon in at most L moves. Either such a test is invalid or you should output 0, since you can't stike it, thus you give it a stike of at most 0 intensity. |
| stupid answer c++ | desinger58 | 1880. Psych Up's Eigenvalues | 19 Jul 2019 23:29 | 2 |
#include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { int co1=0,co2=0,co3=0,c=0; //init //1 cin >> co1; int *nm1 = new int[co1]; for (int i = 0; i < co1; i++) { cin >> nm1[i]; } //2 cin >> co2; int *nm2 = new int[co2]; for (int i = 0; i < co2; i++) { cin >> nm2[i]; } //3 cin >> co3; int *nm3 = new int[co3]; for (int i = 0; i < co3; i++) { cin >> nm3[i]; } for(int i=0;i<co1;i++) { for(int k=0;k<co2;k++) { if(nm1[i]==nm2[k]) { for(int j=0;j<co3;j++) { if(nm2[k]==nm3[j]) { c++; break; } } break; } } } cout << c; system("pause"); return 0; } |
| Python Solution. | Vladislav Ershov | 2100. Wedding Dinner | 19 Jul 2019 20:04 | 1 |
f = int(input()) friends = [] cnt = 0 for i in range(f): j = str(input()) if j[-4:] == "+one": cnt += 200 else: cnt+= 100 if ((cnt/100)+2) == 13: cnt += 300 else: cnt += 200 print(cnt) I solve it by this |
| Python Solution. | Vladislav Ershov | 1880. Psych Up's Eigenvalues | 19 Jul 2019 19:55 | 2 |
def bin_Search(arr, val): low = 0 high = len(arr)-1 while low <= high: mid = (low + high) // 2 if val < arr[mid]: high = mid - 1 elif val > arr[mid]: low = mid + 1 else: return True else: return False aa = int(input()) aArr = list(map(int, input().split())) b = int(input()) bArr = list(map(int, input().split())) c = int(input()) cArr = list(map(int, input().split())) aArr.sort() bArr.sort() cArr.sort() cnt = 0 for i in aArr: s = bin_Search(bArr, i) if s == True: s1 = bin_Search(cArr, i) if s1 == True: cnt += 1 print(cnt) Here i use binary search |
| How many ways of solving this problem? | littleibex | 1005. Stone Pile | 19 Jul 2019 10:49 | 2 |
After going through all the discussion topics, I found that this problem can be solved using different techniques. I have made a list of keywords, and I would like to know exactly how many different ways are there to solve this problem? 1) Brute force 2) Bit mask 3) Dynamic Programming 4) Backtracking 5) Balanced Partition 6) Partition problem 7) Greedy algorithm If you can solve the question with DP, you should avoid Brute Force. Although, I could not come up with a Greedy algorithm. I solved it using DP. |
| Any ideas about WA6? | Combatcook | 2032. Conspiracy Theory and Rebranding | 18 Jul 2019 20:21 | 2 |
My idea: 1) if triangle is right, answer is obvious) 2) if triangle is equilateral, there is no solution 3) in other cases try to split the triangle into 2 right triangles to get coordinates Correct me if I'm wrong or give test which fail that algo. 17,65,80 result: 0 0 33 -56 48 -64 Edited by author 18.07.2019 20:22 Edited by author 18.07.2019 20:25 Edited by author 18.07.2019 20:26 |
| WA(2) for correct program ??? :( | KIRILL | 1048. Superlong Sums | 18 Jul 2019 10:03 | 7 |
program text; {$APPTYPE CONSOLE} var n,k,i,j,n1,n2,col,lastlen:integer; num1,num2:array[0..1000001] of byte; t1,t2:longword; Procedure Add; var i,carry:integer; begin carry:=0; for i:=1 to high(num1) do begin carry:=carry+num1[i]+num2[i]; if carry>=10 then begin num1[i]:=carry-10; carry:=1; end else begin num1[i]:=carry; carry:=0; end; end; end; begin { TODO -oUser -cConsole Main : Insert code here } { Assign(input,'Input.txt'); reset(input); Assign(output,'output.txt'); rewrite(output); } fillchar(num1,sizeof(num1),0); fillchar(num2,sizeof(num2),0); readln(n); col:=0; k:=0; for i:=n downto 1 do begin readln(n1,n2); num1[i]:=n1; num2[i]:=n2; end; ADD; k:=high(num1); while num1[k]=0 do dec(k); if k=0 then writeln(0) else for i:=k downto 1 do write(num1[i]); end. I think you should be more careful when you read the task. Test 4 0 0 1 1 1 1 1 1 Answer 0222 And your program gives 222. Edited by author 06.09.2006 15:38 //but why me #include<bits/stdc++.h> using namespace std; int main() { long n,i,j=0; scanf("%ld",&n); int a[2000003],b=0; string s; n*=2; for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=n-1;i>=0;i=i-2){ b=(b+a[i]+a[i-1]); s[j]=(b%10)+48; b=b/10; j++; } //if(b!=0){ //cout<<b; //} for(i=j-1;i>=0;i--){ printf("%c",s[i]); } } I have made the same mistake. |
| Тест № 2 | vvgaranov | 1880. Psych Up's Eigenvalues | 18 Jul 2019 09:52 | 1 |
Edited by author 30.07.2019 19:29 |
| WA at test#2, please help ! | Najmaddin Akhundov | 1048. Superlong Sums | 18 Jul 2019 09:12 | 5 |
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; int a; int b; long double c=0; for (unsigned int i = 0; i < n; i++) { cin >> a; cin >> b; if (i != 0 ) { c = c * 10 + a + b; } else c = a + b;
}
cout <<c<< endl; } 3 1 1 9 0 9 1 try this this test helped me My code's producing 300. It's right, isn't it? What is double mantissa size? About 17 decimal digits? What is required number size? About 1,000,000 digits? So, how your solution is supposed to work? //wa on test 2 .. whats the problem with my code #include<bits/stdc++.h> using namespace std; int main() { long n,i,j=0; cin>>n; int a[2000003],b=0; string s; n*=2; for(i=0;i<n;i++){ cin>>a[i]; } for(i=n-1;i>=0;i=i-2){ b=(b+a[i]+a[i-1]); s[j]=(b%10)+48; b=b/10; j++; } for(i=j-1;i>=0;i--){ cout<<s[i]; } } |
| Why find two mins is wrong algoritm? | AlexRad | 1964. Chinese Dialects | 18 Jul 2019 07:19 | 3 |
What is correct algorithm? My program that find 2 mins and print Math.Max(min1 + min2 - n, 0) don't pass test 13. Consider test 3 3 2 2 2 Your solution says that there is a person who knows three different dialects. But we can construct an example where it is not true: 1) first person knows dialects number 1 and 2 2) second knows 1 and 3 3) third knows 2 and 3 Do u give me ur wrong code? |
| What's the meaning of the problem?? | zhao kai | 1877. Bicycle Codes | 17 Jul 2019 00:24 | 4 |
How did the thief steal the bicycle ?I'm not pretty sure. Is there some one telling me ? The thief steals the bicycle if he opens the lock, that is, if the code he tries is the same as the code for the lock. Test 1: Den's keys: 0001 0000 1st night 2nd night 3rd night 4th night ... ... ... All nights bike's key 0001 0000 0001 0000 - bad man 0000 0001 0003 0004 - result no no no no no Test 2: Den's keys: 0002 0001 1st night 2nd night 3rd night 4th night ... ... ... All nights bike's key 0002 0001 0002 0001 - bad man 0000 0001 0003 0004 - result no yes no no yes In the first test all nights result is "no". That why in the first test result is no. Thanks a lot for the explanation. |
| If you wa on test#12 , try this data | Eazy jobb | 1297. Palindrome | 15 Jul 2019 20:54 | 4 |
input : ABCDLKOIKJTFIDCBA ouput is a single letter such as A K and I NOT “ABCD” or what have you . Why is the answer not "ABCD" in this case? YES, why is not ABCD input : ABCDLKOIKJTFIDCBA oh...I see.. Edited by author 17.06.2016 15:54 I think ,cause we need to find a substring,not a subsequence |
| Java 8: How to use both input and output? | Ionkin M [Samara SAU #617] | 1601. AntiCAPS | 15 Jul 2019 19:38 | 2 |
Sorry for my bad English. I use int ch; while ((ch = System.in.read()) != -1) { // my solution System.out.print(<some char>); } System.out.println(); But I get WA #1 with or without last code line. I also used System.out.flush (without last line), but it do not help me. Use Scanner from utils,that's better and esier , than use System.in.read() |
| wa on test 55 | abid1729 | 2111. Plato | 15 Jul 2019 00:46 | 2 |
Edited by author 24.06.2019 13:55 use 'long' instead of 'int' as accumulator |
| No subject | ∭Andreyka∭ | 2025. Line Fighting | 14 Jul 2019 12:16 | 1 |
hEdited by author 19.07.2019 12:15 Edited by author 19.07.2019 12:16 |