| Show all threads Hide all threads Show all messages Hide all messages |
| test case 7 | Shen Yang | 1834. Tennis Racket | 1 Dec 2017 07:28 | 2 |
20 19 17 15 13 11 9 7 5 3 1 2 4 6 8 10 12 14 16 18 20 ans: 5 17 13 9 5 1 2 6 8 10 12 14 16 18 20 4 3 7 11 15 19 1 2 8 12 16 20 7 11 15 19 3 4 18 14 10 6 5 9 13 17 1 2 12 20 11 19 3 4 18 10 9 17 13 5 6 14 15 7 16 8 1 2 20 19 3 4 18 17 5 6 7 8 16 15 14 13 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 I don't have test only use handle binary search get the test, and find answer with eyes... my programme output 6,so it must be smaller than 6... finally I get AC, it is O(n*lg(n)) sol |
| No subject | Dok32 | 1000. A+B Problem | 30 Nov 2017 22:04 | 1 |
var a,b,c:integer; begin read(a,b); writeln(a+b); end. |
| Wrong answer (Test 1) | Damir | 1000. A+B Problem | 28 Nov 2017 22:08 | 2 |
program SumAB; var a,b:integer; begin Assign(input,'input.txt'); Reset(input); Assign(output,'output.txt'); Rewrite(output); Readln(a,b); Writeln(a+b); Close(input); Close(output); end. При таком коде возникала ошибка. Написал program SumAB; var a,b:integer; begin Readln(a,b); Writeln(a+b); end. Система приняла. Т.е что получается, не нужно писать имена входного/выходного файлов? А в других задачах тот же принцип? Читайте FAQ. http://acm.timus.ru/help.aspx?topic=pascalВ самом конце есть следующая конструкция: {$IFNDEF ONLINE_JUDGE} assign(input, 'input.txt'); reset(input); assign(output, 'output.txt'); rewrite(output); {$ENDIF} readln(a, b); writeln(a + b); {$IFNDEF ONLINE_JUDGE} close(input); close(output); {$ENDIF} которая означает, что на вашем компьютере данные будут читаться из input.txt и писаться в output.txt, а на сервере будет использоваться стандартный ввод-вывод. |
| be careful integer overflow when m*b is long long type | Shen Yang | 1778. Chinese Hockey 2 | 28 Nov 2017 08:14 | 1 |
|
| admin ,I think special judge of this problem is incorrect | Shen Yang | 2049. Chemistry | 27 Nov 2017 07:00 | 3 |
this is my checker of this problem, it can't be wrong ,but WA on test 8 if(i>=n||a[i]!=k) { while(!(n==5&&k==5)) puts("orz"); puts("-1"); } else { printf("%d\n",cnt_ans); while(cnt_ans>3*n) puts("orz"); for(i=0;i<cnt_ans;i++) printf("%d %d\n",ax[i],ay[i]); for(i=0;i<n;i++) a[i]=1; for(i=0;i<cnt_ans;i++) { int id1=ax[i]-1,id2=ay[i]-1; while(id1>=n||id1<0||id2>=n||id2<0||id1==id2) puts("orz"); a[id1]-=a[id2]; a[id2]*=2; while(a[id1]<0) puts("orz"); } for(i=0;i<n;i++) { if(a[i]==k) break; } while(i!=0) puts("orz"); } it doesn't give ole but WA on test 8 sorry it's my mistake there is another no solution judge beforce this code... |
| is this proble TSP problem?? | Shen Yang | 1847. Zamkadye | 26 Nov 2017 13:14 | 3 |
I think it is a NP hard problem ,how could it be solved with range 1000?? could it be solved by LKH algo?? LKH got Accepted but it is at least O(n^3) how can it AC 15ms?? |
| WA 25 tests. | Tolstobrov Anatoliy[Ivanovo SPU] | 1919. Titan Ruins: Transformation of Cylinders | 25 Nov 2017 04:10 | 1 |
WA 25 tests. Tolstobrov Anatoliy[Ivanovo SPU] 25 Nov 2017 04:10 1 495 1 5 99 Answer: Too small 1 494 1 5 99 Answer: Too small 1 397 1 5 99 Answer: Too small 1 396 1 5 99 Answer: Block the hole |
| Что неверно? | Dmitry_Terenichev | 1787. Turn for MEGA | 24 Nov 2017 19:35 | 2 |
var k,n,i,q,w:integer; begin read(k,n); for i:=1 to n do begin read(q); w:=w+q; end; if k*n>=w then writeln(0) else writeln(w-k*n); end. |
| Its easy if use STL stable_sort | marik_karaev | 1100. Final Standings | 24 Nov 2017 06:06 | 2 |
I used stable sort from STL and got AC Why It doesnt work with sort instead of stable_sort |
| I think my code is right but it is not getting accepted. | Tanay | 1493. One Step from Happiness | 23 Nov 2017 13:44 | 1 |
I think my code is right but it is not getting accepted. Can anyone help me figure out what is wrong ? The python code is as follows: n=input() sum1=0 sum2=0 for i in range(0,3): sum1=sum1+(int(n[i])) for i in range(3,6): sum2=sum2+(int(n[i])) if(1==(abs(sum1-sum2)) or 0==sum1-sum2): print("Yes") else: print("No") Pls help me solve the issue Edited by author 23.11.2017 13:45 |
| Test for 24 test | Kirom `Ekexity [SESC17]💻 | 1888. Pilot Work Experience | 23 Nov 2017 11:34 | 1 |
10 10 4 2 2 3 3 1 1 5 5 6 6 7 2 8 8 9 9 10 10 6 answer is: 6 4 2 3 1 5 6 7 3 4 5 |
| can anyone help me to understand solution? | Anatoly Konenko | 1447. Portkey Network | 22 Nov 2017 22:21 | 2 |
I try to find alghoritm for this program, and can't find it. I read in other post next scheme w(x)=a-b*x is weight of every edge Z(x)=0 - solution. how understand w(x) ? Can I solve this problem without Z(x)=0 ? Я также хотел бы почитать про данную идею решения. На форуме есть ссылка на статью, но она на недоступном для меня английском языке. Насколько я понял с помощью Google переводчика, на форуме обсуждается следующее:каждому ребру присваивается вес w(x)=a-x*b, a-себестоимость, b-расстояние. Рассматривается целевая функция Z(x)=Sum(a,x,E)-x*Sum(b,x,E), где E-рёбра минимального остова с весовой ф-ей w(x), x-параметр, Sum(a,x,E) = Sum(a) в E, Sum(b,x,E) = Sum(b) в E (или Z(x)=Sum(w(x) в E)). Уверяется, что решение задачи 1447 достигается только в т.х : Z(x)=0. Док-во (моё): Сразу скажем, что ai,bi>0; 1)Необх.: пусть х - решение => Sum(a,E)/Sum(b,E)=x -> min => Sum(a,E)-x*Sum(b,E)=0, т.е. Z(x)=Sum(a,x,E)-Sum(b,x,E)=0 2)Дост.: пусть Z(x)=0, но y<x - решение, Ey - соответствующий набор рёбер для y; Z(y)=0 (из 1)); в силу минимального остова 0=Z(x)=Sum(a,x,E)-x*Sum(b,x,E)<=Sum(a,x,Ey)-x*Sum(b,x,Ey)=> Sum(a,Ey)>=x*Sum(b,Ey)>y*Sum(b,Ey) => Sum(a,Ey)-y*Sum(b,Ey)=Z(y)>0 - противоречие. Свойства: Пусть Z(x)=0. Тогда: 1)y<x <=> Z(y)>0 2)y>x <=> Z(y)<0 (Доказывается просто) Edited by author 22.11.2017 22:34 |
| whats wrong with this code?it say wrong answer | sina roozegar | 1493. One Step from Happiness | 22 Nov 2017 21:34 | 1 |
#include<iostream> using namespace std; int main() { int x, y; int sum1 = 0, sum2 = 0; char n = 'n'; cin >> x; int max = x + 1; int min = x - 1; for (int i = 0; i <3; i++) { y = max % 10; max = max / 10; sum1 += y; } for (int i = 0; i < 3; i++) { y = max % 10; max = max / 10; sum2 += y; } if (sum2 == sum1) { n = 'y'; }
y = 0; sum1 = 0; sum2 = 0; for (int i = 0; i <3; i++) { y = min % 10; min = min / 10; sum1 += y; } for (int i = 0; i <3; i++) { y = min % 10; min = min / 10; sum2 += y; } if (sum2 == sum1) { n = 'y'; } if (n=='n') { cout << "no"; } else { cout << "yes"; } return 0; } |
| I think this problem involves complex number operations | Shen Yang | 1765. Error 404 | 22 Nov 2017 13:05 | 3 |
choose k numbers k1,k2...km such that sigma(cos((2*ki+1)*pi/n))==0&&sigma(sin((2*ki+1)*pi/n))==0 that is sigma(cos((2*ki+1)*pi/n)+sin((2*ki+1)*pi/n)*i)==0 because cos(k*theta)+i*sin(k*theta)==(cos(theta)+i*sin(theta)^k so it is sigma(cos(pi/n)+i*sin(pi/n))^(2*ki+1)==0 I think this problem must involved this... is there O(polynomial)algo ? I only came up with a brute_force search idea..maybe it can pass.. brute_force search compnent part which is central symmetry Edited by author 22.11.2017 08:15 seems can turn to minimum cut problem because there are only two prime factor,I didn't see it... |
| WA 14 | kokrokro | 1736. Chinese Hockey | 21 Nov 2017 14:14 | 1 |
WA 14 kokrokro 21 Nov 2017 14:14 What is test # 14? Can anyone help me? Edited by author 22.11.2017 20:14 |
| (с) ???? | Anastasia Nani | 1001. Reverse Root | 20 Nov 2017 19:57 | 1 |
(с) ???? Anastasia Nani 20 Nov 2017 19:57 #include<stdio.h> #include<math.h> #define n 4 int main(){ int a[n]={100000000}; int i; for(i=0; i<n; i++) scanf("%d", &a[i]); for(i=n; i>0; i--){ printf("%.4f\n", sqrt(a[i]));} return 0; } |
| (с) ???? | Anastasia Nani | 1001. Reverse Root | 20 Nov 2017 19:48 | 1 |
(с) ???? Anastasia Nani 20 Nov 2017 19:48 #include<stdio.h> #include<math.h> #define n 4 int main(){ int a[n]={100000000}; int i; for(i=0; i<n; i++) scanf("%d", &a[i]); for(i=0; i<n; i++){ printf("%.4f\n", sqrt(a[i]));} return 0; } |
| WA 9 | Wlad | 1752. Tree 2 | 20 Nov 2017 13:54 | 2 |
WA 9 Wlad 19 Nov 2017 01:45 Can someone know the 9th test? the topic is closed, a simple bug |
| WA4!!HELP | elsukov43 | 1131. Copying | 20 Nov 2017 00:34 | 6 |
Wrong answer 4. HELP!!!! Edited by author 03.06.2016 17:42 Edited by author 03.06.2016 17:42 What did you try? What's your solution/idea so far? #include "iostream" using namespace std; int main() { int n, k, hours = 0, game = 1, free, i = 0, j = 0; cin >> n >> k; free = k; if (n == 1) hours = 0; else { while ((free > i) && (game < free) && (game <= n)) { i++; n -= i; hours++; game += i; } while (j < n-1) { hours++; j += k; } } cout << hours << endl; return 0; } Edited by author 03.06.2016 17:44 Wrong answer 4! Edited by author 03.06.2016 17:30 Edited by author 03.06.2016 17:41 |
| why?? | Shen Yang | 1529. Game of Squares | 19 Nov 2017 12:12 | 1 |
why?? Shen Yang 19 Nov 2017 12:12 same code visul C++ 2017 0.249s G++7.1 2.5s |