| Show all threads Hide all threads Show all messages Hide all messages |
| WA20 | Lev_Kireenko 🐬 [SESC 17] | 1795. Husband in a Shop | 27 Jul 2016 17:25 | 1 |
WA20 Lev_Kireenko 🐬 [SESC 17] 27 Jul 2016 17:25 What it is test 20 ? Edited by author 27.07.2016 17:35 Edited by author 27.07.2016 17:35 Edited by author 27.07.2016 18:36 |
| Why WA4? | Ivan11Start | 2015. Zhenya moves from the dormitory | 27 Jul 2016 17:20 | 3 |
Please, give me some tests. I can't understand why i get WA4. Please make sure your solution meet the requirement "If two people share an apartment, each pays half of the rent." This is that I missed in my first solution. I did this, but it's still WA4. |
| WA26 and some tests :) | pperm | 1384. Goat in the Garden 4 | 27 Jul 2016 09:04 | 4 |
Why wa26?) Tests help me to pass test 2 and test 3. 9 1 -1 2 1 1 0 2 2 0 1 -2 2 -1 0 -2 1 -1 -1 1.00 12 2 1 1 1 1 2 -1 2 -1 1 -2 1 -2 -1 -1 -1 -1 -2 1 -2 1 -1 2 -1 1.41 AC 6 0 0 0 -3 1 -2 2 -2 3 -3 3 0 1.00 Test help me WA15 MarX 27 Jul 2016 09:04 ThankU for the tests, they were useful to me, but I still having WA on test 15, any help will be apreciated. |
| C++ Test | Qussy | 1083. Factorials!!! | 26 Jul 2016 12:05 | 1 |
never mind... Edited by author 28.07.2016 07:32 |
| Always WA1 what am i doing wrong? | newcomer | 1837. Isenbaev's Number | 25 Jul 2016 18:13 | 1 |
class Node: def __init__(self, name, number): self.name = name self.number = number self.children = [] def d(self, name): for i in self.children: if i.name == name: self.children.remove(i) for i in self.children: i.d(name)
def fnc(cmds, item, isenb, root): for c in cmds: if item.name in c: for n in c: if not n in isenb: isenb[n] = item.number + 1 item.children.append(Node(n, item.number + 1)) elif isenb[n] > (item.number + 1): isenb[n] = item.number + 1 root.d(n) item.children.append(Node(n, item.number + 1)) for i in item.children: fnc(cmds, i, isenb, root)
import sys if __name__=='__main__': n_command = input() if(int(n_command) > 0): isenb = {} cmds = [] for i in range(0,int(n_command)): cmds.append(input().split()) flag = False for c in cmds: if "Isenbaev" in c: flag = True break if flag: root = Node("Isenbaev", 0) isenb["Isenbaev"] = 0 fnc(cmds, root, isenb, root) for c in cmds: for i in c: if not i in isenb: isenb[i] = "underfined" s = '' for key,value in sorted(isenb.items()): if s == '': s += (str(key) + ' ' + str(value)) else: s += ('\n' + str(key) + ' ' + str(value)) sys.stdout.write(s) else: sys.stdout.flush() |
| TLE#5, how can i solv this with fibonachchi, | Bobur | 1081. Binary Lexicographic Sequence | 25 Jul 2016 13:18 | 7 |
i solved, but my algo so slow, how can i solve this problem faster, sorry for my english. thx! Lets consider the sequence for n=4: 0000 0001 0010 0100 0101 1000 1001 1010 Try to find a connection between the number of all sequences with length 4, those which begin with 0 and those which begin with 1. After that look "deeper" and "deeper" into each sequence and try to find a way to generate the k-th sequence. Sorry that I'm not telling you the algorithm directly, but the feeling when you discover it yourself is great :) (it's even greater when you get Acc from 1-st submition :P). I hope that you find this helpful. thanks a lot, i think i can find it!! wow i feel good ¬¬_.'[smoke] ty for the idea Tnk u. Ur hint is very helpful. I got AC! Lets consider the sequence for n=4: 0000 0001 0010 0100 0101 1000 1001 1010 Try to find a connection between the number of all sequences with length 4, those which begin with 0 and those which begin with 1. After that look "deeper" and "deeper" into each sequence and try to find a way to generate the k-th sequence. Sorry that I'm not telling you the algorithm directly, but the feeling when you discover it yourself is great :) (it's even greater when you get Acc from 1-st submition :P). I hope that you find this helpful. Thank u so much.... :) It really feels wow... :D |
| What is Test 6? | Sherxon WIUT | 1081. Binary Lexicographic Sequence | 25 Jul 2016 13:09 | 2 |
Please give me test 6? Try these Tests: Test 1: 43 999999999 Ans=>1010000100100001010101000001000101000100101 Test 2: 42 999999999 Ans=> -1 Test 3: 40 100000000 Ans=>0010101001010100001010000010101010000010 |
| Giving WA #35 | paarth | 1354. Palindrome. Again Palindrome | 24 Jul 2016 09:35 | 3 |
Can anyone please suggest the test case which might give me WA35... I have used string , also tried with character array... and KMP algorithm ..... please do reply My solution was rejudged and I got WA 35 :) They added tests against hashes modulo 2^64. |
| if you have wa#1 | Baurzhan | 1542. Autocompletion | 22 Jul 2016 19:32 | 3 |
don't print endline symbol after last query: for(int i=0;i<queries;i++){ answer_the_query(); if(i!=queries-1) printf("\n") //without this line it got wa#1! } Edited by author 15.09.2010 08:42 Your solution works.Thanks a lot!!! |
| Add charts to Timus profiles using a browser extension | Alexander Borzunov FT-16 {koλ} [UrFU] | | 20 Jul 2016 22:45 | 1 |
I've made a browser extension that adds charts of count of solved problems to Timus profiles. You can find screenshots, installation instructions, and source code here: http://github.com/borzunov/timus-charts/blob/master/README.md The extension is available for Chrome, Firefox (with Greasemonkey) and Opera. Edited by author 20.07.2016 22:47 |
| 22-ой тест не пошёл, помогите мне пожалуйста, уже и не знаю какие тесты вводить | Platt96 | 1786. Sandro's Biography | 20 Jul 2016 17:11 | 3 |
#include<iostream> #include<list> using namespace std; bool in_the_range(char a) { if (a >= 'a'&&a <= 'z') { return true; } else { return false; } } int chance_one_symb(char in_symbol, char out_sybmbol) { if ((in_the_range(in_symbol) && in_the_range(out_sybmbol)) || !(in_the_range(in_symbol)) && !(in_the_range(out_sybmbol))) { if (in_symbol == out_sybmbol) { return 0; } else { return 5; } } else { if (((int)in_symbol + 32) == out_sybmbol || ((int)in_symbol - 32) == out_sybmbol) { return 5; } else { return 10; } }
} int main() { char str[200] = { NULL }; const char word[6] = { 'S', 'a', 'n', 'd', 'r', 'o' }; int final_cost = 60, temp_cost = 0; cin.get(str, 200); list<char> temp; list<char>::iterator ptr; for (size_t i = 0; i < 6; i++) { temp.push_back(str[i]); } int j = 0; for (size_t i = 6; i <= strlen(str); i++) { for (ptr=temp.begin(); ptr!=temp.end(); ptr++) { temp_cost += chance_one_symb(*ptr, word[j]); if (temp_cost>=final_cost) { break; } j++; } j = 0; if (temp_cost < final_cost) { final_cost = temp_cost; } temp_cost = 0; temp.pop_front(); temp.push_back(str[i]); } cout << final_cost; return 0; } Edited by author 14.07.2016 22:33 Seeing a similar code on other tasks previously, i can already tell the problem by intuition. Try something like <194 symbols>Sandro. |
| dont know russian :P | shweta | | 20 Jul 2016 16:49 | 2 |
i came to know about this very good russian site, e-maxx.ru... but i dont know russian, can anybody help how to read the content in english ? |
| Java как обычно | Chernobuk | 1068. Sum | 19 Jul 2016 19:26 | 3 |
import java.util.*; public class N1068 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if ((n>=1)&&(n<10000)) System.out.print(n *(n + 1) / 2); if ((n<1)&&(n>-10000)) System.out.print(-((-n) *(1 -n) / 2) + 1); } } что здесь не так? "Не превосходит" означает "меньше либо равно, но не больше" Edited by author 19.07.2016 19:08 |
| WA #5 | Landsknecht | 1083. Factorials!!! | 19 Jul 2016 15:32 | 1 |
WA #5 Landsknecht 19 Jul 2016 15:32 Could anybody give me this test please? Other tests are welcome as well :) Edited by author 19.07.2016 15:33 |
| Note: a can be greater than n | Otrebus | 1132. Square Root | 17 Jul 2016 23:41 | 1 |
|
| If you have WA#9 | rkhapov | 1438. Time Limit Exceeded | 16 Jul 2016 18:44 | 1 |
I set condition to terminate program: while (!halt) { //bla bla bla executed++;
if (executed > MAX_EXECUTED) terminate_program(); } to while (executed < MAX_EXECUTED && !halt) { //bla bla bla executed++; } if (executed >= MAX_EXECUTED && !halt) terminate_program(); It helps me and I got AC :) Edited by author 16.07.2016 19:03 Edited by author 16.07.2016 19:04 Edited by author 16.07.2016 19:05 |
| Any Idea about WA #5 | Apptica | 1930. Ivan's Car | 16 Jul 2016 11:34 | 1 |
I am using dijkstra by adding a reverse edge of weight 1. Answer will be MIN ( Shortest distance, total_edges - shortest_distance); |
| !!!??? Java omg!!!!!!!!!!!!!!!!! | Mikhail | 1000. A+B Problem | 15 Jul 2016 19:31 | 3 |
import java.util.*; public class Math{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int a = scanner.nextByte(); int b = scanner.nextByte(); System.out.print(a + b); } } Почему Runtime error?? Попробуй nextInt вместо nextByte. В подавляющем большинстве случаев в задачах на тимусе чаще встречаются 4-байтные переменные, чем 1-байтные. |
| До какого момента осуществляется ввод? | Roman | 1007. Code Words | 15 Jul 2016 15:46 | 6 |
Всем привет! Я написал реализацию программы на Java. Проверка выдает Runtime error. Программа принимает n, после чего слушает ввод и после каждого введенного слова выводит ответ. Выглядит это так: 9 0010100011 //мой ввод 001000011 //вывод программы 00010010 //мой ввод 000100101 //вывод программы Ctrl - C Скажите, правильно ли реализовал ввод/вывод данных? Спасибо! Edited by author 30.12.2015 22:15 Да, так можно делать, не ожидать завершения ввода, прежде чем делать вывод. Но без кода не понять, где рантайм. Я точно не уверена, т. к. у меня нет большого опыта в джаве, но возможно, проблема вот здесь while(true) { a = input(); if (a.length() > 0) { System.out.println(toSource(a)); } } Как я вижу, программа никогда не выходит из цикла, и в некоторый момент пытается что-то читать после того, как входные данные заканчиваются. Я исправила while(true) на while(in.hasNextLine) (входные данные не закончены, имеется следующая строка) и class на public class (иначе выдаёт compilation error). Теперь получается WA #1. Честно говоря, непонятно почему, вроде на тестовых данных в других ветках обсуждения нормально проходит. Может кто-то более опытный сможет подсказать. Ну уже хотя бы не Runtime. Спасибо. Ввод верный (его несложно подправить и под не Pascal): const nmax=1111; var a:array[1..nmax] of char; n,i,j,len:longint; ch:char; ..... begin readln(n); while not eof do begin len:=0; read(ch); if(ch='0')or(ch='1') then begin //началось считывание очередного слова len:=1; a[len]:=ch; read(ch); while(ch=' ')or(ch='1')or(ch='0') do begin if(ch='1')or(ch='0') then begin inc(len); a[len]:=ch; end; read(ch); end; Solve(len); readln; //перевод строки end; end; end. |
| 1 2 3 is interesting | staticor | 1290. Sabotage | 15 Jul 2016 12:54 | 2 |
can you find other sequence like this , input = output No, it isn't. 1 2 3 -> 3 2 1 -> 3 2 1 'input = output' when the input sequence is already sorted by non-increasing. |