| Show all threads Hide all threads Show all messages Hide all messages |
| WA #6 | pidgey | 1126. Magnetic Storms | 2 Apr 2017 17:42 | 1 |
WA #6 pidgey 2 Apr 2017 17:42 Can someone please tell how the test looks like? |
| Wooohooooooooo AC ->some hints | IlushaMax | 2033. Devices | 31 Mar 2017 17:23 | 1 |
Don't forget about saving MIN PRICE of device Edited by author 31.03.2017 17:39 |
| Something strange... | Vukasin | 1023. Buttons | 31 Mar 2017 14:16 | 3 |
When i write my program like: #include<cstdio> long long int i,k; int main(){ scanf("%lld",&k); i=k / 3; while(k % i!=0){ i=k /(k / i +1); } i got AC,but when i change it to: #include<cstdio> int main(){ long long int i,k; scanf("%lld",&k); i=k / 3; while(k % i!=0){ i=k /(k / i +1); } printf("%lld",(k / i-1)); } printf("%lld",(k / i-1)); } i got WA5...does anyoe know how is that possible? wtf i=k / 3; ?? If k%(l+1)==0 then 2nd have a chance to win. And 1st wins if k%(l+1)!=0 try it: for (l=3;k%l!=0;l++);; Edited by author 31.03.2017 14:34 |
| WA #13? | Ionkin M [Samara SAU #617] | 1023. Buttons | 31 Mar 2017 13:30 | 1 |
WA #13? Ionkin M [Samara SAU #617] 31 Mar 2017 13:30 Check your program for very big K. It helped me. Edited by author 31.03.2017 14:38 |
| I guessed - can someone explain why? | Steve | 1161. Stripies | 30 Mar 2017 21:34 | 4 |
I got AC on this simply by guessing that combining the stripies from the largest down to the smallest would result in the smallest colony size. Can someone explain what mathematical or logical reasoning would be used to arrive at this conclusion, or prove that this conclusion would be true? I guessed the same and also I want to know mathematical proof The factor 2 does not matter -- you will always find one 2 which was sqrt'ed (n-1) times, ..., one 2 not sqrt'ed. OOH, there will be exactly two given number which got sqrt'ed (n-1) times, ..., one given number that got sqrt'ed once. Therefore, you will want larger numbers be sqrt'ed more times. Edited by author 22.03.2016 12:08 I can explain Okay, we have sequence m1,m2,m3,m4.... of weights in input But now imagine that we have a heap of stripies with their weights. Our answer (for example n=4) will be: 2*sqrt(m1*2*sqrt(m2*2*sqrt(m3*m4))) for greater understanding write it on a sheet. So we need to maximize it but we don't know order of m1,m2,m3,... which give max answer. It's clear that if 2*sqrt(m1*2*sqrt(m2*2*sqrt(m3*m4))) should be maximum then m1*2*sqrt(m2*2*sqrt(m3*m4)) (in sqrt) should be maximum too. Reasoning in this way we understand that we need m3*m4 be maximum. So this sequence should be sorted in this way: m4>=m3>=m2>=m1 I hope my English is enough to explain it)))) Edited by author 31.03.2017 19:50 |
| If you use P(P+2A-1)=2N but have WA | IlushaMax | 1120. Sum of Sequential Numbers | 30 Mar 2017 20:40 | 2 |
Don't forget that not only P should be divider of 2N but P+2A-1 should be divider of 2N too. It was my mistake when I got WA 7 Thanks! Nikita UCSD Pascal 30 Mar 2017 20:40 |
| Please give me test 3. I am get WA | Alex | 1796. Amusement Park | 30 Mar 2017 19:36 | 1 |
|
| Why '''''' like '_''' = True? | Vokin Andrei (vokin_andrei@mail.ru) | 1177. Like Comparisons | 29 Mar 2017 23:38 | 4 |
Reason Han Wentao 19 Feb 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 Mar 2017 23:38 |
| С++ TLE(test 12) | Bohdan | 1100. Final Standings | 28 Mar 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. Pencils and Circles | 28 Mar 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. Order | 27 Mar 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. Final Standings | 26 Mar 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. Two Teams | 26 Mar 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 Mar 2017 18:48 | 2 |
Fine bdzxt 12 Mar 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 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 3 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 3 2 1 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 3 2 3 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 3 4 3 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 3 2 3 4 5 6 7 6 7 6 7 8 9 8 7 6 5 6 7 8 9 10 9 8 9 10 11 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 3 2 1 2 3 2 3 4 3 4 3 4 5 6 7 8 9 8 9 10 11 12 11 10 9 10 9 10 9 10 9 8 9 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 3 2 3 2 3 4 5 6 5 4 5 6 5 4 3 4 5 6 7 8 9 10 9 8 9 8 7 6 7 6 5 4 5 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 3 2 3 4 3 4 5 4 5 6 7 8 9 10 9 8 7 8 9 8 9 10 9 8 9 10 11 12 11 12 13 14 13 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 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 Mar 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. Interesting Numbers | 23 Mar 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. Formula 1 | 23 Mar 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. Subpalindromes | 22 Mar 2017 08:18 | 1 |
WA1 maxormo 22 Mar 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. History Exam | 22 Mar 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. Old Ural Legend | 21 Mar 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 :) |