| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| why wrong answer | Abduraxmon | 1068. Сумма | 20 ноя 2023 02:23 | 2 |
#include <iostream> using namespace std; int sum(int a) { return ((1 + a)/2)*a; } int main () { int a;
cin >> a;
if (a > 0) cout << sum(a); else if (a < 0) cout << sum(abs(a)) * -1 + 1; else cout << 0;
return 0; } if N = 0 then you need add one so the correct solution is: if (a > 0) cout << sum(a); else if (a < 0) cout << sum(abs(a)) * -1 + 1; else cout << 1; |
| WA7 | Mortus | 2009. Очереди в столовой | 17 ноя 2023 16:28 | 1 |
WA7 Mortus 17 ноя 2023 16:28 If the i’th student will let the j’th student stand behind him in a line, this is !!!NOT!!! means that the j’th student will let the i’th student too. |
| Did anybody have WA3? | [SPb NRU ITMO] Niyaz Nigmatullin | 1046. Геометрические грёзы | 17 ноя 2023 14:44 | 3 |
I solved a system of two equations by hand at first and got WA3. Then I used cramer's rule and got AC. I guess cramer is far more precise (uses less divisions/multiplications etc). |
| Test 5 | Yury_Semenov | 2117. Полифемовы тройки | 17 ноя 2023 13:30 | 1 |
Test 5 Yury_Semenov 17 ноя 2023 13:30 |
| HELP, WA#6 | 5iqman | 1910. Руины титанов: сокрытый вход | 16 ноя 2023 23:06 | 1 |
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int n, sum1, sum2= 0; cin >> n; vector<int>dsds(n); for (int i = 0; i < dsds.size(); i++) { cin >> dsds[i]; }
vector<int> dsds2 = dsds; sort(dsds2.begin(), dsds2.end()); sum1 = dsds2[n - 1] + dsds2[n - 2] + dsds2[n - 3]; for (int i = 0; i < dsds.size(); i++) { if (dsds[i] == dsds2[n - 1] || dsds[i] == dsds2[n - 2] || dsds[i] == dsds2[n - 3]) { sum2 = i + 2; break; } } cout << sum1 << " " << sum2; return 0; } in my tests this code works 100%, but i dont know why i have WA#6 Edited by author 16.11.2023 23:08 |
| The dots are stupid | Hubert Wasilewski | 1414. Астрономическая база данных | 15 ноя 2023 00:04 | 1 |
Changing the spaces into dots, does not make the sample more """"illustrative"""". It does make it way less obvious what the format is, though |
| WA2 | 👑TIMOFEY👑`~ | 1923. Про политику | 14 ноя 2023 21:41 | 1 |
WA2 👑TIMOFEY👑`~ 14 ноя 2023 21:41 you grab plot in your dfs in wrong place |
| Test#4 | Artem Bakhretdinov | 2069. Тяжёлый рок | 12 ноя 2023 22:30 | 1 |
Test#4 Artem Bakhretdinov 12 ноя 2023 22:30 What's the test#4? I'm sure my solution is correct: #include <algorithm> #include <array> #include <iostream> #include <limits> uint32_t *arr_n; uint32_t *arr_m; int n, m; uint64_t max_sum = 0; uint32_t min_popularity = std::numeric_limits<uint32_t>::max(); void find_most_popular_route(int i, int j, uint64_t sum, uint32_t cur_min) { if (i == n - 1 && j == m - 1) { if (sum > max_sum) { max_sum = sum; min_popularity = cur_min; } return; } if (i < n - 1) { find_most_popular_route(i + 1, j, sum + arr_m[j], std::min(cur_min, arr_m[j])); } if (j < m - 1) { find_most_popular_route(i, j + 1, sum + arr_n[i], std::min(cur_min, arr_n[i])); } } int main() { std::cin >> n >> m; if (n > 100000 || n < 2 || m > 100000 || m < 2) return 0; arr_n = new uint32_t[n]; for (int i = 0; i < n; i++) { std::cin >> arr_n[i]; } arr_m = new uint32_t[m]; for (int i = 0; i < m; i++) { std::cin >> arr_m[i]; } std::cout << std::endl << std::endl; find_most_popular_route(0, 0, 0, min_popularity); std::cout << min_popularity << std::endl; // std::cout << max_sum << std::endl; delete[] arr_n; delete[] arr_m; return 0; } |
| WA 4 | miro.v.k | 2069. Тяжёлый рок | 12 ноя 2023 22:16 | 2 |
WA 4 miro.v.k 9 июл 2019 17:21 I have WA4. Can someone give me that test ? Re: WA 4 Artem Bakhretdinov 12 ноя 2023 22:16 |
| Cool problem! My method. | jagatsastry | 1515. Финансовая реформа | 9 ноя 2023 13:53 | 5 |
Wow. This problem is really cool. Try using the naive method and you're sure to get TLE#26. Well, my solution(AC 0.234) goes this way: if the first term is not 1 then the ans is 1. if the first i terms are 1<<0, 1<<1, 1<<2, ... 1<<(i-1) then all numbers from 1 to (1<<i) - 1 can be expressed as a sum of some of the above terms. Thus if a number k is present all numbers from k to k+((1<<i) - 1) can be skipped. Proceed using this approach. By the way 1<<i represents pow(2, i). And how do you plan to proceed with this approach? :) how is your algorithm working on this test: 6 1 2 3 6 9 18 My brain burned in notebook on that algorithm! |
| WA7 | andreyDagger`~ | 1839. Ментакулус | 9 ноя 2023 00:56 | 1 |
WA7 andreyDagger`~ 9 ноя 2023 00:56 1 5 -9 2 0 0 4 2 -2 5 -4 6 0 4 -6 7 2 3 Answer: 0 |
| If you have WA14...... | AleshinAndrei | 1215. Точность попадания снаряда | 9 ноя 2023 00:47 | 2 |
Can someone proceed further on this topic? I have a WA14, and I literally can use only double in my program, so int64_t doesn't really help. |
| I don't undesrstand where is a mistake. Who can help? | Danis | 1001. Обратный корень | 6 ноя 2023 18:42 | 1 |
lines = [] for line in stdin: for i in range(0, len(line.split())): lines.append(line.split()[i]) lines = [int(i) for i in lines] lines_rev = list(reversed(lines)) numbers = [] for i in range(0, len(lines_rev)): numbers.append(lines_rev[i]**0.5) for i in range(len(numbers)): print(f"{numbers[i]:.4f}") |
| checker failed | andreyDagger`~ | 1859. Последний сезон Team.GOV | 6 ноя 2023 01:16 | 2 |
|
| RE16 | Arseny Babushkin (aytel)'` | 1587. Летающая свинья | 6 ноя 2023 00:29 | 2 |
RE16 Arseny Babushkin (aytel)'` 20 авг 2016 14:27 I've got many RE16 with using python 3.4. Did anybody else get it? How did you solve it? I don't know why , but I just stopped using division in my solution and got AC! |
| Ac Pythoh !!! | eremeev.me.2012@gmail.com | 2056. Стипендия | 5 ноя 2023 21:27 | 1 |
a = int(input()) f = [] for i in range(a): s = int(input()) f.append(s) if f.count(3) >=1: print('None') else: if f.count(5) == len(f): print('Named') elif sum(f) / len(f) >=4.5: print('High') else: print('Common') |
| Test 1 , WA | alennv | 2020. Пробка в Цветочном городе | 5 ноя 2023 02:37 | 2 |
Can anyone give tests data or some discription? Edited by author 01.11.2023 14:24 Test 1 is the first sample test from the problem statement. |
| useful test | Mortus | 1940. Непростые годы | 4 ноя 2023 02:12 | 1 |
1000000000 1000000000 300 answer: 97395891 |
| Test for WA 21 | Sergey | 1888. Стаж пилотов | 30 окт 2023 20:11 | 1 |
|
| Better Understanding of states | Amil Khare | 2018. Дебютный альбом | 30 окт 2023 12:59 | 2 |
Hello, I am trying this question, however, I am unable to understand how to construct the solution. My Dp is weak so I thought to practice here, however I am having a tough time. Can someone please help in describing how to start thinking about such problems? |