| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Why WA?Here is my program can anybody help me :( | mariam kupatadze | 1164. Fillword | 6 май 2017 22:33 | 2 |
Here is my program,I have taken WA on the test of 2, I think it is correct,please tell me what is wrong,please if you can.. program fillword; var a:array[1..10] of string; b,k:array[1..100] of string; i,j,n,m,p,t:integer; ch:char; l,r:string; begin read(n,m,p); readln; for i:=1 to n do readln(a[i]); for j:=1 to p do readln(b[j]); for i:=1 to p do for j:=1 to n do if b[i]=a[j] then begin t:=t+1; k[t]:=b[i]; break; end; for i:=1 to t do begin r:=''; l:=k[i]; for ch:='A' to 'Z' do for j:=1 to m do if ch=l[j] then r:=r+ch; writeln(r); end; end. 9 years later... >for i:=1 to p do > for j:=1 to n do I suppose, it shouldn't be to p... |
| Several data to KILL your program with PRECISION problems. | 198808xc | 1265. Зеркало | 4 май 2017 17:37 | 4 |
BTW: I have used self-implemented high-precision longint to solve this problem. 1000 0 0 -1000 0 0 1000 1000 VISIBLE 1000 -0.000001 0 -1000 0 0 1000 1000 INVISIBLE 1000 0 -0.000001 -1000 0 0 1000 1000 INVISIBLE 1000 0 0.000001 -1000 0 0 1000 1000 VISIBLE 1000 -0.000001 0.000001 -1000 0 0 1000 1000 VISIBLE 1000 -1000 999.999999 -1000 0 0 1000 1000 INVISIBLE 1000 -1000 999.999999 -999.999999 0 0 1000 1000 VISIBLE -999.999999 -1000 1000 999.999999 0 0 1000 1000 VISIBLE 1 2 1 0 0 0 0 1 VISIBLE 1.000001 2 1 0 0 0 0 1 VISIBLE 0.999999 2 1 0 0 0 0 1 INVISIBLE 1000 0 1000 -0.000001 0 0 0.000001 1000 VISIBLE 1000 0 1000 -0.000002 0 0 0.000001 1000 VISIBLE 1000 0 1000 -0.000003 0 0 0.000001 1000 INVISIBLE 2 more test which help me get AC, I fails on checking that both points on 1 side of line. 40 60 59 40 50 30 90 70 VISIBLE 40 60 61 40 50 30 90 70 INVISIBLE |
| Why WA 1#? | ananimus_vs16 | 1601. АнтиКАПС | 3 май 2017 16:32 | 1 |
var s: array[1..50] of string; si, i1, i, c: integer; input, output: text; begin {$IFNDEF ONLINE_JUDGE} assign(input, 'input.txt'); reset(input); assign(output, 'output.txt'); rewrite(output); {$ENDIF} while not seekeof(input) do begin inc(si); read(input, s[si]); end; c := 1; for i := 1 to si do for i1 := 1 to length(s[i]) do begin if c = 0 then s[i][i1] := lowercase(s[i][i1]); if (c = 1) and (s[i][i1] <> ' ') and (s[i][i1] <> '-') and (s[i][i1] <> ':') then c := 0; if (s[i][i1] = '?') or (s[i][i1] = '.') or (s[i][i1] = '!') then c := 1; end;
for i := 1 to si do writeln(output, s[i]); {$IFNDEF ONLINE_JUDGE} close(input); close(output); {$ENDIF} end. |
| really don't understand how somebody got AC in 0.001s | Ade | 1102. Странный диалог | 2 май 2017 12:16 | 2 |
Maybe finite state automation. |
| hint | Mostafa Tantawy | 1319. Отель | 29 апр 2017 21:48 | 1 |
hint Mostafa Tantawy 29 апр 2017 21:48 divide the matrex into three divisions >> above the diagonal >>> the diagonal>>under the diagonal simulate more than matrix for insure your answer |
| How to solve this problem in Python 3.4? | JuliM | 1100. Таблица результатов | 29 апр 2017 14:28 | 3 |
All mentioned solutions cause TLE. I have got "accepted" on python 2.7 even with very ineffective variant, and python 3.4 always writes TLE ?????? I have same problem! This solution difficult is O(n), but i got TLE #11 [code cuted] I send this code with python 2.7 and got AC with time 0.67. lol) Edited by author 30.04.2017 12:38 |
| У меня все верно, на сервере WA1. Как так? | MNaz | 1100. Таблица результатов | 29 апр 2017 14:26 | 5 |
Нашел ошибку. =) Edited by author 12.05.2014 09:33 То же самое у меня, WA1 и все тут, хотя у меня нормально проходило и другие тесты. Вчем была ошибка ? I have WA1 too, i cant understand why, because example from briefing was ok. Python code: from sys import stdin, stdout N = int(stdin.readline()) D = {} for i in range(N): inp = stdin.readline().split(' ') D[inp[0]]=int(inp[1])
for tup in sorted(D.items(), key=lambda x: x[1], reverse=True): print(tup[0], tup[1]) In that problem the solution is a STABLE sort. В этой задаче решением является УСТОЙЧИВАЯ сортировка. Спасибо за ответ! Не понял этого из описания задачи |
| Someone just answer "yes" or "no"...... | Jaideva | 1577. Электронная почта | 28 апр 2017 23:02 | 2 |
Is this a problem for counting the number of shortest common superstrings ??? |
| Try to use Python2.7 if you have Python3.4 TLE | Mahilewets | 1246. Собака на привязи | 28 апр 2017 17:04 | 1 |
Python3: TLE #8 Python2: AC 0.8 sec Code is the same. (Pseudo-vector product) Edited by author 28.04.2017 17:08 |
| Implementation | competitivecoder | 1320. Разбиение графа | 28 апр 2017 02:55 | 2 |
Posting code is not a nice idea. Moreover it is not ideal. |
| WA #14 | mezkresh | 1320. Разбиение графа | 28 апр 2017 02:53 | 2 |
WA #14 mezkresh 28 мар 2016 18:24 In general this task is quite hard to make bugs if you know what to do... What is your approach? |
| How i must output anwser? | Felix_Mate | 1542. Автодополнение | 25 апр 2017 15:38 | 2 |
Написал лобовой вариант и всё равно WA10! Значит, вывод не верен. Кто может подсказать, как выводить ответ?(Форум не помог) #define _CRT_SECURE_NO_WARNINGS #define mk make_pair #include <string> #include <map> #include <iostream> using namespace std; typedef map <string, int> mymap; const int nmax = 100005; mymap t[4 * nmax]; mymap answer[nmax]; string word[nmax]; int cnt[nmax]; int n, m; string w_print[11]; int c_print[11]; mymap Search(int L, int R); int BinaryDown(int L, int R, string s); int BinaryUp(int L, int R, string s); mymap Optimal(mymap map1, mymap map2); void Print(mymap M); void QSort_W(int L, int R); void QSort2(int L, int R); void QSort3(int L, int R); int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> word[i] >> cnt[i]; QSort_W(1, n); cin >> m; for (int i = 1; i <= m; i++) { string s; cin >> s; int L, R; L = BinaryDown(1, n, s); R = BinaryUp(1, n, s); answer[i].clear(); if (L != -1 && R != -1) answer[i] = Search(L, R); } for (int i = 1; i <= m; i++) { Print(answer[i]); if(i!=m) cout<<endl; if(!(answer[i].empty()) && i!=m) cout<<endl; } return 0; } mymap Search(int L, int R) { mymap res; res.clear(); for(int i=L;i<=R;i++) { mymap x; x.insert(mk(word[i],cnt[i])); res=Optimal(res,x); } return res; } void Print(mymap M) { int n = 0; for (mymap::iterator it = M.begin(); it != M.end(); it++) { w_print[++n] = it->first; c_print[n] = it->second; } if (n == 0) return; QSort2(1, n); for (int i = 1; i <= n;) { int j = i + 1; while (j <= n && c_print[j] == c_print[i]) j++; QSort3(i, j - 1); i = j; } for (int i = 1; i<n; i++) cout << w_print[i] << endl; cout << w_print[n]; } void QSort2(int L, int R) { int i, j; int X = c_print[(L + R) / 2]; i = L, j = R; while (i <= j) { while (c_print[i] > X) i++; while (c_print[j] < X) j--; if (i <= j) { string Y = w_print[i]; w_print[i] = w_print[j]; w_print[j] = Y; int k = c_print[i]; c_print[i] = c_print[j]; c_print[j] = k; i++; j--; } } if (L < j) QSort2(L, j); if (i < R) QSort2(i, R); } void QSort3(int L, int R) { int i, j; string X = w_print[(L + R) / 2]; i = L, j = R; while (i <= j) { while (w_print[i] < X) i++; while (w_print[j] > X) j--; if (i <= j) { string Y = w_print[i]; w_print[i] = w_print[j]; w_print[j] = Y; int k = c_print[i]; c_print[i] = c_print[j]; c_print[j] = k; i++; j--; } } if (L < j) QSort3(L, j); if (i < R) QSort3(i, R); } void QSort_W(int L, int R) { int i, j; string X = word[(L + R) / 2]; i = L, j = R; while (i <= j) { while (word[i] < X) i++; while (word[j] > X) j--; if (i <= j) { string Y = word[i]; word[i] = word[j]; word[j] = Y; int k = cnt[i]; cnt[i] = cnt[j]; cnt[j] = k; i++; j--; } } if (L < j) QSort_W(L, j); if (i < R) QSort_W(i, R); } int BinaryDown(int L, int R, string s) { for(int i=L;i<=R;i++) if(s==word[i].substr(0, s.length())) return i; return -1; } int BinaryUp(int L, int R, string s) { for(int i=R;i>=L;i--) if(s==word[i].substr(0, s.length())) return i; return -1; } mymap Optimal(mymap map1, mymap map2) { mymap res; res.clear(); if (map1.size() + map2.size() <= 10) { res = map1; for (mymap::iterator it = map2.begin(); it != map2.end(); it++) res.insert(mk(it->first,it->second)); return res; } else { res = map1; for (mymap::iterator it = map2.begin(); it != map2.end(); it++) { if (res.size() < 10) res.insert(mk(it->first, it->second)); else { if (res.begin()->second < it->second) { res.erase(res.begin()); res.insert(mk(it->first, it->second)); } } } return res; } } void Print(mymap M) { ... for (int i = 1; i<=n; i++) cout << w_print[i] << endl; } for (int i = 1; i <= m; i++) { Print(answer[i]); if(i!=m) cout<<endl; } |
| to admin: about multi-edge | Ade | 1004. Экскурсия | 25 апр 2017 08:30 | 3 |
My AC code: input: > 3 3 > 1 2 1 > 1 2 1 > 1 3 1 > -1 output: > No solution. Why not > 1 2 There are two roads connecting "1" and "2", so the route could be 1 - 2 - 1, with different road 1 - 2 and 2 -1 "Each sightseeing route is a sequence of road numbers y1, …, yk, k > 2." Oops. Sorry for bothering! "Each sightseeing route is a sequence of road numbers y1, …, yk, k > 2." |
| To Authors: Solution check program | Sirko | 1541. Погоня | 24 апр 2017 23:10 | 2 |
Have you guys thought about exact, long arithmetic check? |
| for WA15 | Arseny Babushkin (aytel)'` | 2008. Артамончик | 21 апр 2017 23:41 | 1 |
for WA15 Arseny Babushkin (aytel)'` 21 апр 2017 23:41 if you get it, try to change g. i misread the statement and my g was equal to 9.81, not 9.8, then i fixed it and got AC |
| Maybe correct name for that problem is "SINE dance"? | Mahilewets | 1149. Танцы синуса | 21 апр 2017 22:51 | 1 |
Maybe correct name for that problem is "SINE dance"? "Sinus" is something about anathomy. |
| test #1 run-time error | eurol | 1033. Лабиринт | 21 апр 2017 22:47 | 1 |
|
| What to do with multiple roads? | Ade | 1004. Экскурсия | 21 апр 2017 20:47 | 2 |
What's should the following input get? 3 4 1 2 1 2 3 1 1 3 1 1 2 1 3 4 1 2 1 2 3 1 1 3 1 1 2 10 -1 Thanks! got it. My AC code gives 1 2 3 1 2 3 |
| I get AC use brute_force. hope someone can cha me | Shen Yang | 1391. Змейка | 21 апр 2017 06:00 | 1 |
|
| WA 1 | 💻Evgeny Nemtsev [UrFU FT-17]'` | 1373. Pictura ex Machina | 21 апр 2017 02:19 | 2 |
WA 1 💻Evgeny Nemtsev [UrFU FT-17]'` 20 апр 2017 00:21 Precision exactly 4 digits (not >= 4). |