| Show all threads Hide all threads Show all messages Hide all messages |
| k=7 | Temur | 1023. Buttons | 17 Apr 2016 15:16 | 2 |
k=7 Temur 25 Nov 2015 16:33 Re: k=7 IlushaMax 17 Apr 2016 15:16 No. Because we know that if k=3 then answer 2. So we can remove 3 buttons from bunch. And find answer for k=4, but answer for this input will be 3. So 2!=3 and such answer is wrong. So answer will be 6 (cause we can't divide it on groups answer for those we know). |
| WA #2 runtime error (access violation)who can tell me why? | gingogo | 1136. Parliament | 16 Apr 2016 23:25 | 1 |
|
| Hint : How to find out reason of WA | IlushaMax | 2035. Another Dress Rehearsal | 16 Apr 2016 15:32 | 1 |
Just list all of cases like x>=y>=c or y>=x>=c and you'll understand |
| Whats wrong in this solution. (C++) | Tapish | 1001. Reverse Root | 16 Apr 2016 02:36 | 1 |
|
| Please help, why WA on test #6? | Natasha | 1207. Median on the Plane | 15 Apr 2016 16:12 | 1 |
//1152 #include <iostream> #include <vector> #include <cmath> using namespace std; int main() { int n, x0, y0, index0; cin >> n; if (n == 2){ cout << 1 + ' ' + 2; } else { vector<vector<int>> p(n, vector<int>(2)); // [x, y] vector<double> k(n); for (int i = 0; i < n; i++) { cin >> p[i][0] >> p[i][1]; } x0 = y0 = 2147483647; for (int i = 0; i < n; i++) { if (p[i][0] < x0 ||p[i][0] == x0 && p[i][1] < y0){ x0 = p[i][0]; y0 = p[i][1]; index0 = i; } } for (int i = 0; i < n; i++) { //y = kx + m if (i == index0) { k[i] = 9223372036854775807; } else { if (x0 == p[i][0]) { k[i] = 9223372036854775807; } else { k[i] = (p[i][1] - y0) / (p[i][0] - x0); } } }
vector<int> d(n); for (int i = 0; i < n; i++) { d[i] = i; } double tempD; int tempI; for (int i = n - 1; i >= 0; i--) { for (int j = 0; j < i; j++) { if (k[j + 1] < k[j]) { tempD = k[j + 1]; k[j + 1] = k[j]; k[j] = tempD; tempI = d[j + 1]; d[j + 1] = d[j]; d[j] = tempI; } } } cout << index0 + 1 << ' ' << d[n / 2 -1] + 1; } return 0; } |
| Please help with solution | g00d | 1115. Ships | 15 Apr 2016 03:30 | 2 |
I wrote program on Python 3, but second test is wrong for me. Why? I need a hint. Maybe, you can wrote test for my program? Idea: 1. sort length descending 2. take first that smaller SUM in row 3. reduce SUM and colored ship 4. take next 5. finally for SUM if they == 0 -> go to next row My solution: [n, m] = [ int(x) for x in input().split() ] a = [] for i in range(n): a.append(int(input())) b = [] for i in range(m): b.append(int(input())) a.sort(reverse=True) color = [-1 for x in range(n)] i = 0 while i < m: s = b[i] z = 0 while z < n: aa = [] j = z while s > 0: while j < n and a[j] > s : j += 1 if j >= n: for ee in aa: s += a[ee] color[ee] = -1 aa = [] break elif color[j] != -1: j += 1 else: s = s - a[j] aa.append(j) color[j] = i z += 1 if s == 0: break i += 1 for i in range(m): aa = [] cnt = 0 for j in range(n): if color[j] == i: aa.append(a[j]) cnt += 1 print(cnt) aa.sort(reverse=True) ab = [str(x) for x in aa] ss = " ".join(ab) print(ss) please, never post your code here! use pastebin or ideone! |
| Precision | Filip Franik | 1640. Circle of Winter | 14 Apr 2016 15:51 | 2 |
The statement describes the precision as 10^-9, but in the second example I see "1.41421356237309" This number has 14 digits behind decimal point. I tried submitting answers with precision 9, 14 and 16. They all WA#1 even though my calculations have to be correct. Does someone know what's the correct precision? Edited by author 14.04.2016 15:20 Edited by author 14.04.2016 15:20 Are you using a high enough precision type? And hopefully don't output anything extra like "result="? Show your code or something. |
| Pascal reverse root | Johanes Patrick S | 1001. Reverse Root | 14 Apr 2016 13:45 | 5 |
var a,b,c,d,e,f,g,h : real begin read(a,b,c,d); e := sqrt(a); f := sqrt(b); g := sqrt(c); h := sqrt(d); writeln(h:0:4); writeln(g:0:4); writeln(f:0:4); writeln(e:0:4); end. why is my answer wrong? Have you read task? Why no? You should try. >Input > The input stream contains a set of integer numbers. The numbers are > separated by any number of spaces and line breaks. A size of the input > stream does not exceed 256 KB. Edited by author 13.04.2016 13:14 i racked my brain, but i unable found solution so can i look your source code in pascal? Sure no. 1) Why do you think I know pascal? 2) Problem is 2nd easiest here. You should be able to solve it yourself. What problem do you have? How to read numbers from stream? http://acm.timus.ru/help.aspx?topic=pascal"How to read input data until the end of stream" topic How to estimate max input size? It's about 256K/2 numbers. How to print results in reverse order? Pff. Give up for a while and learn programming. Edited by author 13.04.2016 14:00Where the stop position if there is only one input? I am confused, please explain the problems. |
| usefull hint(prime number) | Дмитрий | 1118. Nontrivial Numbers | 14 Apr 2016 04:22 | 1 |
For those who using prime numbers! Search biggest prime number that <= max!!! NOT first prime number that >=min !! |
| What's wrong? It's working! | Дмитрий | 1249. Ancient Necropolis | 13 Apr 2016 15:57 | 1 |
У меня получилось вот что I have this: > http://ideone.com/8CHWDd Почему проверка считает что ответ неверен Why it's wrong? |
| runtime error | user_is_null | 1085. Meeting | 13 Apr 2016 14:02 | 1 |
test 11.please give me some test.thx! |
| What's the ? with the 5-th test ?.. | {AESC MSU} Junk | 1651. Shortest Subchain | 12 Apr 2016 22:41 | 3 |
My solution is O(n) and I can prove it. All tests from forum were successfully passed. Solution's body is 31 strings (without var declaratoins, etc.) and I am looking for mistakes more than an hour. So I suppose, there is no bug..( But I have WA5. Mabe some incorrect input ? Or some thing I didn't notice ? If u have got any idea or maybe test, please, help.. Edited by author 14.08.2009 05:39 |
| Планируется ли добавить язык Rust для написания решений? | maxormo | | 12 Apr 2016 13:09 | 1 |
|
| WA 25! | Ta'al | 1325. Dirt | 12 Apr 2016 09:07 | 2 |
WA 25! Ta'al 20 May 2014 21:44 Re: WA 25! Jane Soboleva (SumNU) 12 Apr 2016 09:07 Example test: 8 8 1 1 8 8 22122111 22121122 22212211 11111222 11122211 22212222 22112121 11122221 Distance table of my TLE21 solution: 0 1 2 4 4 5 6 7 1 1 2 3 4 5 6 7 2 2 2 3 4 5 6 7 3 3 3 3 4 5 6 7 4 4 4 7 6 6 6 7 10 9 8 5 7 7 7 8 10 9 6 6 8 8 8 8 8 7 7 9 9 9 9 9 Distance table of my WA25 solution: 0 1 2 4 4 5 6 7 1 1 2 3 4 5 6 7 2 2 2 3 4 5 6 7 3 3 3 3 4 5 6 7 4 4 4 7 6 6 6 7 10 9 8 7 7 7 7 8 10 9 8 8 8 8 8 8 10 9 9 9 9 9 9 9 Gotta investigate it yet... |
| give a easy answter | ACMDragon | 1001. Reverse Root | 11 Apr 2016 16:54 | 1 |
#include<stdio.h> #include<math.h> double str[300000]; using namespace std; int main() { double a; int w=0; while(~scanf("%lf",&str[w])) w++; for(int i=w-1;i>=0;i--) printf("%.6f\n",sqrt(str[i])); return 0; } //Don't use cin or cout //str[N],Nshould>=262144 |
| to authors | arrammis | 1731. Dill | 11 Apr 2016 14:47 | 2 |
Why this answer for test 1 gets WA 2 3 1 2 3 4 5 ????????? algorithm is just print on 1 ... n then n+1 ... n+m what's wroung with this??????????????? The algorithm is not 1 ... n n+1 ... n+m In your answer 1 + 4 = 2 + 3 This violates the condition "Ivan Vasil'evich considered all the possible variants and saw that this was impossible" |
| Литература | Angel | | 11 Apr 2016 07:57 | 1 |
Что пивело Гоголя к смерти? Edited by author 11.04.2016 08:03 |
| Литература | Angel | | 11 Apr 2016 07:57 | 1 |
что привело Гоголя к смерти? Edited by author 11.04.2016 08:03 |
| AC 0.0001 C++ | Barish_Namazov | 1404. Easy to Hack! | 10 Apr 2016 22:28 | 1 |
|
| Задача 1001 | rafaelkelevro | 1001. Reverse Root | 10 Apr 2016 00:45 | 3 |
Задача простая. Но вопрос таков: Из правил сайта я понял, что входные данные вводятся только и только через консоль, не считываются с файла. Если это так, то как определить что входные данные уже вбиты?? Из задания понятно, что вводятся целые числа не больше 10 в степени 18, до каких пор будут вводится входные данные? есть какой нибудь стоп кондишн? Чтобы у себя тестировать, можно либо сделать выход при встрече данных, которые заведомо не встречаются, например while not eof do begin ... read(x); if x < 0 then break; ... end; Либо, более хороший способ, использовать IFNDEF ONLINE_JUDGE. По ссылке "руководство" для большинства языков описано, что нужно делать. Is your language is java? You can assume that System.In is stream to real existing file with input data. You should read from System.in (directly or using Tokenizer/Scanner) until you reach EOF. The only stop condition for this task is you've reached EOF. |