| Show all threads Hide all threads Show all messages Hide all messages |
| cho em xin test input va output | [TH2011/01]1112375 | 1119. Metro | 21 Apr 2013 20:22 | 2 |
em test thử tren visual 2010 ra kết quả nhung khi nop len acm toan in ra cau tra loi sai |
| !!!!USE ROUNDING!!! | XSpider | 1011. Conductors | 21 Apr 2013 18:04 | 2 |
without round function i got WA #14. When i used it i got AC! #include <iostream> #include <cmath> using namespace std; double round(double d); int main() {double P, Q; #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif cin>>P>>Q; P/=100; Q/=100; int i=2; while(true) {double min=round(i*P); double max=round(i*Q); int C=int(max); if(C>min && C<max && C>=1) break; i++; } cout<<i; return 0; } //--------------------------------------------------------------------------- double round(double d) {return floor(d*10000+0.5)/10000; } |
| 0.171 1 298 КБ | lmikle | 1100. Final Standings | 21 Apr 2013 12:59 | 2 |
Done :) Edited by author 19.07.2011 09:10 |
| WA# 14 | IgorKoval [PskovSU] | 1578. Mammoth Hunt | 21 Apr 2013 03:13 | 1 |
WA# 14 IgorKoval [PskovSU] 21 Apr 2013 03:13 If you get WA# 14 this test maybe help you: 2 0 1 1 0 1 1 2 1 answer: YES 1 4 2 3 |
| Hint | Серовиков Андрей | 1144. The Emperor's Riddle | 21 Apr 2013 02:43 | 1 |
Hint Серовиков Андрей 21 Apr 2013 02:43 First of all, it should be noted that in the literature such problem is known as "bottleneck multiple subset sum problem" (B-MSSP) and it's a variation of knapsack problem. This problem even with such restrictions is an NP-complete. So, the aproximate solution even needed. Precision??? The precision is mystic (based on statement of the problem). I don't know how other people solved this problem, but I aproximate solution through aproximation of every pair of subsets. To aproximate a pair of subsets we need to solve B-MSSP just for 2 subsets. This can be solved in O( (|S1|+|S2|)*max(Ai) ) time and O( max(Ai, |S1|+|S2|) ) space complexity. |
| WA2 | mnzhkv | 1256. Cemetery Guard | 20 Apr 2013 05:22 | 1 |
WA2 mnzhkv 20 Apr 2013 05:22 |
| 2 admin: (java) what is in test #2 ? (I'm getting runtime error) | Ozzy | 1220. Stacks | 20 Apr 2013 01:02 | 1 |
hi can you please show / send me some hint about test #2 ? (I think you can see the source code of my attempt) p519446 at yandex.ru TIA. |
| python and reading from files | TinyJanssen | | 20 Apr 2013 00:22 | 3 |
I am learning python. When i see the example of problem 1000 and 1001, python reads from stdin. How can i read from input.txt without changing my program every time i send it in. e.g. pascal uses #ifdef online_judge to read from files In linux I prefer to use this command: xclip -out | python problem.py It takes input from clipboard and send it to script. I use Windows on my computer. When i define a function like def invoer(place): if place=='file': f = open('input.txt', 'r') regel=f.readline() print(sum(int(x) for x in regel.split(' '))) f.close() else: print(sum(int(x) for x in input().split(' '))) invoer('console') I can use a file. Is there a smarter way? |
| (java) is there some tasks for threads ? | Ozzy | | 19 Apr 2013 22:21 | 1 |
hi all I'm interesting on praxis to solve tasks using java threads. Do we have here such ones ? |
| Yesss!... 0.281s 1520 Kb (java) | Ozzy | 1613. For Fans of Statistics | 19 Apr 2013 22:14 | 1 |
Many thanks to author of this task and Oleg Strekalovsky [Vologda SPU] for the hint ( http://acm.timus.ru/forum/thread.aspx?id=22536&upd=634614144741133716 ). PS. It is very unexpectedly to me that some collection types (e.g. HashMap) take so much memory and CPU time in java :-/ Edited by author 19.04.2013 22:14 Edited by author 19.04.2013 22:14 |
| TLE 9 | Facundo | 1684. Jack's Last Word | 19 Apr 2013 20:56 | 1 |
TLE 9 Facundo 19 Apr 2013 20:56 What the hell is test 9? In my computer I got 0.06s in worst case but still TLE 9! |
| What is 10 test? | Роман | 1119. Metro | 19 Apr 2013 11:44 | 6 |
Write me 10 test, please ! I dont know test 10.But I can help you if you give me your algo or code. I have already solved this problem. my email is ibragim.atadjanov@gmail.com First I got WA on test 10.Because my DP solution is wrong: this is AC solution: tt[0].a=tt[0].b=0; for(int i=1;i<=k;i++) { scanf("%d%d",&tt[i].a,&tt[i].b); } sort(tt,tt+k+1,cmp); memset(dp,0,sizeof(dp)); for(int i=1;i<=k;i++) { for(int j=0;j<i;j++) { if(tt[j].a<tt[i].a&&tt[j].b<tt[i].b) { dp[i]=max(dp[j]+1,dp[i]); } } }
this is WA solution for(int i=1;i<=k;i++) { scanf("%d%d",&tt[i].a,&tt[i].b); } sort(tt+1,tt+k+1,cmp); memset(dp,0,sizeof(dp)); dp[1]=1; for(int i=2;i<=k;i++) { for(int j=1;j<i;j++) { if(tt[j].a<tt[i].a&&tt[j].b<tt[i].b) { dp[i]=max(dp[j]+1,dp[i]); } } } sorry for my poor English .hope to help~ |
| To Admins | AsgarJavadov | 1018. Binary Apple Tree | 18 Apr 2013 19:57 | 1 |
I guess there is a test case that the condition 1<=Q<=N-1 is not satisfied. I put a condition that if Q is outside the given interval then output 0 and got WA#1. Without this condition, it gives WA#8. Edited by author 18.04.2013 20:01 |
| Compilation error | Dmitry | 1769. Old Ural Legend | 18 Apr 2013 13:09 | 2 |
My programm works on my computer. Timus gives me this verdict. Why it may be?I write on C++ in Dev. May be I cannot use strings? Edited by author 16.03.2011 20:11 for string you should write #include<string> |
| why is the code Time limit exceeded? | zhao kai | 1880. Psych Up's Eigenvalues | 18 Apr 2013 12:20 | 1 |
#include <iostream> #include <map> using namespace std; int main() { map<int,int> table; int x,y,sum = 3; while(sum--) { cin >> x; while(x--) { cin >> y; table[y]++; } } int s = 0; for(int i = 0;i < table.size();i++) if(table[i] == 3) s++; cout << s; return 0; } |
| Why WA 5? | tzupengwang | 1745. Yet Another Answer | 17 Apr 2013 21:43 | 1 |
|
| why WA 14? please help me !!!!! | TUITUF_Bahrom | 1226. esreveR redrO | 17 Apr 2013 18:14 | 2 |
import java.util.Scanner; public class T_1226_esreveR_redrO { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String set="ABCDEFGHIJKLMNOPQRSTUVXYZWabcdefghijklmnopqrstuvxyzw"; String s =sc.nextLine(); String p=""; for (int i = 0; i < s.length(); i++) { if(set.indexOf(s.charAt(i)+"")>-1) p=s.charAt(i)+p; else{ System.out.print(p); p=""; System.out.print(s.charAt(i)); } } System.out.println(p); } } } public class T_1226 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String l = ""; char c; while (br.ready()) { char s = (char) br.read(); if ((65<=s && 90>=s)||(97<=s && 122>=s)) { l = s + l; } else { System.out.print(l + s); l = ""; } } System.out.print(l); } } My code Accepted!!! Edited by author 17.04.2013 18:28 |
| Problem 1414 Astronomical Database is rejudged | Problemset Maintainer | 1414. Astronomical Database | 17 Apr 2013 11:40 | 1 |
Time limit is changed from 4 to 2 seconds. First test is changed to the sample. Submissions are rejudged. |
| WA #5, please tell me, what's my mistake? | Uzbek boy | 1306. Sequence Median | 16 Apr 2013 14:34 | 1 |
#include<iostream> #include<queue> #include<stdio.h> using namespace std; int main() { int n,i,k,m,n1,n2; priority_queue<int>a; cin>>n; m=n/2+1; for(i=1;i<=m;i++) { cin>>k; a.push(k); } for(i=m+1;i<=n;i++) { cin>>k; a.push(k); a.pop(); } if (n%2) printf("%.1f",1.0*a.top()); else { n1=a.top(); a.pop(); n2=a.top(); printf("%.1f",((float)n1+(float)n2)/2); } system("pause"); return 0; } |
| To admin | zhzqkkk | 1520. Empire Strikes Back | 16 Apr 2013 11:28 | 2 |
76 85 46 -22 4 15 -10 14 -12 7 -14 20 17 42 11 15 10 -10 60 15 18 -10 43 -51 27 22 -50 -32 -60 -11 -3 -29 -65 -13 -10 2 37 -7 9 -37 -39 42 80 -28 55 -41 -7 -77 -11 17 -6 -54 -55 -48 8 -58 -17 -52 -42 -8 26 -4 24 -13 29 41 -52 14 12 17 55 12 -50 43 27 -8 -33 -78 -42 -2 2 -71 -39 -6 52 -5 -25 62 -51 -2 -19 45 10 12 3 47 -61 37 13 -41 -7 -12 -7 -25 12 15 44 5 -47 -8 -3 -17 -12 -60 -2 28 37 -5 29 -7 -59 61 -17 50 -42 -19 26 51 -10 11 10 5 -1 31 -50 -23 7 -35 29 -47 -5 21 -69 11 13 -17 26 3 13 58 -40 30 -20 -12 please add this test i found many AC program can't pass it.(they use Simulated Annealing) 58 88 40 -15 16 -18 -35 -53 -26 10 10 -64 -19 33 25 48 75 6 12 -65 29 31 -1 57 30 12 27 17 44 -11 24 -2 16 -25 21 -4 -57 24 51 25 26 20 -12 -27 23 -29 -22 6 13 -4 -11 -57 -18 17 -32 -22 -70 -17 -31 22 -47 69 -53 -64 -23 20 33 10 -13 -8 11 -25 -5 68 73 23 49 -15 68 -31 -33 -56 6 36 -13 -51 0 79 55 36 24 -1 54 -13 -21 -16 16 40 -38 11 15 3 20 -2 18 10 -16 27 -41 23 48 -24 35 -39 -61 10 -51 -14 also a good test at last ,sorry for my poor english |