Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
No subject | ilUha | | 14 апр 2019 22:56 | 1 |
Edited by author 14.04.2019 22:57 |
About Test 2 | rodge(Vologda ML) | 1120. Сумма последовательных чисел | 14 апр 2019 11:04 | 4 |
If you have WA 2 look this test 6 ans 1 3 10 ans 1 4 my programm gave for 6 ans 0 4 for 10 0 5 after changes about a1 = 0 AC.So a1 Not equal 0 It must be added to the statement. It IS in the statement: "Your program is to output two POSITIVE integers A and P separated with a space..." |
is there a polynomial solution to the problem ? | Konstantin | 1500. Разрешения на проезд | 12 апр 2019 19:01 | 1 |
|
Output Limit Exceeded #12 hint | Cebotari Vladislav | 1074. Очень короткая задача | 12 апр 2019 17:22 | 1 |
Take care of new line endings and make sure that the second line is always read properly. In my case the problem was that the second line was skipped because of wrong transition in my FSM so the wrong line was read into N, so it printed more characters after the point than it should. |
Python. From WA1 to WA10, why WA10 ?? =(( | Mapu | 1226. йынтарбО кодяроп | 11 апр 2019 01:32 | 1 |
from sys import stdin s = "" for line in stdin: for i in line: if 'A' <= i <= 'Z' or 'a' <= i <= 'z': s += i elif 9 < ord(i) < 14 or ord(i) < 0: # <-- this elif about non-printable print(s[::-1], end = '\n') # characters end of lines, files, etc. s = "" else: print(s[::-1] + i, end = '') s = "" print(s, end = '') |
If you have WA #5 | german_goncharov | 1025. Демократия в опасности | 10 апр 2019 20:36 | 1 |
You can use for test this numbers: 9 3 11 7 9 13 25 7 11 5 The answer is 18. --- Hint: Use sort? Try to think about what you sort |
No really! Can you give Input and Output Test3 ??? | lomobit | 1818. Честные рыбаки | 9 апр 2019 23:03 | 1 |
Please write Input and Output Test3 Edited by author 09.04.2019 23:05 |
Accepted !!! =) | Jairls18 | 1025. Демократия в опасности | 7 апр 2019 15:05 | 5 |
[code deleted] Edited by moderator 20.11.2019 00:02 I understood the solution. But I didn't understand the logic, why 1 is added before dividing the number? Thank you. Because to get vote from i group you need to have more than a half votes. For example, If 7 you have 7 guys in a group, you need to have 4 votes. 7/2 = 3 3+1 = 4 Why you sorted the array?. Is there any need of it?. |
If Wa7. | Hrayr | 1786. Биография Сандро | 5 апр 2019 14:19 | 4 |
Try this test : tTTTTT ans:60 Edited by author 27.06.2011 02:14 Thanks, that really helped :D Thanks for help. The problem were in checking substrings with length less then 6. |
what???? | Sprint_me | 1068. Сумма | 4 апр 2019 21:15 | 1 |
konec = int(input()) spisok = [] i=1 if konec <0: while i>=konec: spisok.append(i) i-=1 else: while i<=konec: spisok.append(i) i+=1 print(spisok) print(sum(spisok)) |
what???? | Sprint_me | | 4 апр 2019 21:14 | 1 |
konec = int(input()) spisok = [] i=1 if konec <0: while i>=konec: spisok.append(i) i-=1 else: while i<=konec: spisok.append(i) i+=1 print(spisok) print(sum(spisok)) |
If you have WA #3 | german_goncharov | 1654. Шифровка | 2 апр 2019 03:53 | 1 |
For test you can use this string: hkjgnnngkikipipekkfkfgg Correct result is: hkjgngkikipipefkf |
how to make faster? | TSU_TheScull | 1654. Шифровка | 2 апр 2019 03:05 | 1 |
using System; namespace pain { class Program { static void Main(string[] args) { string s = Console.ReadLine(); char[] ss = new char[s.Length]; for (int i = 0; i < s.Length; i++) ss[i] = s[i]; for (int i = 0; i < s.Length - 1;) { if (ss[i] == ss[i + 1]) { if (i - 1 >= 0) { int n = i + 2; b: if (n <= s.Length - 1) { if (ss[n] != ' ') { ss[i] = ss[n]; ss[n] = ' '; ss[i + 1] = ' '; } else { n++; goto b; } } else break; } else { ss[i] = ' '; ss[i + 1] = ' '; } if (i >= 1) i--; else i++; } else i++; } for (int i = 0; i < s.Length; i++) if(ss[i] != ' ') Console.Write(ss[i]); //Console.Write(st2(s)); Console.ReadLine(); } public static string st1(string s, ref int n) { if (s.Length - 1 > n) { if (s[n] == s[n + 1]) { s = s.Remove(n, 2); if (n >= 2) n -= 2; else n--; } n++; s = st1(s, ref n); } return s; } public static string st2(string s) { for (int i = 0; i < s.Length - 1; i++) { if (s[i] == s[i + 1]) { s = s.Remove(i, 2); if (i >= 2) i -= 2; } } return s; } public static string st3(string s) { int n = 0; int nt = s.Length - 1; string[] ss = new string[nt]; for (int i = 0; i < nt; i++) { bool d = false; for (int j = i; j < nt; j++) { if (ss[i] == s[j].ToString()) { d = true; } } if (!d) { ss[n] = s[i].ToString(); n++; } } n = 0; while (nt != 0) { nt = s.Length; for (int i = 0; i < ss.Length; i++) { s = s.Replace(ss[i] + ss[i], ""); } if (nt == s.Length) break; } return s; } } } Edited by author 02.04.2019 03:06 |
Offtopic | Korobov (TNU) | 1220. Stacks | 30 мар 2019 14:21 | 3 |
Offtopic Korobov (TNU) 29 дек 2011 23:50 Yeah! I did it! I spent about 4 hours to solve this problem =) |
Limit is too small | Scythe (Berinde Radu) | 1110. Степень | 28 мар 2019 19:39 | 4 |
The problem limits are too small. You can get ac with the O(N^2) algorithm which is VERY straightforward. The limit should force you to use the O (log N) algorithm to compute X^N (%M) > The problem limits are too small. > You can get ac with the O(N^2) algorithm which is VERY > straightforward. The limit should force you to use the O > (log N) algorithm to compute X^N (%M) O(log N) !? Isn't it O(MlogN) ? well,if it's really O(log N) , please tell me how :) I got AC with 0.031 373 KB using brute force. This is the dummest task I made. Tell them to read the O(M log N) algorith in Introduction in algo(Coreman) This sadly is my AC source: var i,j,k,l,m,n:longint; ok:boolean; begin readln(n,m,k); for i:=0 to m-1 do begin l:=i; for j:=1 to n-1 do l:=(l*i) mod m; if l mod m=k then begin write(i,' '); ok:=true; end; end; if not ok then write(-1); end. Edited by author 10.05.2004 17:49 Hello, explain to me why you use l:=(l*i) mod m;(...mod m)?!! Why? |
solved on python | fatnet | 2102. Миша и криптография | 28 мар 2019 18:12 | 1 |
0.436 seconds, 6840 kb just go to google and type there: monte carlo factorization --- this algo is O(N^1/4), so its O(1e4 * sqrt(2)) |
Hint! | basuki | 1837. Число Исенбаева | 27 мар 2019 21:45 | 1 |
Hint! basuki 27 мар 2019 21:45 |
Test 19 | Smilodon_am [Obninsk INPE] | 1769. Старая уральская легенда | 26 мар 2019 16:17 | 2 |
Test 19 Smilodon_am [Obninsk INPE] 30 мар 2012 12:35 This test contain such string that answer (minimal integer number) is more than 99999. |
some tests for wa7 | 🦄Imosk72🦄∭GTGU∭ | 1532. Трудности перевода | 23 мар 2019 20:29 | 1 |
2 jsesi jesfi 2 tvtx vtix 2 qfqejjfhrhono fqwejjfhrhono 2 mciqibekphze mcqibmekphze 2 affjoromdta affjromjdta all answers should contain both strings |
C: Whats wrong with task? | Nick | 1001. Обратный корень | 22 мар 2019 07:43 | 2 |
I've created file with tests, it seems all checks passes locally, but not in Judge here is my code: #include <stdio.h> #include <stdlib.h> #include <math.h> typedef struct list_node{ long int number; struct list_node * previous; } list_node_t; list_node_t * create_root(long int number); list_node_t * create_list(long int number, list_node_t * previous); int main() { long int a; list_node_t * current = NULL; while (scanf("%ld", &a) != EOF) { if (current == NULL) { current = create_root(a); } else { current = create_list(a, current); } } while (current != NULL) { printf("%.4Lf\n\r", sqrtl(current->number)); current = current->previous; } return 0; } list_node_t * create_root(long int number) { list_node_t *lt = malloc(sizeof(list_node_t)); lt->number = number; lt->previous = NULL; return lt; } list_node_t * create_list(long int number, list_node_t * previous) { list_node_t *lt = create_root(number); lt->previous = previous; return lt; } the problem is just calculate the square root in reverse order, it is unnecesary create a linked list or use pointer |