| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| For admins: strange tests | undef | 1308. Пирамида декана | 6 ноя 2015 13:34 | 1 |
I have two ACCEPTED solution that gives different results (difference greater than 1E-5) in approximately 7.5-8% points. Is this normal? :) If you have access: "Correct" solution: http://acm.timus.ru/getsubmit.aspx/6557034.cppWrong solution: http://acm.timus.ru/getsubmit.aspx/6554840.cpp Here some of this points: -5.4 -4.0 -0.0 -4.0 5.4 -4.0 -5.4 -2.8 -2.7 -2.8 -2.4 -2.8 -2.1 -2.8 -0.6 -2.8 0.6 -2.8 2.1 -2.8 2.4 -2.8 2.7 -2.8 5.4 -2.8 -2.7 -2.5 -0.6 -2.5 0.6 -2.5 2.7 -2.5 -2.7 -2.2 2.7 -2.2 -5.1 -1.9 -4.8 -1.9 -1.8 -1.9 -0.3 -1.9 0.3 -1.9 1.8 -1.9 4.8 -1.9 5.1 -1.9 -4.2 -0.7 -2.7 -0.7 2.7 -0.7 4.2 -0.7 -1.8 -0.4 1.8 -0.4 -1.8 -0.1 1.8 -0.1 -1.8 0.2 1.8 0.2 -4.2 0.5 -2.1 0.5 -1.8 0.5 1.8 0.5 2.1 0.5 4.2 0.5 -4.2 0.8 4.2 0.8 -4.2 1.7 4.2 1.7 -5.1 2.0 5.1 2.0 -2.7 2.3 2.7 2.3 -5.4 2.6 -2.7 2.6 -2.4 2.6 -0.6 2.6 0.6 2.6 2.4 2.6 2.7 2.6 5.4 2.6 -5.4 2.9 -2.7 2.9 -2.4 2.9 -2.1 2.9 -0.6 2.9 0.6 2.9 2.1 2.9 2.4 2.9 2.7 2.9 5.4 2.9 |
| Problem 1208 "Legendary Teams Contest" has been rejudged | Sandro (USU) | 1208. Соревнование легендарных команд | 6 ноя 2015 09:23 | 1 |
New anti-greedy tests were added. 93 authors lost AC. If you still have AC with greedy solution, please, tell us about it here or to timus_support(at)acm.timus.ru. |
| o(n^4) ACCEPTED!!! 0.078 s | Temirbay Miras | 1146. Maximum Sum | 6 ноя 2015 02:11 | 2 |
Also accepted O(n^4) in Go 0.312 As task marked easy, it was lazy for me to implement O(n^3) |
| Test Case | ROHAN GULATI | 1935. Слёзы утопленников | 5 ноя 2015 17:23 | 15 |
What is the answer for the test case 6 1 3 2 5 4 6 Mine is also 29 I m getting WA#5 with my code Do u have any clue what is test case 5? What's 5 test? Give me this test, please. Edited by author 10.11.2012 14:59 Can we replace places of the bats 27. You can replace the bat. What's 11 test? Give me this test, please. Edited by author 24.04.2013 22:50 |
| Some tests for ADMINS | bsu.mmf.team | 1308. Пирамида декана | 5 ноя 2015 15:02 | 1 |
Admins, please add these tests: 0.683013 0.2 0.683013 0.3 0.583013 0.4 0.583013 0.5 Just add them :) |
| How do I know when the input has ended? | HappyPerson | 1001. Обратный корень | 5 ноя 2015 10:24 | 13 |
I know this might sound stupid, but how am I supposed to know when I've finished inputting numbers? I don't see anything saying what A is equal to, so how do I know? read FAQ. for C++: double n; while (scanf("%lf", &n) != EOF) { ... } I have the same question. What about Java? there's no answer to that in FAQ. You'll know the input has ended when one of the following happens, depending on the method you choose to read in the first place : InputStreamReader in; while(in.read() != -1) BufferedReader in; while((line = in.readLine()) != null) You'll know the input has ended when one of the following happens, depending on the method you choose to read in the first place : InputStreamReader in; while(in.read() != -1) BufferedReader in; while((line = in.readLine()) != null) How to make the EOF? I mean how does it know when the user stopped inputting? As for C#, you can use (as an example): string[] inputValues = Console.In.ReadToEnd().Split(new char[] {' ', '\t', '\n', '\r'}, StringSplitOptions.RemoveEmptyEntries); For windows command prompt CTRL Z would be interpreted as EOF For linux terminal Ctrl + d is the EOF character. /// Edited by author 02.02.2013 14:58 Edited by author 02.02.2013 14:58 I have the same problem with Go. Can someone help me. |
| Formula is good but.... | I QUIT | 1502. Точки домино | 4 ноя 2015 14:18 | 1 |
He guys if you can't come up with any formula...pre-computation will do the job.I could not come up with any formula so I used precomputation and AC in 0.015 sec.Good luck :) |
| WA 2. = = | seeeeei | 1563. Баяны | 4 ноя 2015 12:59 | 4 |
My code: var a:array[1..1000]of string; b:array[1..1000]of integer; n,i,j,m,max:integer; s:string; c:boolean; begin readln(n); for i:=1 to n do begin c:=true; readln(s); for j:=1 to m do if s=a[j] then begin inc(b[j]); c:=false; break; end; if c then begin inc(m); a[m]:=s; inc(b[m]); end; end; for i:=1 to n do if max<b[i] then max:=b[i]; writeln(max); end. I know. I understood that the wrong.^^ |
| Please Help. | Spyro | 2060. Подпалиндромные пары | 4 ноя 2015 11:26 | 3 |
Sorry to blunt, but I don't understand the meaning of the task. Explain what needs to be done. Examples of chewing the tasks: abaa 1. i = 1, j = 1, k = 2; ' a ' and ' b ' palindromes 2. i = 1, j = 3, k = 4; ' aba ' and ' a ' palindromes 3. i = 2, j = 2, k = 3; ' b ' and ' a ' palindromes 4. i = 2, j = 2, k = 4; ' b ' and ' aa ' palindromes 5. i = 3, j = 3, k = 4; ' a ' and ' a ' palindromes Russian text: Разжевывание примера из задачи: abaa 1. i=1, j=1, k=2; 'a' и 'b' палиндромы 2. i=1, j=3, k=4; 'aba' и 'a' палиндромы 3. i=2, j=2, k=3; 'b' и 'a' палиндромы 4. i=2, j=2, k=4; 'b' и 'aa' палиндромы 5. i=3, j=3, k=4; 'a' и 'a' палиндромы you can use Manacher's algorithm. |
| two different solutions | Nodirbek Islomov | 1196. Экзамен по истории | 4 ноя 2015 00:37 | 3 |
#include <cstdio> #include <map> std:: map <int, int> a; int n, m, q, i, x, ans; void solve(){ scanf("%d", &n); for(i = 0 ; i < n ; i ++) scanf("%d", &x), a[x] ++; scanf("%d", &m); for(i = 0 ; i < m ; i ++){ scanf("%d", &q); if(a[q]) ans ++; } printf("%d", ans); } int main(){ solve(); } #include <cstdio> #include <algorithm> int a[15051]; int n, m, q, i; int ans; int binary(){ int left = 0, right = n-1, middle; while(left <= right){ middle = (left + right) >> 1; if(a[middle] == q) return middle; if(a[middle] > q) right = middle - 1; if(a[middle] < q) left = middle + 1; } return -1; } void solve(){ scanf("%d", &n); for(i = 0 ; i < n ; i ++) scanf("%d", a + i); std:: sort(a, a + n); scanf("%d", &m); while(m --){ scanf("%d", &q); if(binary() != -1) ans ++; } printf("%d", ans); } int main(){ solve(); } Me too use the STL, its a simple and easy for write) And not more to time of run. 1.450 for map && 1.405 for binary_search.. |
| WA #4 | ~ SiriuS ~ | 1998. Старый падаван | 3 ноя 2015 16:17 | 4 |
WA #4 ~ SiriuS ~ 7 ноя 2013 14:52 Try this test. 5 3 6 1 2 3 4 5 4 5 6 answer : 11 Why 11 but not 12?, please explain, i don't understand that Re: WA #4 Jane Soboleva (SumNU) 3 ноя 2015 16:17 On first 3 seconds, we pick 1, 2, 3. On 4th second, we drop 1, 2, 3. On 5th and 6th second, we drop nothing. On 7th, 8th, 9th, 10th, 11th second, we pick 1, 2, 3, 4, 5. So the answer is 11. |
| WA 45 | Velea Alex | 1643. Атака Тёмной крепости | 3 ноя 2015 00:58 | 3 |
WA 45 Velea Alex 2 сен 2010 17:18 hi, I used bf search and all the things seem to work correctly, but I get WA 45... I have no idea what is my mistake... help me, please :) give me some tests You must use dijkstra not bfs Petru Trimbitas is incorrect; you do not have to use Dijkstra. |
| What is the WA #3 | Sunnat | 2071. Фруктовые коктейли | 2 ноя 2015 18:03 | 1 |
My solution is depend on next_permutation in C++. |
| Idea | __Andrewy__ | 1181. Разрезание окрашенного многоугольника | 2 ноя 2015 17:44 | 2 |
Idea __Andrewy__ 21 авг 2015 09:56 I got AC with O(N*N); Idea: use mathematical induction and prove that solution exist always. Induction gives a solution. Good hint! Furthermore, it can be proved that if it is not 'obviously impossible', then there will always be a solution. |
| Wrong test #6 help me friends please !!! | Jamshid Sattarov (TUIT Urgench) | 1493. В одном шаге от счастья | 2 ноя 2015 00:37 | 2 |
this is my solution #include <iostream> #include <cmath> using namespace std; int main() { long long a,b,s=0,d=0,k=0,jama,kk=0,ss=0,dd=0; cin>>b; a=b; b=b-1; while(b-1>0) { jama=b%10; k++; if(k<=3) { s+=jama; } else{ d+=jama; } b/=10; } int i=0; if(s-d==0 ) { i++; } a=a+1; int joma; while(a>0) { joma=a%10; kk++; if(kk<=3) { ss+=joma; } else{ dd+=joma; } a/=10; } if(ss-dd==0 ) { i++; } if(i>0) { cout<< "Yes"; } else cout<< "No"; return 0; } [delete] Edited by author 02.11.2015 00:38 Edited by author 02.11.2015 00:38 |
| Accepted (Visual C++) | Vensus | 1243. Развод семи гномов | 2 ноя 2015 00:01 | 3 |
#include <iostream> using namespace std; int main() { int k = 0; long long int s = 0; char num[52]; int arr[51]; bool flag = true; cin >> num; for(int i = 0; flag; i++) { switch(num[i]) { case '0': { arr[i] = 0; k++; break; } case '1': { arr[i] = 1; k++; break; } case '2': { arr[i] = 2; k++; break; } case '3': { arr[i] = 3; k++; break; } case '4': { arr[i] = 4; k++; break; } case '5': { arr[i] = 5; k++; break; } case '6': { arr[i] = 6; k++; break; } case '7': { arr[i] = 7; k++; break; } case '8': { arr[i] = 8; k++; break; } case '9': { arr[i] = 9; k++; break; } case '\0': { flag = false; break; } } } for(int i = k-1; i+1 > 6;) { s = s + arr[i]; s = s + arr[i-1]*3; s = s + arr[i-2]*2; s = s + arr[i-3]*6; s = s + arr[i-4]*4; s = s + arr[i-5]*5; i = i - 6; k = k - 6; } if(k > 0) { s = s + arr[k-1]; k--; } if(k > 0) { s = s + arr[k-1]*3; k--; } if(k > 0) { s = s + arr[k-1]*2; k--; } if(k > 0) { s = s + arr[k-1]*6; k--; } if(k > 0) { s = s + arr[k-1]*4; k--; } if(k > 0) { s = s + arr[k-1]*5; k--; } cout << s%7; return 0; } Edited by author 16.11.2013 14:57 Edited by author 16.11.2013 14:57 Thats all ;) char c,ans; main(){ for(;(c=getchar())!='\n';ans=(ans*10+c-'0')%7); printf("%u\n",ans);
return 0; } |
| WA3???...........Plz help | alok13alok | 1893. A380 | 1 ноя 2015 22:27 | 2 |
import java.util.Scanner; public class A380 { public static void main(String agrs[]){ Scanner sys=new Scanner(System.in); String input=sys.next(); String[] part=input.split("(?<=\\d)(?=\\D)"); int num=Integer.parseInt(part[0]); if(num==1 || num==2){ if(part[1].equals("A")||part[1].equals("D")) System.out.println("window"); else if(part[1].equals("B")||part[1].equals("C")) System.out.println("aisle");
} else if(num>=3 && num<=20){ if(part[1].equals("A")||part[1].equals("F")) System.out.println("window"); else if(part[1].equals("B")||part[1].equals("C") || part[1].equals("D")||part[1].equals("E")) System.out.println("aisle");
} else if(num>=21 && num<=65){ if(part[1].equals("A")||part[1].equals("K")) System.out.println("window"); else if(part[1].equals("C")||part[1].equals("D") || part[1].equals("H")||part[1].equals("G")) System.out.println("aisle"); else if(part[1].equals("B")||part[1].equals("E") || part[1].equals("F")||part[1].equals("J")) System.out.println("niether"); }
} } |
| Test 11, Execution time 0.187 s and TLE ?? | Radek | 1100. Таблица результатов | 1 ноя 2015 18:36 | 4 |
Time limit is 1.0s, my program executes test 11 in 0.187s the result is TLE, why ? After conversion my program from C# to Java(with which I am not familiar) I have AC. Thus I think that there is a problem with C# judge for this problem. Yeah, I have the same problem. May be array, u give 150000. But need one more. +1 |
| WHAT'S TEST 4? | invokerj | 2000. Grand Theft Array V | 1 ноя 2015 18:12 | 4 |
I can't pass test 4, I just can't,,,,, thanks,, problem founded.... Edited by author 29.11.2013 11:03 it's problem with first_pos == second_pos Additional tests for those who stuck here: Test #1 3 1 2 0 2 2 Result 3 0 Test #2 3 0 2 1 2 2 Result 3 0 My algo pass all test discribed in this forum branch, but I can't pass this test :( help me plz! |
| Wrong answer c++ | Sunbro | 1876. Утро сороконожки | 1 ноя 2015 18:10 | 3 |
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (39+2*a>a+2*b) cout << 39+2*a; else;cout << 40+2*b; return 0; } if (39 + 2 * a> 40 + 2 * b)т.к правую ногу полностью обули take maximum of this two: ansa=a*2+39; ansb=b*2+40;
|