Common Board| Show all threads Hide all threads Show all messages Hide all messages | | Дорешивание задач | Mansurov Artur | | 9 Nov 2013 18:40 | 2 | Когда будет доступно дорешивание задач Уральской региональной командной олимпиады по программированию 2013? Задачи скопированы в Архив задач | | test case 5 | BUET Hat-tima-tim-team | 2009. Canteen Line | 9 Nov 2013 18:10 | 1 | any help ? stuck in test case 5. | | 13th test | Md. Mostafizur Rahman | 2011. Long Statement | 9 Nov 2013 14:55 | 1 | 13th test Md. Mostafizur Rahman 9 Nov 2013 14:55 I test the 13th case which has been given before but it gives WA for test 13. please can any body tell me what's the wrong | | WA#13 | B&B | 1348. Goat in the Garden 2 | 9 Nov 2013 13:41 | 2 | WA#13 B&B 9 May 2013 18:26 Show me test 13 please. #include <cstdio> #include <cmath> #include <algorithm> struct point { int x, y; }; double distance(const point P1, const point P2) { return sqrt((double)(P1.x - P2.x)*(P1.x - P2.x) + (double)(P1.y - P2.y)*(P1.y - P2.y)); } bool operator ==(const point P1, const point P2) { if (P1.x == P2.x && P1.y == P2.y) return 1; return 0; } int main() { point A, B, C; unsigned int L; scanf("%d%d%d%d%d%d%d", &A.x, &A.y, &B.x, &B.y, &C.x, &C.y, &L); const double pi = 3.14159265; const double epsilon = 0.00000001; double alpha, beta, gamma; double a, b, c; a = distance(B, C); b = distance(A, C); c = distance(A, B); alpha = acos((b*b + c*c - a*a)/(2*b*c)); beta = acos((a*a + c*c - b*b)/(2*a*c)); gamma = acos((a*a + b*b - c*c)/(2*a*b)); if (A == B) { printf("1 is working\n"); printf("a is %.2lf\nb is %.2lf\nc is %.2lf\n", a , b , c); printf("alpha is %.2lf\nbeta is %.2lf\ngamma is %.2lf\n", alpha, beta, gamma); if (L >= a) printf("0.00\n0.00\n"); else printf("%.2lf\n%.2lf\n", a - L, b - L); return 0; } if(abs(alpha + beta - pi) < epsilon) { printf("2 is working\n"); printf("a is %.2lf\nb is %.2lf\nc is %.2lf\n", a , b , c); printf("alpha is %.2lf\nbeta is %.2lf\ngamma is %.2lf\n", alpha, beta, gamma); double nl1 = std::min(a, b); double nl2 = std::max(a, b); if (L >= nl1) printf("0.00\n"); else printf("%.2lf\n", nl1 - L); if (L >= nl2) printf("0.00\n"); else printf("%.2lf\n", nl2 - L); return 0; } if (abs(alpha - pi/2) < epsilon) { printf("3 is working\n"); printf("a is %.2lf\nb is %.2lf\nc is %.2lf\n", a , b , c); printf("alpha is %.2lf\nbeta is %.2lf\ngamma is %.2lf\n", alpha, beta, gamma); double nl1 = b; double nl2 = std::max(a, b); if (L >= nl1) printf("0.00\n"); else printf("%.2lf\n", nl1 - L); if (L >= nl2) printf("0.00\n"); else printf("%.2lf\n", nl2 - L); return 0; } if (abs(beta - pi/2) < epsilon) { printf("4 is working\n"); printf("a is %.2lf\nb is %.2lf\nc is %.2lf\n", a , b , c); printf("alpha is %.2lf\nbeta is %.2lf\ngamma is %.2lf\n", alpha, beta, gamma); double nl1 = a; double nl2 = std::max(a, b); if (L >= nl1) printf("0.00\n"); else printf("%.2lf\n", nl1 - L); if (L >= nl2) printf("0.00\n"); else printf("%.2lf\n", nl2 - L); return 0; } if(alpha > pi/2) { printf("5 is working\n"); printf("a is %.2lf\nb is %.2lf\nc is %.2lf\n", a , b , c); printf("alpha is %.2lf\nbeta is %.2lf\ngamma is %.2lf\n", alpha, beta, gamma); double nl1 = b; double nl2 = a; if (L >= nl1) printf("0.00\n"); else printf("%.2lf\n", nl1 - L); if (L >= nl2) printf("0.00\n"); else printf("%.2lf\n", nl2 - L); return 0; } if(beta > pi/2) { printf("6 is working\n"); printf("a is %.2lf\nb is %.2lf\nc is %.2lf\n", a , b , c); printf("alpha is %.2lf\nbeta is %.2lf\ngamma is %.2lf\n", alpha, beta, gamma); double nl1 = a; double nl2 = b; if (L >= nl1) printf("0.00\n"); else printf("%.2lf\n", nl1 - L); if (L >= nl2) printf("0.00\n"); else printf("%.2lf\n", nl2 - L); return 0; } printf("7 is working\n"); printf("a is %.2lf\nb is %.2lf\nc is %.2lf\n", a , b , c); printf("alpha is %.2lf\nbeta is %.2lf\ngamma is %.2lf\n", alpha, beta, gamma); double nl1 = b * sin(alpha); double nl2 = std::max(a, b); if (L >= nl1) printf("0.00\n"); else printf("%.2lf\n", nl1 - L); if (L >= nl2) printf("0.00\n"); else printf("%.2lf\n", nl2 - L); return 0; } Check this situations: A = B, B = C, A = C Because, if you are calculating angle between vectors with formula: cos a = (scalar mult) / (|len1| * |len2|), so if one of distance is 0 - you will get "nan" (Not A Number) = something / 0 ... Edited by author 09.11.2013 13:43 | | WA on test 6 in C++ | Mamuka Sakhelashvili [Freeuni] | 1316. Electronic Auction | 9 Nov 2013 13:38 | 4 | I have solved this problem by Fenvic tree, at first I got WA on 5 test, then I changed int-s into long long-s and now I have WA on 6 test. If you had this kind of experience please tell me what types should I use to get AC? Thanks. The test 6 aint about data types' ranges. იდეაში, ეგ ხო ფენვიკის ხით უნდა გავიდეს, მე ვთვლი რაოდენობას, რამდენი გაყიდვა შესრულდება და შემდეგ ვამრავლებ 0.01–ზე და ვაბეჭდინებ. და ეგრე უნდა მუშაობდეს წესით ხო? Try this test BID 0.01 SALE 0.02 10 Answer:0.00 | | Tests | Dusayarov Alisher | 1985. Prime Square | 9 Nov 2013 13:18 | 2 | Tests Dusayarov Alisher 9 Nov 2013 13:08 Maybe! test 1 is n=4 test 3 is n=2 | | It accepted!!! | ScaleS | 1209. 1, 10, 100, 1000... | 8 Nov 2013 22:25 | 5 | var n,i : word; p : real; function check(A : real):boolean; begin if frac((1+sqrt(8*A-7))/2) = 0.0 then check := true else check:=false; end; begin readln(n); for i:=1 to n do begin readln(p); if check(p) then write('1 ') else write('0 '); end; end. Yes, because the difference of correct answer (when you use -1) and your is 2, so there is no difference to use +1 or -1! )))) frac((1+sqrt(8*A-7))/2) Where from it formula? What means? Could you take a look at my c++ code? I did the same as you but i never pass test #3 !! #include <iostream> #include <cmath> bool isOne (long n) { double intPart; double para = (1 + sqrt ( 8 * n -7)) / 2; double fractPart = modf(para, &intPart); if (fractPart == 0.0) return true; else return false; } int main() { using namespace std; long value; long num, i = 0; cin >> num; while (i < num) { cin >> value; if (isOne (value)) cout << "1 "; else cout << "0 "; i++; } return 0; } | | WA #9 Hint | canis_lupus | 1133. Fibonacci Sequence | 8 Nov 2013 21:23 | 2 | It solved my problem 0 1 1 1 0 after this test i pass 9 test and get ac 3 5 -1 4 -1 answear: 4 Edited by author 08.11.2013 21:24 | | Please give me test #2!!! | 1212114 | 1072. Routing | 8 Nov 2013 14:44 | 1 | | | Please, suggest cases to pass test #7 | Megakrit | 1837. Isenbaev's Number | 8 Nov 2013 14:39 | 2 | Found. If someone will have the same issue, try this input: 3 Isenbaev A B A B C A Q W Edited by author 25.01.2013 23:37 Edited by author 25.01.2013 23:37 A 1 B 1 C 2 Isenbaev 0 Q 2 W 2 But i still #WA7 | | помогите где я ошибся? | Azer | 1068. Sum | 8 Nov 2013 14:29 | 2 | #include <iostream> using namespace std; int main() {int N,sum=0; cin>>N; if(N<0 && abs(N)<=10000) { for (int i=N; i<=1; i++) sum+=i;} else if (N>0 && abs(N)<=10000) { for(int i=1; i<=N; i++) {sum+=i;} } cout<<sum<<endl; system("pause"); } При N=0 сумма будет равна 1, у тебя это не выполняется. Просто введи дополнительное условие на это значение. | | Test 3? | Karthic | 1931. Excellent Team | 8 Nov 2013 14:23 | 2 | Can anyone provide a sample for test 3? Thanks. 1 1 Your result should be 1 but I think your program will output 0 That was the problem in my case | | is the dp ? | twocoldz | 1994. The Emperor's plan | 8 Nov 2013 14:11 | 2 | I use the dp to solve this problem. but always wa #2. who can help me? where i need to pay attention? Yes, it is the dp. I also get wa #2, but in my case WA means runtime error. After fixing this bug(IndexOutOfRangeException) i get AC. | | one question , WA 9 | Tbilisi SU: Davit Rachvelishvili(rachvela) | 1019. Line Painting | 8 Nov 2013 12:42 | 5 | if there is a test like this "5 100 w" does it mean that both points 5 and 10 are colored in white? or only points betwen them. can somebody give me test, I have WA 9 TRY to test this cases: INPUT 2 5 100 w 10 10 b OUTPUT 0 1000000000 INPUT 14 1 999999999 b 1 300 b 20 120 w 1 50 b 220 300 w 250 270 b 40 70 w 50 160 b 30 90 w 120 140 w 40 50 b 180 200 w 1 40 w 70 80 w OUTPUT 0 40 INPUT 9 2 34 w 1 95 b 33 875 b 34 543 w 33 762 b 98754 999999843 b 87 221 w 76 432 w 325 764 b OUTPUT 875 98754 Edited by author 01.01.2009 12:08 thank you very much! but test#1 can never happy,because:0 < ai < bi < 109 | | Java WA could you give advice ? | Alex | 1581. Teamwork | 8 Nov 2013 08:20 | 1 | resolved Edited by author 08.11.2013 09:29 Edited by author 08.11.2013 09:29 | | JAVA WA#4 | Donart | 1104. Don’t Ask Woman about Her Age | 7 Nov 2013 19:14 | 1 | Edited by author 23.11.2013 14:14 | | No subject | Donart | | 7 Nov 2013 18:24 | 1 | Edited by author 07.11.2013 19:12 | | WA #6 | Max | 1910. Titan Ruins: Hidden Entrance | 7 Nov 2013 04:04 | 1 | WA #6 Max 7 Nov 2013 04:04 #include <iostream> using namespace std; int step(long int mas[],int n) { int i; int sum=0; for(i=n;i<n+3;i++) sum=sum+mas[i]; return sum; } int main() { int n,i; long int res; long int mas[1000]; cin >> n; for(i=0;i<1001;i++) mas[i]=0; for(i=0;i<n;i++) cin >> mas[i]; int sum=step(mas,0); res=0; for(i=0;i<n-2;i++) if(step(mas,i)<step(mas,i+1)) { sum=step(mas,i+1); res=i+3; } cout << sum << " " << res; return 0; } | | some tests | Vladimir Plyashkun [USU] | 1944. Record of the Attack at the Orbit | 6 Nov 2013 01:43 | 1 | some tests Vladimir Plyashkun [USU] 6 Nov 2013 01:43 some tests, that could help you 1 0 0 anwear: * 3 0 0 0 5 5 0 answear: *..... |..... |..... |..... |..... *----* 3 0 1 0 5 0 9 answear: * | | | * | | | * + | | To admins: checker is incorrect | Olympic Bear (Nikolay Dubchuk) | 1987. Nested Segments | 6 Nov 2013 00:22 | 2 | Hi, your checker doesn't check that exactly M lines are printed. My submission #5318694 has received AC. That's OK. In this problem you may output numbers with any whitespaces between them. If all the numbers are right, your solution will be accepted. |
|
|