| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| WA 25 tests. | Tolstobrov Anatoliy[Ivanovo SPU] | 1919. Руины титанов: трансформация цилиндров | 25 ноя 2017 04:10 | 1 |
WA 25 tests. Tolstobrov Anatoliy[Ivanovo SPU] 25 ноя 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. Поворот на МЕГУ | 24 ноя 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. Таблица результатов | 24 ноя 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. В одном шаге от счастья | 23 ноя 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. Стаж пилотов | 23 ноя 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. Сеть портшлюзов | 22 ноя 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. В одном шаге от счастья | 22 ноя 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. Ошибка 404 | 22 ноя 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. Китайский хоккей | 21 ноя 2017 14:14 | 1 |
WA 14 kokrokro 21 ноя 2017 14:14 What is test # 14? Can anyone help me? Edited by author 22.11.2017 20:14 |
| (с) ???? | Anastasia Nani | 1001. Обратный корень | 20 ноя 2017 19:57 | 1 |
(с) ???? Anastasia Nani 20 ноя 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. Обратный корень | 20 ноя 2017 19:48 | 1 |
(с) ???? Anastasia Nani 20 ноя 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. Дерево 2 | 20 ноя 2017 13:54 | 2 |
WA 9 Wlad 19 ноя 2017 01:45 Can someone know the 9th test? the topic is closed, a simple bug |
| WA4!!HELP | elsukov43 | 1131. Копирование | 20 ноя 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 ноя 2017 12:12 | 1 |
why?? Shen Yang 19 ноя 2017 12:12 same code visul C++ 2017 0.249s G++7.1 2.5s |
| WA #14 | MatrixDeity | 1297. Палиндромы | 18 ноя 2017 00:56 | 5 |
WA #14 MatrixDeity 14 ноя 2017 21:05 Hi, everyone! I used Manacher's algorithm to solve this problem, but I got WA on #14 test. Can someone hint me, what could be the problem? It could be buggy implementation If just want to solve then you could do it with native algorithm, time limit is enough even for python Mahilewets Nikita, thanks you for your answer! I thought about the native solution already, but I want to solve it with Manacher's algorithm only. It is needed for increasing of my skills :) If someone has 14th test post it, please! OMG, I found my mistake :) This test was useful to me: 'babadada'. Right answer is 'adada' (not 'abada'). P.s. There is same problem at Codeleet. You may peek some test there :) Also my implementation of Manacher failed at test 5 And I decided to use naive |
| To admins: why don't you notify users about rejudge? | Alexey Dergunov [RIP Samara SAU] | 1211. Круговая порука | 18 ноя 2017 00:52 | 1 |
|
| please give the code to java | pumpum1 | 1038. Проверка орфографии | 17 ноя 2017 14:19 | 1 |
please give the code to java please give the code to java |
| No subject | bygaga | 1758. К вопросу о лысине 2 | 17 ноя 2017 13:19 | 1 |
Edited by author 18.11.2017 07:25 |
| WA but its working correct any ideas? | nasafiy | 2023. Дональд-почтальон | 17 ноя 2017 00:46 | 2 |
#include<iostream> #include<cstdio> using namespace std; int main() { int n, a = 1, counter = 0; string s; cin >> n; for (int i = 0; i < n; ++i) { cin >> s; if (s[0] == 'A' || s[0] == 'P' ||s[0] == 'O' ||s[0] == 'R' && a == 2){ a = 1; counter++;} else if (s[0] == 'A' || s[0] == 'P' ||s[0] == 'O' ||s[0] == 'R' && a == 3){ a = 1; counter +=2;} if (s[0] == 'B' || s[0] == 'M' ||s[0] == 'S' && a == 1){ a = 2; counter++;} else if (s[0] == 'B' || s[0] == 'M' ||s[0] == 'S' && a == 3){ a = 2; counter++;} if (s[0] == 'D' || s[0] == 'G' ||s[0] == 'K' ||s[0] == 'T' || s[0] == 'W' && a == 1){ a = 3; counter +=2;} else if (s[0] == 'D' || s[0] == 'G' ||s[0] == 'K' ||s[0] == 'T' || s[0] == 'W' && a == 2){ a = 3; counter++;} } cout << counter; return 0; } You list D, G, K, T, W, but not J. |
| is this algo correct?? | Shen Yang | 1967. Казино для программистов | 16 ноя 2017 11:21 | 3 |
initially let result sequence to be 10* 10* 10* 0* means zero or more zeroes. every time choose two number and if we merge them produce a smaller number then we merge them. the procedure stops until we can't merge to get a smaller number is it correct?? seems to be.. Edited by author 16.11.2017 07:10 we should modify this algo: every time choose right most two number that we merge them can get a smaller number then we merge them,.... we must merge numbers from right to left.... seems to be more correct |