| Show all threads Hide all threads Show all messages Hide all messages |
| 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. |
| ошибка в 1 тесте помогите, на компе дома все работает | Nastya | 1068. Sum | 9 Apr 2016 21:01 | 3 |
#include <iostream> using namespace std;
int main() { long i, n; cin >> n;
if ((n >= 1) && (n <= 10000)) cout << "sum=" << n *(n + 1) / 2;
else if ((n <= 1) && (n >= (-10000))) cout << "sum=" << (-((-n) *(1 -n) / 2) + 1); cout << endl; return 0; } В ответе не нужно писать sum=, только число спасибо огромное, не знала что это считается ошибкой...я тут новичок! все работает) |
| WA #1 - Correct output for sample input - Need help with output formating. | Apurv Nagar | 1263. Elections | 9 Apr 2016 15:48 | 1 |
My code is giving correct output but only till one decimal place when the percentage is in whole number (50.0% instead of 50.00%). I'm using DecimalFormat. Below is my code:- import java.util.*; import java.lang.*; import java.text.DecimalFormat; public class Main { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //candidates int m = sc.nextInt(); //electors double div = 0.0; double per = 0.0; int t = m; int v[] = new int[n]; while (m != 0) { int cv = sc.nextInt(); cv = cv - 1; v[cv] = v[cv] + 1; m--; } for (int i = 0; i <=n-1; i++) { int a = v[i]; div = t/a; per = (1/div * 100.0); per = Double.parseDouble(new DecimalFormat("##.##").format(per)); System.out.println(per + "%"); } } } O/P (For sample Input) 50.0% 33.33% 16.67% |
| почему WA 9 ? помогите | JamesBond_007 | 1120. Sum of Sequential Numbers | 9 Apr 2016 00:43 | 1 |
#include <iostream> #include <math.h> using namespace std; long long i, n, d; double a; int p; int main(){ cin >> n; n *= 2; p =(int) sqrt(n + 0.0); while(1){ a = (n - p * p + p + 0.0) / (2 * p); if(0 < a && a == (int) a && (p * p + 2 * a * p - p) == n) break; p --; } cout << (int)a << ' ' << p; } |
| почему WA 3? помогите | JamesBond_007 | 1028. Stars | 8 Apr 2016 16:51 | 7 |
#include <iostream> #include <stdio.h> #include <algorithm> using namespace std; struct f{ int a, b; }b[64006]; bool shart(f a, f b){ return a.b > b.b; } int x, y, q, n, mx; int main() { cin >> n; q = 1; for (int i = 0; i < n; i ++){ cin >> x >> y; if(b[x + y].a){ b[x + y].a ++; } else{ b[x + y].a ++; b[x + y].b = q; q ++; }
} sort(b, b + 2 * 32002, shart); for (int i = q - 2; i >= 0; i --) cout << b[i].a << endl; for (int i = q; i <= n; i ++) cout << 0 << endl; } You use "X+Y" as level id. I don't think it's good idea. Try test: 3 0 0 0 1 100 0 Answer is: 1 2 0 Edited by author 07.04.2016 16:23 дайте перевод задачи на русском языке, пожалуйста На русском: Уровень звезды = количество звёзд не выше и не правее данной. Даны координаты звёзд, нужно для каждого уровня от 0 до N-1 вывести количество звёзд этого уровня. + (это важно) Звезды во входных данных отсортированы по возрастанию Y координаты, звезды с равными Y координатами отсортированы по возрастанию X координаты. Да, точно, спасибо за дополнение. |
| add test | Ken | 1018. Binary Apple Tree | 8 Apr 2016 14:01 | 2 |
i have a test: 5 2 1 2 1 1 4 20 1 5 20 2 3 10 i think answer is 21 but my AC code answer is 40 maybe i wrong??? Is test correct? Aren't there 3 branches from "1" node? Also, why 40 isn't ok? Let 2 survived branches are "1 4" and "1 5", with 20+20=40 total apples. Edited by author 08.04.2016 14:02 |
| Help please, I don't understand one thing in problem statement | IlushaMax | 1196. History Exam | 7 Apr 2016 21:21 | 3 |
For this test: 2 1492 1492 4 1492 65536 1492 100 Answer is 2 or 4? Ok, but I have not responded to those authors who asked the question. Maybe someone will read it who needs. For example in first case. Anyway I will try to do it less and create my own themes if it so necessary Edited by author 07.04.2016 21:24 |
| Another way to get AC | standy | 1613. For Fans of Statistics | 7 Apr 2016 19:06 | 4 |
You should use a SQRT-decomposition. Let BLOCK = sqrt(N) In kth element of the decomposition you should store hash_set containing numbers from k * BLOCK to (k + 1) * BLOCK. i am getting time limit on test 13 , with sqrt-decomposition. You can solve this task using binary search. Sort all numbers with their indexes. Now if we get query L R X, we use binary search to find all X numbers between our numbers. If we found X in binary search, check it's index, if it's >= l and <=r then answer for query is 1. If such number wasn't found in binary search, answer for query is 0. > if it's >= l and <=r then answer for query is 1 it isn't enough 'cause you can have several cities with the same population and simple binary search finds just one of them 3 666 666 666 1 1 1 666 has to answer 1 |
| Question | Visuian Mihai | 1017. Staircases | 7 Apr 2016 01:05 | 2 |
Hello. I have a question, but it is not really about this problem. Generally asking, if you would be grateful to tell me how can I solve this type of dynamic programming problems, could you tell me how can i find the reccurrence easier? Till now I've made backtrackings on small numbers and I tried to search for a reccurrence between the elements, but I find it out pretty hard. Thank you! So am I.. But sometimes I am trying to calculate how many new figures give us each of them for any N. I don't know is it correct or is it the easiest way, but it sometimes works) |
| Linear Short Solve | brainail | 1026. Questions and Answers | 6 Apr 2016 22:46 | 2 |
var b,a:array[0..100010]of longint; x,i,n:longint; begin readln(n); for i:=1 to n do begin readln(x); inc(a[x]); end; x:=0; for i:=0 to 5000 do while(a[i]>0)do begin inc(x); dec(a[i]); b[x]:=i; end; readln; readln(n); for i:=1 to n do begin read(x); writeln(b[x]); end; end. Edited by author 20.01.2010 18:28 I think size of array "a" is too big(the range of values lies between 1 and 5000)..... ....and of array"b" too (max number of values is 100000 but not 1000010); Edited by author 06.04.2016 22:53 |
| Problem difficulty | Marius Žilėnas | 1026. Questions and Answers | 6 Apr 2016 21:38 | 2 |
This problem can be solved without realisation of sorting. :) If you mean counting sort then it also sorting but without changing places:) Else say pls what is it... |
| lol | Dionis | 1026. Questions and Answers | 6 Apr 2016 20:13 | 8 |
lol Dionis 6 Dec 2007 19:38 Lol 1.5 года назад когда зарегился только задачи такими трудными казались а счас) Вообще лехкотня. Удачи всем парни! Re: lol SorrowAngel 24 Apr 2008 14:37 I THINK YOU REALLY GOOD MAN Re: lol Baranova_ED(YSPU) 28 Dec 2008 22:57 почему только парни? дискриминация Re: lol Ignorance 29 Dec 2008 19:46 I think that your are mistaken thinking that problem will became soon easy for you. They will all times be rather difficult because of competition nature of human life as Marks said. Re: lol Fyodor Menshikov 30 Dec 2008 14:57 лехкотня Жаль, по русскому языку аналога Тимуса нет. Dionis 47 задач за полтора года. Слабовато... Edited by author 30.12.2008 21:02 lol я решил больше за 1,5 месяца |