| Show all threads Hide all threads Show all messages Hide all messages |
| Problem 1382 'Game with Cards' has been rejudged | Vladimir Yakovlev (USU) | 1382. Game with Cards | 3 Feb 2016 09:02 | 1 |
A dozen of new tests has been added. Time limit has been decreased to 500 ms. All submissions have been rejudged - 58 authors have lost their AC. |
| WA#5 | Grim_Disciple | 1160. Network | 3 Feb 2016 06:59 | 2 |
WA#5 Grim_Disciple 2 Oct 2009 18:23 need help. i used Kruskal's algorithm hi, you already solved this problem perhaps someone else might stuck in this test also: for Kruskal's algorithm i used to use this union method and got WA5, static void union(int su, int sv) { int segu = seg_in_hub[su]; seg_in_hub[sv] = segu; }//seg_in_hub[1..H+1] initialized with 1,2,3..H Instead, i rewrote this method and the solution got accepted static int union(int su, int sv) { int c = 1; int segu = seg_in_hub[su]; int segv = seg_in_hub[sv]; for (int i=0; i<seg_in_hub.length; i++) { if (seg_in_hub[i] == segu) { c++; seg_in_hub[i] = segv; } } return c; } //Also check if method returns H then break the loop |
| Fast solution? | Vladimir Li | 2047. Maths | 31 Jan 2016 21:27 | 5 |
My AC is 0.8 seconds, what is the idea for 0.01sec solutions? Yea, precalc actually does work. I had an ineffecient solution which spent ~30 seconds and ~65 MB, so then i tried to precalc, but my initial variant didn't pass because it was 204kb of code, and the limit of 64kb is suddenly back (i don't recall it from before...) In the end, i finally managed to compress it down to 63kb, due to the fact that out of 100k values, certain four numbers were present in 80%+ cases. java 0.156 | 45 000 КБ precalc) 100000 char's to 64K theare is some big number ang long path from it to [1,100] by dividing we can start moving from any place of this path |
| please help(pascal) | denis | 1001. Reverse Root | 31 Jan 2016 19:37 | 1 |
please help! var n,i:longint; a:array[1..50000] of extended; begin n:=0; while not seekeof do begin n:=n+1; read(a[n]); end; for i:=n downto 1 do writeln(sqrt(a[i]):0:4); end. Edited by author 31.01.2016 20:01 Edited by author 31.01.2016 20:02 Edited by author 31.01.2016 20:02 |
| TEST 11 | George | 1562. GM-pineapple | 31 Jan 2016 11:52 | 1 |
Please give me test 11!!!=( |
| Почему выдает неправильный ответ? | Alexandr | 1001. Reverse Root | 30 Jan 2016 21:47 | 4 |
Решал на паскале по инструкции http://acm.timus.ru/help.aspx?topic=pascalВот код. var i :integer; a: int64; b:array[1..100] of real; begin {$IFNDEF ONLINE_JUDGE} i:=1; assign(input, 'input.txt'); reset(input); assign(output, 'output.txt'); rewrite(output); {$ENDIF} while not seekeof(input) do begin read(a); b[i]:=Sqrt(a); i:=i+1; end; for i:=i-1 downto 1 do writeln(b[i]:1:4); {$IFNDEF ONLINE_JUDGE} close(input); close(output); {$ENDIF} end. Отправляю на сайт - выдает Wrong answer. Как минимум — фраза «Размер входного потока не превышает 256 КБ.» означает, что там может быть намного больше, чем 100 чисел. Ну и ещё для олимпиадных задач лучше всегда использовать extended, а не real. И вместо seekeof(input) можно просто eof. И вместо :1:4 можно по идее и :0:4 (но не обязательно) UPD: а, и самое-самое главное упустила — i:=1 внутри IFNDEF'a. То есть на сервере эта команда не выполнится, и i будет нулём. Вынести i:=1 за пределы, и переобъявить массив, скажем, как array[1..1000000] of extended, и будет AC. Edited by author 30.01.2016 20:24 Тем не менее редактирование к результату не привело. А что вообще за IFNDEF? Я о нем ранее не слышал. Поздравляю с AC. Как описано в руководстве, ONLINE_JUDGE — директива компилятора, с которой на сервере запускаются решения. Соответственно, есть IFDEF (if defined, если определена) и IFNDEF (if not defined, если не определена). То есть {$IFNDEF ONLINE_JUDGE} ... {$ENDIF} означает, что если не определена директива ONLINE_JUDGE, то есть вы исполняете программу у себя дома (и конечно же не прописали эту директиву в компилятор), то будет исполняться код в этом блоке. В частности, это делается для того, чтобы у себя на компьютере писать код, читающий данные из файла, а на сервере — из стандартного ввода-вывода. |
| According to statement, can A shoot in the air? | Mickkie | 1565. The Duel for Three | 30 Jan 2016 20:48 | 1 |
Since one paragraph says that "Each time a duelist may aim at any other alive duelist or purposely shoot in the air." But the next one says that "The first one (let's call him A) always hits his target and always aims at the best of the living rivals." Does it mean A always hits the guy who has greater shot accuracy? |
| nope. | misterfourtytwo | 2064. Caterpillars | 30 Jan 2016 16:31 | 1 |
nope. misterfourtytwo 30 Jan 2016 16:31 nope. Edited by author 30.01.2016 16:32 Edited by author 30.01.2016 16:33 |
| what is the test number 2? | Eugene Ovechkin | 1058. Chocolate | 30 Jan 2016 06:42 | 3 |
I try to solve different polygons that i feign myself. And everything is OK include some special cases like two equal points or all points in the same line. But when i try to submit solution test number 2 break all my hopes. What is the input data for test 2 and expected answer? thanks a lot I have same situation as author. Tried few different approaches - WA #2. Can we please have the data?) Thanks in advance Geometric solution I wrote has the same problem. With pass all of my own tests it got WA on test2. If it could be, please, give me test2 and output for it. |
| python - runtime error test 1 | Kostya | 1397. Points Game | 30 Jan 2016 01:44 | 1 |
u menja uzhe gorit proboval ispravit' vse - ne pomogaet zada4a to4no rewaetsja na pyhon? |
| WA3 | KirillB(Arkhangelsk - PomorSU) | 1949. The Best Picture in the Galaxy | 29 Jan 2016 19:05 | 2 |
WA3 KirillB(Arkhangelsk - PomorSU) 5 Jan 2013 22:15 I've used greedy algo, but got WA3. What's wrong? Re: WA3 Tolstobrov Anatoliy[Ivanovo SPU] 29 Jan 2016 19:05 4 2 10 15 10 1 11 13 16 19 15 17 20 12 I believe greedy will take 1010 for first student 0100 for second student But possible 1001 for first student 0110 for second student Answer should be 1111 |
| test № 9 | alex23121967 | 1118. Nontrivial Numbers | 29 Jan 2016 16:51 | 1 |
|
| solved | Elpsycongroo | 1009. K-based Numbers | 28 Jan 2016 07:43 | 3 |
solved Elpsycongroo 13 Jan 2016 16:05 Edited by author 21.01.2016 20:56 Edited by author 21.01.2016 20:56 неправильно: n=3 k=10 =>891 n=4 k=10 =>8829 ещё тесты: n=16 k=2 =>1597 n=8 k=8 => 13464808 и ещё:использовать лучше самый большой тип |
| Why Wa3 | yuzeming | 1101. Robot in the Field | 28 Jan 2016 05:30 | 2 |
For me, this was reading outside the field (likely at N = 100). |
| Wrong answer in Java why? | Denis | 1001. Reverse Root | 28 Jan 2016 02:11 | 1 |
import java.text.*; import java.util.*; public class Main { public static final int TREAD_MAX_SIZE = 262144; public static void main (String[] args) { DecimalFormatSymbols s = new DecimalFormatSymbols(); s.setDecimalSeparator('.'); DecimalFormat f = new DecimalFormat("0.0000",s); Scanner scan = new Scanner(System.in); int size = 0; String string = ""; while (scan.hasNextLine()) { String line = scan.nextLine(); int sizeline = line.length(); size += sizeline; if (size <= TREAD_MAX_SIZE) { string += line; } else { break; } } scan.close(); double min = 0; double max = Math.pow(10, 18); String[] str = string.trim().split("\\s+"); for (int i = str.length - 1; i >= 0; i--) { Double val = Double.valueOf(str[i]); if (val >= min && val <= max) { val = Math.sqrt(val); System.out.println(f.format(val)); } } } } What's wrong? Code without checking the boundary conditions passed test (0 ≤ Ai ≤ 10^18 and 256КB)! Why? Edited by author 28.01.2016 14:06 |
| hint | [kubsu] Eugene Kudinov | 1846. GCD 2010 | 27 Jan 2016 21:29 | 2 |
hint [kubsu] Eugene Kudinov 27 Jan 2016 18:49 I used segment tree with update func and HashMap for indexes of elements(+). Java AC 0.34sec Edited by author 27.01.2016 19:10 Edited by author 27.01.2016 19:38 Edited by author 27.01.2016 19:49 vector of segments and binary search also must work |
| help me please! | 〇$十ვ尸 | 1563. Bayan | 27 Jan 2016 18:39 | 3 |
i have WA on test #3 my code here: #include <iostream> using namespace std; int main() { int n, s = 0; cin >> n;
string *arr = new string[n]; string a; getline(cin, a); for(int i = 0; i < n; i++) { getline(cin, a); for(int j = 0; j < i; j++) { if(a == arr[j]) { s++; break; } else arr[i] = a; } }
cout << s << endl;
return 0; } Edited by author 26.01.2016 21:58 Try test: 2 a a - Your answer is 1, expected is 0 Also your solution has O(n*n) complexity. I expect (or at least hope) you will have TLE. Edited by author 27.01.2016 18:07 Can't edit prev message. > Your answer is 1, expected is 0 Should be: Your answer is 0, expected is 1 |
| Time limit exceeded | Kumar Shashwat | 1001. Reverse Root | 27 Jan 2016 17:23 | 4 |
#include <iostream> #include <cmath> #include <vector> using namespace std; int main() { cout.setf(cout.fixed); cout.setf(cout.showpoint); cout.precision(4); vector <double> a; double c; while(cin>>c) { a.push_back(sqrt(c)); } for(int i = a.size()-1;i>=0;i--) cout << a[i] << endl; } You should use long long instead of double Probably gcc? Try to select MSVC compiler. Also you can try using printf/scanf instead of cin/cout. |
| 2test | SProf | 1316. Electronic Auction | 27 Jan 2016 01:43 | 1 |
2test SProf 27 Jan 2016 01:43 i have wa on 2 test.can someone help me.i'm trying to solve it with fenwick. |
| 1991. Битва у болота // please,need help! where is the mistake& | kodirmullaboyev | 1991. The battle near the swamp | 25 Jan 2016 12:34 | 1 |
import java.util.Scanner; /** * Created by Oxygen! on 25.01.2016. */ public class BitvaUBolota1991Var2 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int x=0,y=0; int n=sc.nextInt(); int k=sc.nextInt(); int a[]=new int[n]; for(int i=0; i<n; i++) { a[i]=sc.nextInt(); if(a[i]<=0) { y+=k-a[i]; } else { x+=a[i]-k; } System.out.println(x+" "+y); } } } |