Common Board| Show all threads Hide all threads Show all messages Hide all messages | | WA 7 | 107th | 1365. Testing Calculator | 14 Feb 2023 12:18 | 1 | WA 7 107th 14 Feb 2023 12:18 For those who have WA on test 7, please try following one: 4/2*3+ | | About a custom test case. | Meraj al Maksud | 1083. Factorials!!! | 12 Feb 2023 19:37 | 3 | For n = 10 and k = 20, what should be the output? Well, obviously it's not 0! For this test case (n=10, k=20) answer is equal to 10. why? Can you please explain? | | Solution | Apkawa | 1220. Stacks | 8 Feb 2023 08:01 | 2 | I created every stack using pointers, but nodes in this stack saved data of ten last pushed elements, not of one last. So this is a stack of arrays and not the stack of single elements. Also I had an additional array of int[1000], that showed how many positions in last node of each stack is already used. Conclusion: you need to do such a struct of that has an array of ten elements and a pointer to previous node. On every push-call you should create another node(if previous is full) and add an element on the first open space of node, then increase the number of used positions. On every pop-call you should go to previous node and delete current node(if current node is empty) and print the last element of node, then decrease the number of used positions. Hope it'll help you. And I apologize for my poor english) Thank you!, now I got AC. =) | | WA 1, :( | klimvetoshkin | 1493. One Step from Happiness | 5 Feb 2023 10:22 | 1 | a = input() row = [] for i in a: row.append(i) for i in range(len(row)): row[i] = int(row[i]) suml = row[0] * 100 + row[1] * 10 + row[2] sumr = row[3] * 100 + row[4] * 10 + row[5] if suml - sumr == 1 or sumr - suml == 1: print('yes') else: print('no') | | WA 4, why not? (python 3.8) | klimvetoshkin | 1925. British Scientists Save the World | 4 Feb 2023 11:30 | 1 | n,k = map(int, input().split()) kol = 0 u = 1 for i in range(n): a, b = map(int, input().split()) if a - b == 2: kol += u else: u = 0 if kol == 0: print('Big Bang!') else: print(kol) | | Increase the stack size in rust at runtime: | ixiolirion | 2132. Graph Decomposition. Version 2 | 4 Feb 2023 11:17 | 1 | const STACK_SIZE: usize = 128 * 1024 * 1024; fn run() { //... } fn main() { let child = std::thread::Builder::new() .stack_size(STACK_SIZE) .spawn(run) .unwrap(); child.join().unwrap(); } | | Data type | Igor Parfenov | 1276. Train | 2 Feb 2023 04:16 | 1 | There were mentioned, that it is required 64-bit integer type. I also add, that it has to be unsigned, otherwise you get WA 8. | | WA 39 | Steven | 1774. Barber of the Army of Mages | 1 Feb 2023 19:37 | 8 | WA 39 Steven 5 Apr 2011 15:49 Can somebody give me anti-greedy tests so that a greedy solution will not give correct answer? A test like #39? I'm sure that greedy is the right solution, i cannot find counter-test for my solution. Re: WA 39 Milanka Halilovich 8 Apr 2011 15:50 I have same problem... Try: 3 1 1 6 3 2 2 4 Re: WA 39 Milanka Halilovich 8 Apr 2011 17:17 ..or.. 3 1 2 4 3 2 0 4 Edited by author 08.04.2011 17:18 I have same problem and my program works for this input (both R possible, correct me if I'm wrong) and I would appreciate if someone would suggest why program is not working and/or give me more tests like #39. Edited by author 24.04.2011 02:46 Same problem... Can somebody give us some tests? Try this: 5 2 0 3 3 2 3 2 0 2 0 5 This one is also nice: 4 2 0 3 1 2 2 2 1 4 Great thanks to @BSoD Edited by author 01.02.2023 19:37 Edited by author 01.02.2023 19:37 | | Test 6 format | Igor Parfenov | 1248. Sequence Sum | 31 Jan 2023 04:38 | 1 | Guess, why I had wasted 18 attempts? The exponent can have + sign: 1.3e+32 All bad wished to author. | | wa5. Why? | Kutnyakov | 1005. Stone Pile | 28 Jan 2023 12:25 | 2 | #include <iostream> #include<vector> #include<algorithm> using namespace std; int main() { int n, a, razn, k1 = 0, k2 = 0; cin >> n; vector<int>num; for (int i = 0; i < n; i++) { cin >> a; num.push_back(a); } sort(num.begin(), num.end()); int kol = 0; for (int i = 0; i < n - 1; i++) {//все камни кроме максимума kol += num[i]; } if (kol < num.back()) {//если все камни меньше самого максимального cout << num.back() - kol; } else if (kol == num.back()) {//если все камни pавны максимальному cout << 0; } else if (kol > num.back()) {//если все камни больше максимального k2 = num.back(); for(int i =n-2;i>=0;i--){ if (k1 < k2) { k1 += num[i]; } else if (k1 > k2) { k2 += num[i]; } else if (k1 == k2) { k1 = num[i]; k2 = 0; } } cout << abs(k1 - k2); } } //my program is fine solves any of my values. what is in test 5? здесь надо делать перебор битовыми масками Edited by author 28.01.2023 12:25 | | WA 6, python 3.8, plz help me | klimvetoshkin | 1263. Elections | 28 Jan 2023 11:58 | 1 | n, m = map(int, input().split()) a = [] b = [1] c = [] for i in range(m): f = int(input()) a.append(f) a = sorted(a) f = 0 for i in range(1, len(a)): if a[i] == a[i - 1]: b[f] += 1 elif a[i] != a[i - 1]: b.append(1) f += 1 for i in range(len(b)): b[i] = float(b[i] / m * 100) for i in range(len(b)): c.append('%.2f' % b[i] + '%') for i in range(n): try: print(c[i]) except: print('0.00%') | | Post the answer in java plz | Shemakin | 1209. 1, 10, 100, 1000... | 25 Jan 2023 13:16 | 1 | If my teacher is watching this post, sorry. | | Advice for bruteforce | andreyDagger`~ | 1234. Bricks | 25 Jan 2023 01:47 | 1 | Bruteforcing length gives WA, bruteforcing angle gives AC | | wrong answer(python) | dkzzum | 1404. Easy to Hack! | 25 Jan 2023 01:44 | 1 | I checked several times and everything is working correctly, help me def encryption(txt): cipher = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
encryption_list = [] for i in txt: encryption_list.append(cipher[i]) c = d = c1 = 0 encryption_last_list = [] for i in encryption_list: if d == 0: d += 1 c = i i -= 5
if i < 0: i = 25 - abs(i) encryption_last_list.append(i)
else: c1 = i i -= c c = c1 if i < 0: i = 26 - abs(i) encryption_last_list.append(i)
decodding_list = [] for i in encryption_last_list: for k, v in cipher.items(): if v == i: decodding_list.append(k)
return decodding_list text = input() if len(text) <= 99: c = '' output = encryption(text.lower()) for i in output: c += i print(c) | | i need help on Lonesome Knight ( coordinate sol) | roseiris | 1197. Lonesome Knight | 24 Jan 2023 20:45 | 1 | can anyone please explain the solution which uses the coordinates i think ... Edited by author 24.01.2023 20:46 Edited by author 24.01.2023 20:46 Edited by author 24.01.2023 20:46 | | A Question | lasercat | 1292. Mars Space Stations | 24 Jan 2023 09:55 | 2 | I get WA 1 with calculating distance in this way for(int i=0;i<len;i++) { ans+=pow(((int)(buf[i]-'0')),3); } while accepted in this way for(int i=0;i<len;i++) { ans+=(buf[i]-'0')*(buf[i]-'0')*(buf[i]-'0'); } WHY?!!!! Is this a bug on judge or bug in function?!! the compiler is g++ why not try this ans+=round(pow(((int)(buf[i]-'0')),3)); | | Weird statement | Igor Parfenov | 1282. Game Tree | 22 Jan 2023 02:48 | 1 | Notice, that +1 and -1 mean not victory and defeat states. INPUT 2 L 1 +1 OUTPUT +1 | | WA23 | andreyDagger`~ | 1630. Talisman | 21 Jan 2023 02:11 | 1 | WA23 andreyDagger`~ 21 Jan 2023 02:11 4 3 1 2 2 3 3 4 Luck is possible | | hint for all test case | Almas Turganbayev | 1083. Factorials!!! | 19 Jan 2023 16:22 | 1 | be attentive with loop (while)! we know formule n - x * k =) and in depends of number parity condition will be >= (ex. [n - x * k >= n mod k] or [n - x * k >= k]). Good luck!) Edited by author 19.01.2023 16:23 | | WA3: possible scenarios | Malak | 2115. The Knowledge Day | 17 Jan 2023 21:12 | 3 | Can anyone check if I missed any scenario ? 1, 2, 3, 4, 5 => Nothing to do here" 5, 4, 3, 2, 1 => Nothing to do here" 5, 2, 3, 4, 1 => "Yes\n1 5" 1, 8, 3, 4, 5, 6, 7, 2, 9 => "Yes\n2 8" 1, 8, 7, 6, 5, 4, 3, 2, 9 => "Yes\n1 9" 9, 8, 3, 6, 5, 4, 7, 2, 1 => "Yes\n3 7" 1 => Nothing to do here" 1, 1, 1, 1, 1 => "Nothing to do here" 9, 2, 3, 5, 4, 6, 7, 8, 1 => "No hope" 1, 2, 3, 9, 5, 6, 7 => "No hope" 7, 6, 5, 9, 3, 2, 1 => "No hope" 1, 1 => "Nothing to do here" 1, 2 => "Nothing to do here" 1, 2, 4, 3, 5, 6 => "Yes\n3 4" 6, 5, 3, 4, 2, 1 => "Yes\n3 4" 2, 1, 3 => "Yes\n1 2" 1, 3, 2 => "Yes\n2 3" 1, 2, 3, 2, 3, 4, 5 => "Yes\n3 4" 1, 5, 7, 2, 4, 5 => "No hope" If there are repeated digits, make sure you switch the right one. For example: 5 2 1 1 1 3 Try to generate tests containing a lot of same numbers, e.g. the next test: 9 1 5 1 3 3 3 5 1 5 has answer: Yes 2 8 |
|
|