| Show all threads Hide all threads Show all messages Hide all messages |
| Troubles with 4 test | Victor Barinov (TNU) | 1527. Bad Roads | 5 Mar 2011 20:20 | 4 |
If you have troubles with test 4 than READ OUTPUT FORMAT CAREFULLY :) If you have WA on 10. than may be you forgot: "Note that the roads are unidirectional" i cant fix this problem :( i cant fix this problem :( |
| wrong answer test # 1 .Who can tell me what it means? | GaoHughes | 1079. Maximum | 5 Mar 2011 05:43 | 2 |
What is the number 1 stand for? and test # 2 ? 3 ? 4 ? i think you should read all input before starting traitement....good luck |
| Lack in tests | paksv | 1002. Phone Numbers | 5 Mar 2011 03:36 | 1 |
I was very lazy and made the program as slow as possible - using array instead of tree for storing numbers and Scanner for reading files and still got Accepted. How come? |
| How to make use of the FOCs for this problem? | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1815. Farm in San Andreas | 4 Mar 2011 11:51 | 6 |
We can write some FOCs which describe optimal point. But how to find point which satisfies these FOCs? I suspect it is not necessary to find this point, you can get correct answer without knowing exact location of it. I haven't solved this problem yet, so it is a hypotesis only... Haven't ACed yet, but it seems I found the algo which uses 2 binary searches only. If you want to use BS, you should have a sorted structure. What is it? Do you serach this point on some fixed line? Of course, I convert initial problem to some other problem, and there it is ordered structures =) Convex structure also gives O(lg n). For example golden proportion search om segment. |
| Test 15, something strange | diver_ru (Fishburg SAAT) | 1341. Device | 3 Mar 2011 23:15 | 2 |
I send program with such procedure: void moveNorth(double dist) { w += dist / rEarth * 180 / pi; if (w > 91.0) n = (n - n) / n; } And got crash 15, but when i send void moveNorth(double dist) { w += dist / rEarth * 180 / pi; } i got accepted. So, i think device can reach north pole with test 15 input data, but it's impossible. In this test the device flies too close to north pole. I got AC instead WA#15 when I changed PI from 3.14159265 to 3.141592653589. And I searched for a numerical mistake for 1 hour :) Ha-ha! Edited by author 03.03.2011 23:16 |
| tle on 21 | daizhenyang | 1651. Shortest Subchain | 3 Mar 2011 13:10 | 2 |
who can help me? I use bfs. use dynamic programming seq:1 2 7 3 2 8 4 8 5 dp :1 2 3 4 2 3 4 3 4 dp[i] -> dp[i+1] or dp[i] -> dp[j] while seq[i] == seq[j] Notice that if much j exists, just goto the smallest j the algorithm is O(N) P.S : why netflow doesn't work now ? :) |
| test | grisha[SIAL 2010] | 1459. Archer's Travel | 2 Mar 2011 23:41 | 2 |
test grisha[SIAL 2010] 2 Mar 2011 13:20 Please, give me test 12. Very need. The only thing I know about this test is N < 4. |
| WHILE NOT SEEK EOF | MOPDOBOPOT (USU) | 1069. Prufer Code | 28 Feb 2011 23:07 | 1 |
|
| WA8 | Timur Sitdikov (MSU TB) | 1220. Stacks | 28 Feb 2011 21:20 | 1 |
WA8 Timur Sitdikov (MSU TB) 28 Feb 2011 21:20 If WA8, try test 100000 PUSH 1 1 PUSH 1 2 .... PUSH 1 99990 POP 1 ... POP 1 Right answer: 99990 ... 99981 |
| what answer? | Vit Demidenko | 1503. Polynomial | 28 Feb 2011 21:07 | 2 |
What answer for 3 1 0 3 0 ? 0 0 0 or 0 ? |
| wa17 | hatred | 1773. Metro to Every Home | 28 Feb 2011 01:06 | 1 |
wa17 hatred 28 Feb 2011 01:06 |
| Porque error? | nicoloco785 | 1068. Sum | 27 Feb 2011 21:50 | 1 |
import java.util.Scanner; public class Main { public void solucion(int num) { int aux = 0; if (num <0) { for (int i = num; i <= 1; i++) { aux += i; } } else { for (int j = num; j >= 1; j--) { aux += j; } } System.out.println(aux); } public static void main(String[] args) { Main obj = new Main(); Scanner leer = new Scanner(System.in); int numero = leer.nextInt(); if (numero < 10000) { obj.solucion(numero); } } } |
| I am wrong ?? | xiaowentao99 | 1068. Sum | 27 Feb 2011 21:25 | 2 |
#include <iostream.h> int main(){ int num; while (cin>>num){ int answer=0; if(num>=1){ answer = num*(num+1)/2; printf("%d\n",answer); } else{ answer = (2-num)*(1+num)/2; printf("%d\n",answer); } } return 0; } where ? i faced same problem. compiler may not support cin>> but istream::cin>> or u should use scanf("%d",&a); like this. thanks |
| trouble(pascal) | Vyacheslav | 1079. Maximum | 27 Feb 2011 18:53 | 2 |
what`s wrong? var n,i,res,c,max:longint; a:array[0..100000] of integer; begin repeat max:=0; Readln(n); a[0]:=0; a[1]:=1; for i:=1 to n do begin a[2*i]:=a[i]; a[2*i+1]:=a[i]+a[i+1] end; for i:=1 to n do if a[i]>max then max:=a[i]; if n<>0 then Writeln(max); until n=0; end. i find mistake: a:array[0..200001] of integer; this is accepted) |
| WHY WA#16 | Nick Loginov (USU) | 1201. Which Day Is It? | 27 Feb 2011 17:16 | 2 |
WHY WA#16 Nick Loginov (USU) 26 Mar 2010 08:44 Try to check this: 25 11 1885. The right answer is: mon........2....9...16...23...30 tue........3...10...17...24 wed........4...11...18..[25] thu........5...12...19...26 fri........6...13...20...27 sat........7...14...21...28 sun...1....8...15...22...29 Edited by author 27.02.2011 17:19 |
| Any idea where the mistake is? | Pawel Wanat | 1010. Discrete Function | 26 Feb 2011 19:10 | 5 |
This code gets WA on test 2: [code deleted] & this gets AC: [code deleted] :) Edited by moderator 02.01.2020 18:26 Try to use scanf("%I64d", &tab[i]); Oh! It's like in dev :) thx for info. . The operating system may be windows, not linux, but why it return WA instead of CE? Edited by author 27.07.2009 20:46 Cause your solution is wrong. |
| Is there any O(1) solution? | Sergey Zuev | 1017. Staircases | 26 Feb 2011 18:54 | 3 |
I know O(n^2) one. Maybe there is also an O(1)? I have an O(n*logn) one...but surely not good enough... |
| what's wrong? | Samirson | 1197. Lonesome Knight | 26 Feb 2011 16:14 | 1 |
#include <stdio.h> int main(void) { int n,k,i; char c; scanf("%d",&n); while(n--){ scanf("%1s%d",&c,&k); if((c=='a'||c=='h')&&(k==1||k==8)) {printf("2\n"); continue;} if((c=='a'||c=='h')&&(k==2||k==7)) {printf("3\n"); continue;} if((c=='b'||c=='g')&&(k==1||k==8)) {printf("3\n"); continue;} if((c=='b'||c=='g')&&(k==2||k==7)) {printf("4\n"); continue;} if(c<'b'||c>'g') {printf("4\n"); continue;} if(k<2||k>7) {printf("4\n"); continue;} if((c=='b'||c=='g') || (k==2||k==7)) {printf("6\n"); continue;} printf("8\n"); } return 0; } |
| What's wrong with my C# code? It is giving wrong answer in case # 2... | Alaska . PK | 1423. String Tale | 26 Feb 2011 00:03 | 1 |
long stringLength = Convert.ToInt32(Console.ReadLine()); string S = Console.ReadLine(); string T = Console.ReadLine(); long temp = 0; bool check = false; for (long i = 0; i < stringLength; i++) { S = S[Convert.ToInt32(stringLength) - 1] + S.Substring(0, Convert.ToInt32(stringLength) - 1); if (S == T) { temp = i + 1; check = true; break; } } if (check && temp < stringLength) Console.WriteLine(temp); else Console.WriteLine(-1);
|
| Note to the solution of the test number 3 | Alflex | 1294. Mars Satellites | 25 Feb 2011 21:49 | 1 |
The printing of the answer in C++ should be, e.g., in the form: cout << "Distance is " << setiosflags(std::ios_base::fixed) << setprecision(0) << 1000.0*sqrt(dist) << " km."; where dist is double value. You don't need to round off the answer with the help of some functions. |