| Show all threads Hide all threads Show all messages Hide all messages |
| hint | [MAI] do_v_5_strok | 1139. City Blocks | 17 Jan 2021 21:06 | 1 |
hint [MAI] do_v_5_strok 17 Jan 2021 21:06 check the values of y[i] by x[i] - x[i-1] in the straight line equation > > > > > > > > use ceil() and floor() |
| Problem statement clarification | Orfest (Novosibirsk SU) | 2017. Best of a bad lot | 17 Jan 2021 16:10 | 1 |
I'm confused by this sentence in the problem statement: "the murderers have agreed that their testimonies will have no contradictions between them" Does that mean that tests like this are invalid? 3 A 1 2 B 1 3 C 1 1 In this test there are 3 people and each one conflicts with at least one another. If one person is declared a murderer, there is still a contradiction between the other two. No 2 people can be declared murderers because there is always a contradiction between any 2 of them. |
| Solution (SPOILER) | Alikhan Zimanov | 2116. He is not a knight for you | 14 Jan 2021 16:50 | 1 |
Let's consider the case a = 0 and b = 0. Obviously, the answer will be n * n, because none of the knights will be able to move to any other cell of the table. Now let's assume that a != 0 or b != 0. By doing some casework, one can show that the answer for n will be the same as the answer for min(n, 10), so we can assume that n <= 10. Then, just find all possible night moves and get connected components of the corresponding graph. The answer will be the number of connected components. |
| if WA3 | Programmer956 | 1131. Copying | 13 Jan 2021 09:49 | 2 |
if WA3 Programmer956 3 Apr 2020 21:49 if k > n my program worked with n < 0 you should to consider the case after cycle: if n < 0 then n = 0 Edited by author 03.04.2020 21:51 |
| Who know how the 2nd test looks like?? | Last_Vikings | 1546. Japanese Sorting | 12 Jan 2021 22:29 | 18 |
We cannot imagine the test where our prog will give wrong answer! I wonder too, always wa on test 2 1w1 01w01a Edited by author 24.04.2007 19:29 No, its not 2nd test. My prog correctly process it, but stil WA2. sorted: 01w01 01w1 01w01a z000 z00 z00p z0p and one more 0 0p 01 1 1p Edited by author 25.04.2007 20:03 Try this test: z0p z00pp z0pp z00pp00 z000pp01 z00pp01 z0pp01 z001pp00 z01pp00 z1pp00000 z01pp01 z1pp001pp0 z1pp01pp000 I get WA#2 too. Huge thanks to Alexander Kouprin, after running his test and solving the problem I got accepted. Test from Alexander Georgiev also helped me a lot. By the way, my program gives other output for some test from this thread. Here they are: abc00125a abc0125a abc00125b abc0125b abc000000000000000000000125a abc00000000000000000000125a abc0012000000000000000000000000005b abc012000000000000000000000000005b These tests have almost broken my mind while I have been thinking why they are correct and I'm happy that I do not have to fix my program because of them. Zeroes matters only if strings are equal. Try this: abc0125a abc00125a abc00125b abc0125b Try this: abc0125a abc00125a abc00125b abc0125b I suppose the last test by Peter Huggy is the most similar to second test but after all this tests WA6 Try this: abc00000000000000000000125a abc000000000000000000000125a abc0012000000000000000000000000005b abc012000000000000000000000000005b I suppose the last test by Peter Huggy is the most similar to second test but after all this tests WA6 Got AC, thanks to Alias tests :) You can also try: 0000000 000 (Already sorted) Your program must return for these tests next results (alredy sorted): 1) 000 00 0 2) 00 0 000a 3) 00a000 00a0 I don't understand this. Why is 0000000 smaller than 000? What's the logic behind it? Edited by author 12.01.2021 22:30 |
| Why I get WA1(the result of my code is 3 4) | Ilya | 1079. Maximum | 12 Jan 2021 20:50 | 2 |
#include <bits/stdc++.h> using namespace std; int main(){ int n; int a[100000]; a[0] = 0; a[1] = 1; int max = 1; while(cin >> n, n != 0){ if(n > max){ for(int i = max + 1; i <= n; ++i){ if(i % 2 == 0){ a[i] = a[i / 2]; } else{ a[i] = a[(i - 1) / 2] + a[(i - 1) / 2 + 1]; } max = n; } } cout << a[n - (n % 2 == 0)] << "\n"; } } Edited by author 10.01.2021 03:55 print the maximum value in the range 1 to n a13 is greater than a15 |
| some tests | [MAI] do_v_5_strok | 2102. Michael and Cryptography | 12 Jan 2021 16:24 | 1 |
24303989349327424 = 2^6 * 11^14 (Yes) 79792266297612001 = 7^20 (Yes) 467851794974552912 = 7^1 * 2^4 * 11^15 (Yes) 566608619280937216 = 2^8 * 19^12 (Yes) 932195579567617600 = 5^2 * 2^6 * 17^12 (Yes) 999983616067108864 = 1953109^2 * 2^18 (Yes) 999197664639844352 = 19681^3 * 2^17 (Yes) 998848442311376896 = 15619^3 * 2^18 (No) 999999999987679232 = 1907348632789^1 * 2^19 (Yes) 798352691495399040 = 2^7 * 3^1 * 5^1 * 7^1 * 11^1 * 13^1 * 17^1 * 19^1 * 23^1 * 29^1 * 31^1 * 37^1 * 41^2 (Yes) |
| Что не так (python)? | Roma | 1000. A+B Problem | 12 Jan 2021 09:33 | 2 |
a, b = int(input()), int(input()) print(a + b) Очевидно, что там один ввод, а ты два раза спрашиваешь отдельно для а и b. |
| Amazing Problem | Deepesson | 2006. Kirill the Gardener | 12 Jan 2021 04:02 | 1 |
I've learned A LOT of optimizations tricks for BFS with this problem. I think that's the fastest BFS I've ever done LOL. A little hint if you are unsure what to do: Try to brute force the solution and optimize it. Eventually, you will get AC. And thanks to the author, for creating this amazing problem. |
| TLE #12 ? | hello_world_ww | 1671. Anansi's Cobweb | 12 Jan 2021 01:00 | 5 |
I use Disjoint-set who can help me? Re: TLE #12 ? SamGTU7_Kareva Nadezhda Vladimirovna 9 Jun 2013 16:00 Try changing a linear search you might have into smth that can b done in constant time. That made it much faster for me. (hint: you probably don't need anything special, just change your implementation a bit) |
| Understanding the solution | MARAZ MIA | 1876. Centipede's Morning | 11 Jan 2021 22:52 | 3 |
After so many calculation and math I have solved the problem..... Here we can have two worst cases... Case 1: having all the right shoes first.so here needed time is 2*b and we have now all the left shoes remaining...so total time is 2*b+40... Case 2: we may have 39 right shoes so time needed here is (39*2=78)...then we have only one right foot left but we may encounter all the left shoes and here needed time is 40+2*(a-40)....> 40 for the first 40 shoes and 2*(a-40) is for the remaining shoes as they needed to be thrown away...then we have the only one right foot left and it need 1 second... so total time = 78+40+2*(a-40)+1 = 119+2*a-80 = 2*a-39 ans=max(Case 1,Case 2) Edited by author 22.02.2020 03:07 But it's given that both a,b>=40.....so how 39 right shoes can be there? mistake in case 2: 119+2*a-80 = 2*a+39 everything else is correct Edited by author 11.01.2021 22:56 |
| Easy solution for newbie's | Issatai Izturganov | 2012. About Grisha N. | 11 Jan 2021 13:19 | 2 |
int f; cin >> f; int obs = 255; /* 5 hours = 300 minutes all time = 300 minutes - 45 minutes(for f tasks) */ int r = 12 - f; // tasks after first hour int ans = 45 * r; // time for solution if (ans <= obs) cout << "YES" << endl; else cout << "NO" << endl; Edited by author 15.05.2020 17:20 Edited by author 15.05.2020 17:20 if (5 + f >= 12) cout << "YES"; else cout << "NO"; cuz (60 * 4) // 45 = 5 he can solve 5 tasks in last 4 hours Edited by author 11.01.2021 13:20 Edited by author 11.01.2021 13:20 |
| What is the answer for this testcase? | Deepesson | 1367. Top Secret | 9 Jan 2021 02:38 | 3 |
#+-+-+-+-+-+ +-+-+-+-+-+# Edited by author 09.01.2021 01:54 Ok, stupid mistake again. Basically, the last line will be always \n So if you did something like this to read the input: std::string s; while(!std::cin.tie(0)){ std::cin >> s; } The Program will read an empty string. So you need to read as: while(!std::cin.tie(0)){ std::cin >> s; if(!s.size())break; } I got WA #6, So I thought my diagonal code was wrong! Lol. Edited by author 09.01.2021 02:47 Edited by author 15.01.2021 03:31 Edited by author 15.01.2021 03:32 Edited by author 15.01.2021 03:32 Btw the correct answer is: 11 11 |
| Weak tests, @admins | Igor Yevchynets [Lviv NU] | 1859. Last Season of Team.GOV | 7 Jan 2021 15:42 | 3 |
My AC solution (6438921) does not work on this test 2 111111110000 6 1 9 2 3 3 4 5 11 6 7 7 8 Please add it. Moreover, I think there could be found much more tricky tests than the one above. Please try to do that and add them too (I am too lazy to help you with that :) ). You may look into my submission 6438944 where this case is handled (presumably as well as all other tricky cases). I got AC with random shuffle, the tests are weak for sure. Could you send test against your solution to sp@urfu.ru ? :) |
| fails at test 28 | Gautr | 1014. Product of Digits | 7 Jan 2021 07:38 | 1 |
I don't know the problem use std::io; use std::io::BufReader; use std::io::BufRead; fn minimal_product_digit(n: i64) -> i64{ if n == 0 {return 10}; if n < 10 { return n};
let f : Vec<i64> = vec![2,3,5,7]; let mut aux = n; let mut ret : Vec<i64> = Vec::new(); for i in f{ if aux % i== 0 { loop{ aux/=i; ret.push(i); if aux % i != 0 { break; } } } }; if ret.is_empty() || aux > 1 { return -1; }
match ret.iter().fold(0,|acc,elem| if *elem == 3{acc + 1} else {acc}) { 1 => { let index = ret .iter().position(|&x| x == 3).unwrap(); if index > 0{ ret.remove(index); let k = ret.get_mut(index - 1).unwrap(); *k = 6; ret.sort();
} } _ => () } let mut v : Vec<i64> = Vec::new(); for i in ret{ match i { 2 | 3=> match v.last_mut(){ None => v.push(i), Some(last) if i ==3 && *last == 2 => v.push(i), Some(last) => { let valor = *last; if (valor * i) < 10{ *last = valor*i } else{ v.push(i); } } } _ => v.push(i) } } v.sort(); v.iter().fold(0, |acc, elem| acc * 10 + elem) } fn main() { let mut line = String::new(); let mut stdin = BufReader::new(io::stdin()); stdin.read_line(&mut line).unwrap(); let lim = line.trim().parse::<i64>().unwrap(); println!("{:?}",minimal_product_digit(lim)); } |
| When some n you can place one circle on the center not? | Temirlan | 1984. Dummy Guy | 6 Jan 2021 20:58 | 1 |
When n > 5 I guess, you can place one or more circles to free place within polygon? I assume that answer for 5 and 6 is same |
| No subject | TROFI | 1370. Magician | 6 Jan 2021 17:10 | 1 |
Edited by author 06.01.2021 17:11 |
| Read carefully the statement | Deepesson | 1844. Warlord of the Army of Mages | 5 Jan 2021 02:06 | 1 |
One doesn't have to execute their actions followed by the other. For instance: Sandro can execute 7 consecutive actions and after that Zagamius could execute 20. So basically, their turns don't need to be consecutive. Misinterpretation will lead to WA#4 or WA#5. Edited by author 05.01.2021 02:08 |
| Remark on the problem statement | InstouT94 | 1422. Fireflies | 4 Jan 2021 22:32 | 2 |
It is not said in the condition that the points have different coordinates. Can points have the same coordinates? There are no duplicate points in tests. |
| Hint | Yerdaulet | 2002. Test Task | 3 Jan 2021 20:40 | 1 |
Hint Yerdaulet 3 Jan 2021 20:40 in some cases, there are more than 1 current user |