Общий форум| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | | Please give me test 3. I am get WA | Alex | 1796. Парк аттракционов | 30 мар 2017 19:36 | 1 | | | Why '''''' like '_''' = True? | Vokin Andrei (vokin_andrei@mail.ru) | 1177. Сопоставление с шаблоном | 29 мар 2017 23:38 | 4 | Reason Han Wentao 19 фев 2002 08:36 In fact, the string are two apostrophe symbols, and the template are an underline and an apostrophe symbol. An underline can match any single character, and the other apostrophe can match the second apostrophe. So, the answer is 'YES'. Re: Reason Ionkin M [Samara SAU #617] 29 мар 2017 23:38 | | С++ TLE(test 12) | Bohdan | 1100. Таблица результатов | 28 мар 2017 04:07 | 2 | #include <iostream> using namespace std; int main() { long N; cin >> N; long **array = new long*[N]; for (long i = 0; i < N; i++) { array[i] = new long[2]; long temp, temp2; cin >> temp >> temp2; array[i][0] = temp; array[i][1] = temp2; } cout << endl << endl;
long l, r, i, k, buf; k = l = 0; r = N - 2; while (l <= r) { for (i = l; i <= r; i++) if (array[i][1] < array[i + 1][1]) { swap(array[i], array[i + 1]); k = i; } r = k - 1; for (i = r; i >= l; i--) if (array[i][1] < array[i + 1][1]) { swap(array[i], array[i + 1]); k = i; } l = k + 1; } for (long i = 0; i < N; i++) { cout << array[i][0] << " " << array[i][1] << endl; } return 0; } What is wrong with it?( I use bubbleshaker sort. You shouldn't use bubble sort. You the only should receive the same sort result. | | wrong tests! n >= 3! | -XraY- | 1103. Карандаши и окружности | 28 мар 2017 00:04 | 3 | my program with while(n < 3) printf("there are some stupid tests!\n"); gets Output limit exceeded 3. Please, check your tests! There is some trash in the end of a file in test 3. So, my multitest found it) can you elaborate on this? czu i'm getting WA on test4. would it have to do with this? | | MLE #21 | Maxm | 1510. Порядок | 27 мар 2017 21:33 | 6 | I don't understand. I use quicksort and then find solution very fast. MLE #21 say me that memory limit! I use c#. Edited by author 26.03.2017 21:16 Edited by author 26.03.2017 21:16 Edited by author 26.03.2017 21:17 Edited by author 26.03.2017 21:37 MLE - your program spent too much memory. No perfomance problem detected. Looks like you read all N inputs into list. Try using dictionary K -> count. I use Dictionary and get MLE too. I think problem in input data. I enter input data like: string[] input = Console.In.ReadToEnd().Split( new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); And add in dictionary for (int i = 0; i < input.Length; i++){ ... } I don't understand what's wrong :( Was wrong. Dictionary => TLE. Got input into List, sorted List, took middle one => AC. Just avoid reading whole input. Use something like static int readInt() { return Int.Parse(Console.ReadLine()); } Thanks! I read data like: static int readInt() { return Int.Parse(Console.ReadLine()); } But ... I have WA #25.. | | what's wrong??? | [SESC USU]Rudnev Vladimir | 1100. Таблица результатов | 26 мар 2017 12:39 | 7 | I think, i do all rigth, but i've WA1=(( I don't understand output type, that's mean what me should to print. Sorry for my English... var a,b:array[1..15000]of longint; asd,asd1,n,i,j:longint; begin read(n); for i:=1 to n do read(a[i],b[i]); for i:=1 to n-1 do for j:=i+1 to n do if b[i]<b[j] then begin asd:=b[i]; b[i]:=b[j]; b[j]:=asd; asd1:=a[i]; a[i]:=a[j]; a[j]:=asd1; end; for i:=1 to n do begin write(a[i],' ',b[i]);writeln;end; end. Ou fuck, i've do sort dont rigth.... Ou fuck, i've do sort dont rigth.... I think your solution will be TL. Use merge, or another fast sort I think that you answered two years later than it was necessary :) | | Can't get what's wrong with my BFS solution | ComebackSeason | 1106. Две команды | 26 мар 2017 00:55 | 1 | //problem solved (issue of different compilers of my local PC and judge one) Edited by author 26.03.2017 16:41 | | Fine | bdzxt | 1148. Building Towers | 24 мар 2017 18:48 | 2 | Fine bdzxt 12 мар 2017 08:23 //tower.in 1000 60 10 1 2 3 4 5 20170312 666666666 888888888 999999999 427749136024120470 427749136024120471 427749136024120472 -1 //tower.out 427749136024120472 10 9 8 7 6 5 4 3 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 10 9 8 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19 18 17 16 15 14 13 12 11 10 9 8 7 6 7 6 5 4 3 2 1 2 3 2 1 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 7 6 5 4 3 2 3 2 1 2 1 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 8 7 6 5 4 3 2 1 2 1 2 1 I finished it in 0.015s. | | The problem with slow running solutions is fixed | Vladimir Yakovlev (USU) | | 24 мар 2017 12:39 | 1 | The solutions were judged in a low performance mode for the last two weeks. Now it's fixed, the solutions are being rejudged. | | If you have WA5 | Juve45 | 2070. Интересные числа | 23 мар 2017 13:43 | 1 | Remember that you shouldn't check prime numbers (They call an integer satisfying if they both consider or do not consider this integer to be interesting) | | If you are TLE | yhzq | 1519. Формула 1 | 23 мар 2017 05:32 | 1 | GET BIGER HASH NUM !!!! If your hash number isn't big enough, you will end up with an endless loop. | | WA1 | maxormo | 1989. Подпалиндромы | 22 мар 2017 08:18 | 1 | WA1 maxormo 22 мар 2017 08:18 hell why WA1? i wanna get my TLE package main import ( "bufio" "os" "strings" "strconv" ) func main() { in := bufio.NewReader(os.Stdin) out := bufio.NewWriter(os.Stdout) buffer, _ := in.ReadString('\n') str := []rune(strings.Trim(buffer, "\n")) buffer, _ = in.ReadString('\n') count, _ := strconv.ParseUint(strings.Trim(buffer, "\n"), 10, 0) for k := uint64(0); k < count; k++ { buffer, _ = in.ReadString('\n') flds := strings.Fields(buffer) if []rune(flds[0])[0] == 'c' { i, _ := strconv.Atoi(flds[1]) str[i-1] = []rune(flds[2])[0] } else { i, _ := strconv.ParseUint(flds[1], 10, 0) j, _ := strconv.ParseUint(flds[2], 10, 0) if isPali(i-1, j-1, str) { out.WriteString("Yes\n") } else { out.WriteString("No\n") } } } out.Flush() } func isPali(i, j uint64, str []rune) bool { for i < j { if str[i] != str[j] { return false } i++ j-- } return true } Edited by author 22.03.2017 08:19 Edited by author 22.03.2017 08:19 | | To admins. Re: Задача 1196. Экзамен по истории | Nikita UCSD Pascal | 1196. Экзамен по истории | 22 мар 2017 00:35 | 1 | Hallo, On February 1st, 2017 I submitted a solution on Python, which was accepted with the time 0.9 sec. Yesterday I optimised it and submitted, but got "time limit exceeded" message. I then tried my original solution (from 01/02/2017), and it also exceeded time limit. Questions: 1) has something changed in the methodology, or you added some new or modified old tests so it takes more time? 2) is timing dependent on the server load or each solution is tested independently on a dedicated thread? (THis may be a good question for the FAQ) Thank you in advance. | | finally | Anton | 1769. Старая уральская легенда | 21 мар 2017 23:04 | 3 | I'm laughing now .... I've spent about 3 hours for this problem. First off, I used Z-function and I tried to treat problem as a string problem. I generated new string and tried to find it. If there is no, that's the answer. It became not so slow as can seems to be. But TLE#6 got me! Then I tried to store positions for each digit(0-9) and than tried to search target number using binary search for every digit. It works, but not good enough to pass test#6. Then I decided to use the straight approach using bool exists[1000000] that indicates whether n is substring. It approach can be done since total length is 10^5, so 10^6 is free for sure. Since we know several approaches sometimes we use more complex first :) | | WA 5 | Kogut.Ivan | 2095. Скрам | 20 мар 2017 20:44 | 7 | WA 5 Kogut.Ivan 10 июл 2016 15:14 Can you give me some tests, please? I don't understand why WA. Re: WA 5 Jane Soboleva (SumNU) 10 июл 2016 17:44 1 10^9 should be 35682 (apparently? i might be wrong) If you have a few spare gigabytes of RAM, you can simulate the thing by yourself. Initially we have 1 2 3 ... 10^9, after 1st step 1 3 5 etc (+2 +2 +2 etc), after 2nd step it's 1 3 7 9 13 15 (+2 +4 +2 +4 +2 +4 etc), after 3rd step it's 1 3 7 13 15 19 25 27 31 (+2 +4 +6 +2 +4 +6 +2 +4 +6 etc). Only on 4th step it becomes complicated and loses pattern. So for further simulation, you need 1 array of 10^9 / 2 / 2 + 1 4-byte integers from 3rd step (1 and [+2 +4 +6 cycle]), which is ~1GB, and another ~1GB array to copy elements into. I also found the sequence on OEIS: https://oeis.org/A000960, but still, i can't quite understand some things. For example: «To get n-th term, start with n and successively round up to next 2 multiples of n-1, n-2, ..., 1 (compare to Mancala sequence A002491). E.g.: to get 11th term: 11->30->45->56->63->72->80->84->87->90->91; i.e., start with 11, successively round up to next 2 multiples of 10, 9, .., 1. - Paul D. Hanna, Oct 10 2005» — what is this even? I have a hard time understanding what exactly is done here... It means to get n-th number you need to increase n step-by-step. At each step you increase your current number twice to the nearest number divisible by n - 1, n - 2, ..., 1 depending on each step you are now. Example: n = 11, nearest to 11 divisible by 10 is 20, next one is 30. nearest to 30 dibisible by 9 is 36 and next one is 45. And so on 11->30->45->56->63->72->80->84->87->90->91 1 10^9 should be 35682 (apparently? i might be wrong) If you have a few spare gigabytes of RAM, you can simulate the thing by yourself. Initially we have 1 2 3 ... 10^9, after 1st step 1 3 5 etc (+2 +2 +2 etc), after 2nd step it's 1 3 7 9 13 15 (+2 +4 +2 +4 +2 +4 etc), after 3rd step it's 1 3 7 13 15 19 25 27 31 (+2 +4 +6 +2 +4 +6 +2 +4 +6 etc). Only on 4th step it becomes complicated and loses pattern. So for further simulation, you need 1 array of 10^9 / 2 / 2 + 1 4-byte integers from 3rd step (1 and [+2 +4 +6 cycle]), which is ~1GB, and another ~1GB array to copy elements into. I also found the sequence on OEIS: https://oeis.org/A000960, but still, i can't quite understand some things. For example: «To get n-th term, start with n and successively round up to next 2 multiples of n-1, n-2, ..., 1 (compare to Mancala sequence A002491). E.g.: to get 11th term: 11->30->45->56->63->72->80->84->87->90->91; i.e., start with 11, successively round up to next 2 multiples of 10, 9, .., 1. - Paul D. Hanna, Oct 10 2005» — what is this even? I have a hard time understanding what exactly is done here... Re: WA 5 Jane Soboleva (SumNU) 21 янв 2017 01:51 Thank you! Your explanation is much more clear. Original should probably have "the 2nd closest multiple" instead of "next 2 multiples", would make more sense. 10 18 => 1 666 999 => 6 13 100000 => 354 123456789101112 12345678910111213 => 112837915 1 1000000000 => 35682 1 1000000000000 => 1128378 Edited by author 10.07.2016 18:37 Thanks a lot!!! I got AC. 10 18 => 1 666 999 => 6 13 100000 => 354 123456789101112 12345678910111213 => 112837915 1 1000000000 => 35682 1 1000000000000 => 1128378 Edited by author 10.07.2016 18:37 Re: WA 5 Амир Меннибаев 20 мар 2017 20:44 Why isn't wrong? 10 18 => 1 Edited by author 20.03.2017 20:45 | | BubbleSort на Java. Возможно ли? | Aleksandr | 1100. Таблица результатов | 20 мар 2017 13:06 | 3 | Тут кто нибудь вообще прощёл тест №11 на Java пользуясь именно Bubble Sort? Что то мне подсказывает что это вообще невозможно с такими ограничениями времени. Но в таком случае, почему в задаче упоминается именно пузырьковый поиск? Или всё таки это возможно, а я где то дико туплю? import java.io.*; public class Timus { public static void main (String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter (new OutputStreamWriter(System.out));
int N = Integer.parseInt(in.readLine()), bufer; int ID[] = new int[N]; byte M[] = new byte[N];
for (int i = 0; i<N; i++) { String[] s = in.readLine().split(" "); ID[i] = Integer.parseInt(s[0]); M[i] = Byte.parseByte(s[1]); }
for (int i = 0; i < N-1; i++) for (int j = N-1; j > i; j--) if (M[j]>M[j-1]) { bufer = M[j]; M[j] = M[j-1]; M[j-1] = (byte) bufer; bufer = ID[j]; ID[j] = ID[j-1]; ID[j-1] = bufer; }
for (int i = 0; i < N; i++) out.print("\n" + ID[i] + " " + M[i]);
out.flush(); } } Task doesn't require bubble sort. Task the only require the same sort result. So you can use any stable sort (Collections.sort for example). Тоже не могу пройти 11й тест на питоне, не хватает памяти. Если через словарь делать, то вообще на 1м тесте неправильный ответ, хотя у меня все нормально работает с разными вариантами тестов. | | WA#4 | Nikita | 2073. Логи соревнований | 20 мар 2017 01:10 | 2 | WA#4 Nikita 16 апр 2016 22:42 2 Codeforces Gamma Round 512 29.02.16 5 0 URKOP 17.10.15 12 1 A Accepted Re: WA#4 Амир Меннибаев 20 мар 2017 01:10 | | That testing supercomputer though | Chitanda Eru | 1972. Тестирование игры | 19 мар 2017 00:15 | 1 | So, i accidentally wrote a suboptimal solution for this problem (stored entire sequences of settings instead of just singular changes from the previous ones), saw it taking 15s (about 8 without the output) to complete max test on my laptop but submitted for fun anyway. Got AC in 0.4s. Go figure. | | a stronger version | Shen Yang | 1797. Summit Online Judge. Версия 2 | 18 мар 2017 10:48 | 1 | | | Please HELP ME WA 14 | Shohruh_1999 | 1607. Такси | 18 мар 2017 09:29 | 1 | #include<iostream> #include<math.h> #include<algorithm> #include<string.h> using namespace std; int a,b,c,d; int main() { cin >> a >> b >> c >> d; int h = c; if(a >= c) { cout << a; return 0; } while(1) { if(a == c) { cout << a; return 0; } a+=b; if(c-d >= a) c-=d; else { if(a > h) cout << h; else cout << a; return 0; } } return 0; } |
|
|