| Show all threads Hide all threads Show all messages Hide all messages |
| What 3rd test | Vsevolod | 2066. Simple Expression | 23 Nov 2023 17:01 | 1 |
|
| very good test to pass WA#13 | luckysundog | 1629. Trip | 23 Nov 2023 15:13 | 4 |
it helped me to pass WA#13 3 1 0 60 12:00 2 1430 45 23:00 0:00 got AC |
| Ok funny | TUITUF_Bahrom | 1295. Crazy Notions | 22 Nov 2023 17:48 | 2 |
|
| Some Deductions on the Problem | orzczt | 2061. OEIS A216264 | 22 Nov 2023 03:09 | 6 |
If you search for the id "A216264" on oeis.org, you would find a table of a(n), n=1..60. One interesting thing is that the site said that it was Mikhail Rubinchik who calculated a(26) to a(60), which happened to be out of the brute-force range. What is really disappointing is that in this problem, n may be 61, I think it's that guys's trick to play with us. Another interesting fact is that this guy also invented and introduced the Palindromic Tree. So, I deduce that the solution to this problem is somehow related to this data structure. Edited by author 03.04.2016 12:56 Yes, with eertree you can bruteforce all answers My solution runs ~20 hours to generate result, it can be theoretically speed up 2 times by bruteforcing only strings such s<=reverse(s) How could you bruteforce 2^61 strings of length 61? imagine a binary tree of these strings, use DFS with eertree https://iq.opengenus.org/palindromic-tree-eertree/ Use custom allocator with fixed 128 Node. struct NodeAllocator { Node nodes[128]; int pos = 0; Node* allocate() { assert(pos < 128); return nodes + (pos++); } }; std::uint64_t rich_number(std::uint64_t val, int pos, int n, EerTree& tree) { if (pos >= n) return 1; std::int64_t res = 0; for (std::uint64_t bit = 0; bit < 2; ++bit) { std::uint64_t s = val | (bit << pos); /********************************************/ Node* t_current = tree.current; int t_pos = tree.alloc.pos; /********************************************/ int r = tree.insert(s, pos); /********************************************/ Node* cur_change = tree.cur_change; /********************************************/ if (r == 1) { res += rich_number(s, pos + 1, n, tree); } /********************************************/ //reset tree insert back tree.current = t_current; tree.alloc.pos = t_pos; if (r==1){ cur_change->labeled[bit] = nullptr; } /********************************************/ } return res; } ------------ rich_number(0, 0, 61) -> gives 61-rich palindrome. My computer it runs 52 hours. Это да, супер Edited by author 22.11.2023 03:10 |
| easy bfs | 👑TIMOFEY👑`~ | 1101. Robot in the Field | 20 Nov 2023 14:42 | 2 |
|
| Java Accepted | hostpol | 1068. Sum | 20 Nov 2023 02:25 | 3 |
import java.util.Scanner; public class Main { public static void main(String[] args) { int c = 0; Scanner n = new Scanner(System.in); int f = n.nextInt(); n.close(); if (f > 0) { for (int i = 1; i <= f; i++) c += i; System.out.println(c); } else if (f <= 0) { for (int i = f; i <= 1; i++) c += i; System.out.println(c); } } } Edited by author 13.01.2023 20:21 |
| why wrong answer | Abduraxmon | 1068. Sum | 20 Nov 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. Canteen Line | 17 Nov 2023 16:28 | 1 |
WA7 Mortus 17 Nov 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. Geometrical Dreams | 17 Nov 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. Polyphemus' triples | 17 Nov 2023 13:30 | 1 |
Test 5 Yury_Semenov 17 Nov 2023 13:30 |
| HELP, WA#6 | 5iqman | 1910. Titan Ruins: Hidden Entrance | 16 Nov 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. Astronomical Database | 15 Nov 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. Scary Politics | 14 Nov 2023 21:41 | 1 |
WA2 👑TIMOFEY👑`~ 14 Nov 2023 21:41 you grab plot in your dfs in wrong place |
| Test#4 | Artem Bakhretdinov | 2069. Hard Rock | 12 Nov 2023 22:30 | 1 |
Test#4 Artem Bakhretdinov 12 Nov 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. Hard Rock | 12 Nov 2023 22:16 | 2 |
WA 4 miro.v.k 9 Jul 2019 17:21 I have WA4. Can someone give me that test ? Re: WA 4 Artem Bakhretdinov 12 Nov 2023 22:16 |
| Cool problem! My method. | jagatsastry | 1515. Cashmaster | 9 Nov 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. The Mentaculus | 9 Nov 2023 00:56 | 1 |
WA7 andreyDagger`~ 9 Nov 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. Exactness of Projectile Hit | 9 Nov 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. Reverse Root | 6 Nov 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. Last Season of Team.GOV | 6 Nov 2023 01:16 | 2 |
|