| Show all threads Hide all threads Show all messages Hide all messages |
| Wrong answer Test 1 Pascal | XackerGT | 1327. Fuses | 18 Nov 2011 18:56 | 1 |
program bif; var a,b,c,d:integer; i:real; begin readln (a,b); c:=((b-a)+1) mod 2; if c=0 then i:=((b-a+1)/2) else begin i:=((b-a) div 2)+1; d:=b mod 2; if d=0 then i:=i-1; end; if a=b then i:=1; writeln (i); readln; end. |
| WA #1 | Artem | 1005. Stone Pile | 18 Nov 2011 18:23 | 1 |
WA #1 Artem 18 Nov 2011 18:23 Hello, I'm trying to solve this problem using brute force. I've tried several inputs and program works just fine, but for some reason I'm getting WA on the first test. :( I searched threads and saw that many users had the same problem and then solved it, but no one of them said how he managed to overcome this problem. Please help. Thank in advance. |
| c compiler is very very old | giorgi | | 18 Nov 2011 16:12 | 1 |
well its so fucking problem.c compiler isn't c99 standarts.it's awful |
| когда Егор считается сбитым? | Ripatti [Ufa] | 1884. Way to the University | 18 Nov 2011 10:07 | 4 |
когда Егор считается сбитым? когда он имеет хотя бы одну точку с автомобилем или же когда он находится строго внутри? другими словами - может ли Егор касаться автомобилей в процессе перемещения? Yes, he may touch the car Did you try to touch moving car, Erop? :) But touching cars we make set of times finite and can use brute force in this set. |
| How to get all of my Ac code??? | Eazy jobb | | 17 Nov 2011 14:07 | 1 |
If u Ac more than 50 prob,it well be difficult to copy them one by one. Any good idea????? |
| Any test cases ? | ZARHANE | 1803. The Czechs' Rifles | 17 Nov 2011 08:21 | 5 |
I have WA for Test #11. Any test case ? 2 40 1 2 3 6 4 5 9 12 7 8 11 15 18 10 13 19 14 21 24 25 17 16 20 22 30 26 32 38 23 27 28 31 35 29 34 36 39 33 37 40 10 40 1 2 3 4 8 7 5 9 15 6 13 12 10 19 11 14 22 30 18 25 26 21 28 17 29 16 20 40 24 36 23 27 32 31 33 35 37 34 39 38 Both from them are passed, but I still have WA 11. Please, give another test cases. Fibonachi digits grow very fast. Even UInt64 is incefficient for fibonachi digit with number 93. Test 11 beats unstable sorting algorithms like QuickSort. Test "10 40" shows it too. |
| help plz | Erwin Saul Serrudo Condori | 1493. One Step from Happiness | 17 Nov 2011 00:21 | 1 |
help plz Erwin Saul Serrudo Condori 17 Nov 2011 00:21 this is my code, but wa in test 1, why? what is the test 1, thanks sorry my english is very poor import java.io.*; import java.util.*; public class Main{ static int sum(int n) { int sum=n%10+(n/10)%10+(n/100)%10; return sum; }
static boolean solve(String n) { String ant=n.substring(0,3); String post=n.substring(3,6); if(ant.compareTo(post)==0) return true; else {
int antn=Integer.parseInt(ant); int postn=Integer.parseInt(post); int a; int b; int c; int d; if(postn+1>999) { a=antn+1; b=0; } else { a=antn; b=postn+1; } if(postn-1<0) { c=antn-1; d=999; } else { c=antn; d=postn-1; } a=sum(a); b=sum(b); c=sum(c); d=sum(d);
if(a==b||c==d) return true; else return false; } }
public static void main (String args[]) { Scanner in=new Scanner(System.in); String n; while(in.hasNext()) { n=in.next(); if(solve(n)) System.out.println("YES"); else System.out.println("NO"); } } } |
| TL #16 | marqueewinq | 1872. Spacious Office | 16 Nov 2011 20:41 | 1 |
TL #16 marqueewinq 16 Nov 2011 20:41 Hi there. I've got TL on 16-th with exceedence of 42 ms. Would anybody be so kind to help me manage with it? In my solution, i am building n lists: in i-th list, there are indexes of teams, that can occupy i-th office. After that, i'm running through all n lists, trying to find any OK variant. {{{ void run(int deep) { if (deep == n) { if (final.size() == 0) final = answer; else { cout << cAnswerIsNotUnique << "\n"; exit(0); } } else { for (int i = 0; i < ok[deep].size(); i++) { int target = ok[deep][i]; if (!cap[target]) { cap[target] = true; answer[target] = deep;
run(deep + 1); // cleanup answer[target] = -1; cap[target] = false; } } } } }}} How can i modify my algorithm for better runtime? I would be glad for any clue. Thx. Edited by author 16.11.2011 20:45 |
| 0.5 sec | MOPDOBOPOT (USU) | 1837. Isenbaev's Number | 16 Nov 2011 20:13 | 1 |
0.5 sec MOPDOBOPOT (USU) 16 Nov 2011 20:13 |
| AC in Java! | ile | 1102. Strange Dialog | 16 Nov 2011 18:40 | 3 |
OMG, finally Accepted... I used DP with byte[10^7], and it actually works kinda slow (~0.85s) and uses 12Mb. Tho I saw some solutions in java in 0.5-0.6s with less than 1 Mb... I wonder what they did... You may kept last about 20 symbols, and 20 state of dynamics. Hmm, my scaning char by char get TL. Edited by author 13.08.2010 14:05 Edited by author 13.08.2010 14:05 AC in Java without using DP only search and replace strings in an array of byte0.765sec. 7466 КБ |
| Way WA#5????? please help | Alireza_Keshmiri | 1502. Domino Dots | 16 Nov 2011 03:31 | 4 |
Edited by author 21.02.2009 18:37 Maybe because the answer is a very large number, more than INT_MAX. int sum; // WA 5 long long sum; // Accepted (int64) |
| help me. >> WA 2 << | John Mac | 1723. Sandro's Book | 16 Nov 2011 00:42 | 2 |
this my code: var a,b,s,ms:string[50]; ss,mss,k,n,i,j:integer; begin readln(s); n:=length(s); mss:=0; for i := 2 to n div 2 do for j := 1 to n-i-1 do begin a:=copy(s,j,i); ss:=1; for k := j+1 to n-i+1 do begin b:=copy(s,k,i); if a=b then inc(ss,1); end; if mss<=ss then begin mss:=ss; ms:=a; end; end; if mss=1 then write(s) else write(ms); end. OR var a,b,s,ms:string[50]; ss,mss,k,n,i,j:integer; begin readln(s); n:=length(s); mss:=0; for i := 2 to n div 2 do for j := 1 to n-i-1 do begin a:=copy(s,j,i); ss:=1; for k := j+1 to n-i+1 do begin b:=copy(s,k,i); if a=b then inc(ss,1); end; if mss<=ss then begin mss:=ss; ms:=a; end; end; write(ms); end. Simple: start your cycle for i from 1. |
| my solution very easy | Sunnat | 1000. A+B Problem | 15 Nov 2011 17:51 | 1 |
#include <cstdio> int main() { int a,b; scanf("%i %i",&a,&b); printf("%i",a+b); return 0; } |
| Can u tell me what is fist test? | dan20 | 1877. Bicycle Codes | 15 Nov 2011 16:06 | 2 |
which data is using in first test? For Timus, first test is usually sample test |
| WA 9 | Azad | 1795. Husband in a Shop | 15 Nov 2011 02:34 | 2 |
WA 9 Azad 28 Oct 2010 09:54 Can anyone give me test 9? Edited by author 22.11.2011 01:47 |
| WA#4 Help please. | Saimon | 1617. Flat Spots | 15 Nov 2011 02:09 | 1 |
This is my source: var arn:array[1..150]of integer; i,j,n,ans,t:integer; begin t:=1;ans:=0; readln(n); for i:=1 to n do readln(arn[i]); for i:=1 to n do if arn[i]<>0 then begin for j:=1 to n do begin if (i<>j) and (arn[i]=arn[j]) then begin t:=t+1; arn[j]:=0 end; if t=4 then begin t:=1; ans:=ans+1; end; end; t:=1; end; writeln(ans); end. Can anybody tell me, where mystake? I think to my programm is right. What is input in test 4?Help, please. |
| Weak tests | Fyodor Menshikov | 1145. Rope in the Labyrinth | 14 Nov 2011 21:37 | 5 |
Test generated by the following program is hard for recursive solutions on some languages. For example Java recursive solution uses approx 31M of stack on this test while the whole ML of this problem is 16M. Very very strange that the test set does not contain test with maximal possible answer. const height = 1000; width = 1000; var line, column : integer; begin writeln(height, ' ', width); for line := 1 to height do begin for column := 1 to width do begin if (line = 1) or (line = height) or (column = 1) or (column = width) or (line mod 4 = 1) and (column > 2) or (line mod 4 = 3) and (column < width - 1) then begin write('#'); end else begin write('.'); end; end; writeln; end; end. Edited by author 09.01.2009 17:29 Answer 498500 Edited by author 17.03.2011 03:31 Some tests with n ≠ m were added. 113 authors lost AC. |
| Can someone please tell what is in test #16? | bigtik | 1796. Amusement Park | 14 Nov 2011 19:16 | 1 |
Can someone please tell what is in test #16? |
| What is test #6 ??? | bigtik | 1796. Amusement Park | 14 Nov 2011 18:55 | 1 |
can someone please tell what is in test #6? |
| There is a test where accepted solution get TLE. | Michael Plusnin (USU) | 1806. Mobile Telegraphs | 14 Nov 2011 02:45 | 2 |
50000 1 1 1 1 1 1 1 1 1 1 0000000000 0000000001 0000000002 0000000003 0000000004 . . . 0000049994 0000049995 0000049996 0000049997 0000049998 0000049999 Your test was added. Thank you. |