|
|
Common BoardIF R=0.000999999999 I think (2*R).3f =(0.00199999).3f=0.001 (MY Solution gives 0.001) BUT 2*(R.3f)=2*(0.0009999999.3f)=0.000 Edited by author 24.06.2008 15:14 Why wa on test 6?!?!?! please help me with some tests Edited by author 02.03.2008 02:35 when a>c the answer is a. Oh I see. Edited by author 02.03.2008 07:05 Edited by author 02.03.2008 07:07 If a=c then answer is a?Thank!!! how can i see the test case used in a problem? what is the p and q for test#14? u can use a assert statement and check it out isn't it ? but the numbers are too large,how to deal with it ? Edited by author 04.01.2009 14:33 {My program(Pascal)} var a,b:integer; begin read (a,b); a:=a+b; writeln (a); end. {ALL!} Why WA1 ??? Even if replace cw and ccw. The same with lowermost (3) point. Help me pleace. What with my output? #include <iostream> using namespace std; int main() { int n; int x1, y1; int x, y; int Oldx, Oldy; cin >> n; cin >> x1 >> y1; Oldx=x1; Oldy=y1; double sum = 0; for(int i=2; i<=n; ++i) { scanf("%d %d", &x, &y); sum += (Oldx*(double)y-x*(double)Oldy); Oldx=x; Oldy=y; }
sum += (x*(double)y1-x1*(double)y); if(sum) cout << "cw"; else cout << "ccw"; return 0; } #include<stdio.h> #include<math.h> int main() {double a[10000]; int n; for(n=1;scanf("%lf",&a[n])!=EOF;n++); for(;n>=1;n--) {a[n]=sqrt(a[n]); printf("%0.4lf\n",a[n]); } return 0; } NO one can tall me that? what should I do? Маловато наверно будет 10000. У меня была размерность больше 100 тыщ... You should change size of your array... I think you should use stack, Just one more semicolon(;). for(n=1;scanf("%lf",&a[n])!=EOF;n++); scanf return the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. A return value of 0 indicates that no fields were assigned. The return value is EOF for an error or if the end-of-file character or the end-of-string character is encountered in the first attempt to read a character.according to compilor,the result of EOF can be -1.each number or character that you input from the keyboard is ASCII,so the sentence "for(n=1;scanf("%lf",&a[n])!=EOF;n++);" would never be ended. what's the text8? If you get WA9 check your solve for tests when B = 10. :-) I am a green hand,I am interested in ACM competition, but I do not know what should I do? It really hard to understand the meaning of the description of this problem!It took me an hour and more! I think nth test is n. :) You must write eoln and not eof NO .. I write NOT EOF but wa... You must write eoln and not eof It's a very easy problem bur needs much attention. I got WA many times just for small things: 1) "Impossible." its not "Impossible" 2) Input data order 3) Precision 4) Not writing "Distance is..." #include <stdio.h> #include <stdlib.h> #include <string.h> short a[10000]; short sets[10000]; short p[10000]; int main() { long i,n; // freopen("input.txt","rt",stdin); // freopen("output.txt","wt",stdout); while (scanf("%ld",&n)==1) { if (n==1) { printf("1\n"); continue; } long k,j,sum; sum=0; memset(a,0,sizeof(a)); memset(sets,0,sizeof(sets)); for (i=0; i<n; i++) { scanf("%ld",&k); for(j=2; j<=k; j++) a[j]--; sets[k]++; sum+=k; } for(j=2; j<=sum; j++) a[j]++; for(i=1; i<=sum; i++) for(j=2; j<=sets[i]; j++) a[j]--; memset(p,0,sizeof(p)); unsigned long result=1; for(i=2; i<=sum; i++) if(!p[i]) { j=i+i; while (j<=sum) { p[j]=1; k=j; while(k%i==0) { k/=i; a[i]+=a[j]; } j+=i; } for(j=a[i]; j>=1; j--) result*=i; } printf("%lu\n",result); } exit(0); return 0; } You've made a terrible mistake. What does it mean "sum+=k"? IS NOT A PASCAL STYLE! Use "sum=sum+k"! Crazy Lemming you are not very informed with C and C++! It can be done in the way you say and in the way he made it! In c++ and in C(as i suppose) sum+=k adds k to sum! In pascal can be different but in C or C++ it isn't! Edited by author 06.06.2008 13:04 Edited by author 06.06.2008 13:04 I use G++. #include <iostream> #include <math.h> using namespace std; int n; int main() {
cin>>n; cout<<floor(____________); return 0; } Read the FAQ part. ANY function which is included in math.h MUST get DOUBLE: cout<<floor((double)_____); My definitely incorrect prog got AC! Where to send new tests? timus_support (at) acm.timus.ru If you have wa on first test, your program works wrong on sample(-) a very simplistic mistake that I think eveyone can make is that: you must NOT use the ROUND function you must not round the number up if the fraction part is EXACTLY .5 Good Luck The compiler says there doesn't exist any function called "round" Thanks This test is something like 1 2 1 2 And what anser for this test? |
|
|