| Show all threads Hide all threads Show all messages Hide all messages |
| What about company name? | MOPDOBOPOT (USU) | 1153. Supercomputer | 8 Aug 2012 10:44 | 2 |
Just push all symbols at one position back.. J -> I C -> B N -> ??? Edited by author 30.07.2012 13:46 |
| Why I got WA 21 test. | Участник | 1601. AntiCAPS | 8 Aug 2012 01:32 | 8 |
This is my code: {$APPTYPE CONSOLE} uses SysUtils; var s: string; f: boolean; newstr: string; i: integer; begin //assign(input, 'input.txt'); reset(input); // assign(output, 'output.txt'); rewrite(output); f:=true; while not eof do begin readln(s); newstr:=''; s:=LowerCase(s); // process for i:=1 to length(s) do begin if f and (s[i] <> ' ') and (s[i] <> ',') and (s[i] <> '!') and (s[i] <> '?') and (s[i] <> '.') then begin newstr:=newstr + UpCase(s[i]); f:= false; end else newstr:=newstr + s[i]; if (s[i] = '?') or (s[i] = '!') or (s[i] = '.') then f:=true; end; writeln(newstr); end; end. i have got the same problem. Can anyoune help us? Anyone HELP ME! I have this problem tooo! In 21 test first symbol is not a letter. May be it's help you In 21 test first symbol is not a letter. May be it's help you Thank you. It's true. -AA. -BB Answer is -Aa. -Bb Something more. There is possible situation: - AAA. - BBB - CCC. And coorect result is: - Aaa. - Bbb - Ccc. (Difference is in space after '-' and new line starts with upper cased char inspite of the fact, there was no any dot or ! or ? at the end of previous line) So, if you'll ask me, I'll say that such conditions aren't fair. Author should mention such details in condition, I suppose. For this test case: - AAA. - BBB - CCC. my accepted program gives: - Aaa. - Bbb - ccc. |
| Why WA#1 | Mad_Sanek | 1005. Stone Pile | 8 Aug 2012 00:54 | 1 |
type list = array[1..21] of longint; var n,i,w1,w2,d:integer; w:list; begin read(n); d:=0; For i:=1 to n do read(w[i]); If n=1 then begin write(w[1]); halt; end; For i:=1 to n div 2 do begin If w1>w2 then w2:=w2+abs(w[i+d]-w[i+d+1]) else w1:=w1+abs(w[i+d]-w[i+d+1]); d:=d+1; end; If n mod 2=0 then write(abs(w1-w2)) else write(w[n]-abs(w1-w2)); end. 1 1 is correct(1). 5 1 8 13 27 14 is correct(3). Test #5 is correct. Where is the mistake? Edited by author 08.08.2012 01:02 |
| For AC. | ilya_romanenko | 1688. Team.GOV! | 7 Aug 2012 19:13 | 4 |
For AC. ilya_romanenko 13 Jun 2011 23:19 If you have WA, you must use long long(or int64 in Pascal).And don't use sum/3>n,use sum>n*3.After that you have AC. По русски. Не используйте типы int(или integer). Используйте типы int64(или long long). При сравнение не сумма/3>выхода,а сумма>выход*3. Желаю всем красивых AC! P.S. Sorry for bad English. Well, this method guarantee you simple AC solution, but to decrease time and get finally 0.015 secs you should come back to 32-bit ints. Keep somewhere the undivided part (the remainder) and try to eliminate it with each new value read. At the time you compare the sum to N (or the remains of N to zero) you should not forget the remainder. Write something as "if(n<0||!n&&r)" in the place of condition. Thanks helped very much!!!! |
| Tests | Paweł Wanat | 1017. Staircases | 7 Aug 2012 18:02 | 3 |
Tests Paweł Wanat 17 Nov 2008 21:55 I've got an AC. Tests: _________ 1 0 ./1017 2 0 ./1017 3 1 ./1017 4 1 ./1017 5 2 ./1017 6 3 ./1017 7 4 ./1017 8 5 ./1017 9 7 ./1017 10 9 ./1017 11 11 Thankx~ : ) Your testcase is really helpful for me! I've got an AC. Tests: _________ 1 0 ./1017 2 0 ./1017 3 1 ./1017 4 1 ./1017 5 2 ./1017 6 3 ./1017 7 4 ./1017 8 5 ./1017 9 7 ./1017 10 9 ./1017 11 11 Edited by author 10.07.2009 14:26thanks! helped very much. |
| WA #4-Java | d_shuren | 1313. Some Words about Sport | 7 Aug 2012 15:57 | 1 |
import java.util.Scanner; public class KVoprosuOSporte { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[][] a = new int[n][n]; int k = 0; int[] b = new int[n * n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { a[i][j] = in.nextInt(); b[k] = a[i][j]; k++; } } for (int i = 0; i < b.length - 1; i++) { for (int j = i + 1; j < b.length; j++) { if (b[i] > b[j]) { int tmp = b[i]; b[i] = b[j]; b[j] = tmp; } } } for (int i = 0; i < b.length; i++) { System.out.println(b[i]); } } } |
| i thin it's work correct, but can't get acc, please help! | wavejke | 1725. Sold Out! | 7 Aug 2012 15:24 | 2 |
where is my mistake? falls on 5th var i,nr,n,k,c:integer; begin read(n,k); nr:=trunc(n/2); if (k>nr) then begin for i:=nr+1 to k-1 do inc(c); end; if (k<nr) then begin for i:=k+1 to nr do inc(c); end; write(c); end. Your code is very bad and solution is wrong too. At first nr:=trunc(n/2) n is even because of this you could write nr=n div 2; 2.for i:=nr+1 to k-1 do inc(c); -----> this is very bad code.If you want something like that you should write c:=k-1-(nr+1)+1; 3.end here should be if (k > nr) Writeln(k -3)
else WriteLn(n - k - 2); |
| My programm accepted... | Usmon | 1054. Tower of Hanoi | 7 Aug 2012 10:00 | 1 |
import java.util.Scanner; public class Hanoi_Tower { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int d[] = new int [n+1]; for (int i = 1; i <= n; i++) { d[i] = sc.nextInt(); } int x =n%2; int a[][] ={{3, 1, 2, 3}, {2, 1, 3, 2}}; double ans = 0; for (int i = n; i > 0; i--) { int y = (i+x)%2; double rep = (ans/Math.pow(2, i) + 1)%3; if (d[i] != a[y][(int)rep]){ if (d[i] != a[y][(int)(rep+1)]){ System.out.println("-1"); return; } ans += Math.pow(2, (i-1)); } } System.out.printf("%.0f",ans); } } |
| WA #5-Java | d_shuren | 1083. Factorials!!! | 6 Aug 2012 17:02 | 1 |
Edited by author 06.08.2012 17:08 |
| What about 10 test? My program here. | Alexander Goncharov | 1542. Autocompletion | 6 Aug 2012 16:25 | 1 |
#include <cstdlib> #include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; bool compar1(pair<string, int> a, pair<string,int> b) { if (a.second>b.second) return true; else return false; } int main(int argc, char *argv[]) { int n = 0; cin >> n; vector<pair<string, int> > v(n); for (int i = 0; i<n; i++) { string tmp; int num; cin >> tmp; cin >> num; v.push_back(make_pair(tmp, num)); } sort(v.begin(), v.end(), compar1); int m = 0; cin >> m; for (int i = 0; i<m; i++) { string str; cin >> str; for (int j = 0; j<n; j++) { if (v[j].first.find(str)==0&&j<10) { cout << v[j].first << endl; } } if (i!=m-1) cout << endl; } system("PAUSE"); return 0; } |
| Java | Vladislav | 1000. A+B Problem | 6 Aug 2012 09:46 | 2 |
Java Vladislav 6 Aug 2012 00:24 import java.io.*; public class D { public static void main (String args []) throws Exception { BufferedReader d = new BufferedReader(new InputStreamReader(System.in)); String v = d.readLine(); BufferedReader e = new BufferedReader(new InputStreamReader(System.in)); String c = e.readLine(); try { int a = Integer.parseInt(v); int b = Integer.parseInt(c); System.out.println(a+b); } catch(Exception e1) {System.out.println("Error translating text to int");} System.out.println(); } } Why Wrong answer?? That he WANT????? Read FAQ how to input numbers |
| WA in Sightseeing Trip | smile_iff | 1004. Sightseeing Trip | 5 Aug 2012 22:25 | 5 |
I read all the posts, collected input test cases posted by people, and passed all of them successfully, but, unfortunately, still i am getting WA#test case 1. Tried everything. But found no clue why my solution is getting WA. Please help me out. Try this test. It helped me. 2 2 1 2 10 1 2 20 -1 No solution. Thank you very much. It helped me as well. Wy answer is "No solution."? Can you explain? We can make trip from 1 to 2 with price 10 and back trip from 2 to 1 with cost 20. It's a cycle with minimum cost I think, it's because of > Each sightseeing route is a sequence of road numbers y1, …, yk, k > 2. Pay attention at "k > 2", it tricked me too. |
| Why time limit exceeded | Arsenal911 (Samara) | 1726. Visits | 5 Aug 2012 07:33 | 3 |
Why time limit exceeded on test#9? Maybe you use O(n^2) algo? You can do it in linear time. |
| WA7 | Peca | 1080. Map Coloring | 4 Aug 2012 20:49 | 1 |
WA7 Peca 4 Aug 2012 20:49 Does someone knows what is the 7th test? Than you very much! |
| Here's Solution | Meirambek | 1196. History Exam | 4 Aug 2012 15:27 | 1 |
//Solution By Omyrzak Meirambek #include <iostream> #include <fstream> #include <cstdio> #include <math.h> #include <queue> #include <stack> #include <set> #include <string> #include <utility> #include <cstdlib> #include <algorithm> #include <ctime> #include <vector> #include <map> using namespace std; #define fname "" #define ull unsigned long long #define ll long long #define INF 1000*1000*1000 const int N = 20000; map <int, int> q; int n, x, res = 0, m; int main () { #ifndef ONLINE_JUDGE freopen ("in","r",stdin); freopen ("out","w",stdout); #endif cin >> n; for (int i = 1; i <= n; i ++ ) { cin >> x; q[x] = 1; } cin >> m; for (int i = 1; i <= m; i ++ ) { cin >> x; res += q[x]; }
cout << res; return 0; } |
| wa#14 WHO CAN HELP ME??? PLEASE GUYS!!! | N0D1R | 1759. Long-Livers | 4 Aug 2012 13:37 | 1 |
Edited by author 04.08.2012 18:24 |
| floyd-warshall or Dijkstra? | Sergey Zuev | 1085. Meeting | 4 Aug 2012 02:38 | 6 |
Should I use Dijkstra's algorithm several times for each friend or just floyd-warshall? ..? good q .. but .. ! all the edge's cost's are 1 .. so .. :-) use BFS .. for every friend from its starting position :-) its n*k :-) .. but i got WA 14 :-( ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~ now i get it .. the WA's in the discuss are very useful :-) and .. with my o(n*k) i had .. 0.031 264 KB Edited by author 13.09.2010 22:03 Edited by author 13.09.2010 22:03 Are you sure it's O(n*k)? I used DFS from every tramstop to find how much it costs for all of friends to meet here. This test helped me a lot (it's funny to draw circles): 13 5 3 1 2 3 3 4 5 3 3 6 7 3 3 8 9 3 8 10 4 11 6 12 8 13 1 I corrected all mistakes by adding different situations on this tram-map :) |
| WA25, help me please | Artyom Averin [Psych Up club] | 1884. Way to the University | 4 Aug 2012 00:41 | 1 |
Please help me, guys, I don't know what's the problem:( #include <iostream> using namespace std; int lft[320], rght[320]; double timeleft[320], timeright[320]; double const eps = 0.0000001; int main(){ int n,m; cin >> n; for(int i = 1; i <= n; i++){ cin >> lft[i]; timeleft[i] = (lft[i] + 5.000)*9/50; } cin >> m; for(int i = 1; i <= m; i++){ cin >> rght[i]; timeright[i] = (rght[i]+5.000)*9/50 - 36.000/25; } double ans = 1000000000; if(lft[1] >= 8 && (rght[1] >= 16 || (rght[1] <= 3 && (rght[2] >= 16 || m == 1)))){ cout << 0; return 0; } for(int i = 1; i <= n; i++){ double cur = timeleft[i]; bool b = 0; if(lft[i+1] - lft[i] >= 13 || lft[i+1] == 0){ for(int j = 1; j <= n; j++){ double temp = rght[j] - (cur + 36.000/25)*200.000/36; if(temp > -5 + eps && temp + eps < 8) b = 1; } } else b = 1; if(!b && cur + eps < ans) ans = cur; } for(int i = 1; i <= m; i++){ double cur = timeright[i]; bool b = 0; if(rght[i+1] - rght[i] >= 13 || rght[i+1] == 0){ for(int j = 1; j <= n; j++){ double temp = lft[j] - cur*200.000/36; if(temp - eps > -5 && temp + eps < 8) b = 1; } } else b = 1; if(!b && cur + eps < ans) ans = cur; } printf("%.9f",ans); return 0; } |
| WA24 (hint) | MOPDOBOPOT (USU) | 1088. Ilya Murometz | 3 Aug 2012 18:29 | 1 |
Don't forget cases when Ilya and Alesha are on same way (from root to berth). In my solution lca of positions could be less than they was :) For example: 4 4 4 1 2 0 output: YES 4 2 4 7 7 2 output: YES Edited by author 03.08.2012 18:32 |
| Hello. What about test 15? Can you give it? | Alexander Goncharov | 1571. Interpreters | 3 Aug 2012 16:15 | 1 |
Hello. What about test 15? Can you give it? |