| Show all threads Hide all threads Show all messages Hide all messages |
| WA7 | Mortus | 1608. Lucky Tickets 2008 | 12 Jan 2024 00:41 | 1 |
WA7 Mortus 12 Jan 2024 00:41 |
| What wrong? (с++) | Plotnik | 1001. Reverse Root | 11 Jan 2024 19:59 | 1 |
#include <iostream> #include <algorithm> #include <iomanip> #include <string> #include <vector> #include <cmath> using namespace std; int main() { double element, a; vector<double> numbers; while (cin >> element) { numbers.push_back(element); } reverse(numbers.begin(), numbers.end()); for (size_t i = 0; i != numbers.size(); i++) { a = sqrt(numbers[i]); cout << setprecision(4) << a << "\n"; } return 0; } Edited by author 11.01.2024 20:23 |
| Graph | zhnzhang61 | 1225. Flags | 11 Jan 2024 07:56 | 1 |
Graph zhnzhang61 11 Jan 2024 07:56 n = 1 2 3 4 5 R RW RWR RWRW RWRWR W WR WRW WRWR WRWRW RBW RBWR RBWRW WBR WBRW WBRWR RWBR RWBRW WRBW WRBWR RWRBW WRWBR RBWBR WBRBW Each column can be derived from: 1. the column on its left + R or W and 2. the column on its left's left + BR or BW |
| WA13 | Milica | 1513. Lemon Tale | 10 Jan 2024 16:06 | 3 |
WA13 Milica 22 Dec 2023 16:39 Can someone tell me what is 13.test case? Also, is the only way to solve this problem using long arithmetic? I got time exceeded error. Can somebody tell what is test case? Or tell me how can I optimize my code? I even found to solutions using dp. void lemontale(int n,int k,vector<vector<BigInt>> &mem){ BigInt big_n = BigInt(n); BigInt big_k = BigInt(k); BigInt dva_big = BigInt(2ull); if (mem[n-1][k] == BigInt()){ if (n<0) return ; else if (k==0 && n==1){ mem[n-1][k] = BigInt(1);
} else if (k==0){ lemontale(n-1,k_start,mem); mem[n-1][k] = mem[n-2][k_start];
} else if (n<=k){ BigInt rez = dva_big^big_n;
mem[n-1][k] = rez; } else{
lemontale(n-1,k_start,mem); lemontale(n-1,k-1,mem); mem[n-1][k] = mem[n-2][k-1]+mem[n-2][k_start]; } }
} void lemontale2(int n,int k,BigInt* mem){ BigInt dva_big = BigInt(2ull);
if (mem[n-1]==BigInt()){ if (n<=k) mem[n-1] = dva_big^BigInt(n); else for(int i=0;i<=k;i++){ if (n-i-1 != 0){ lemontale2(n-i-1,k,mem); mem[n-1]+=mem[n-i-2]; } else{ mem[n-1]+=1; } } }
} Edited by author 10.01.2024 16:08 Edited by author 10.01.2024 16:09 Edited by author 10.01.2024 16:09 Edited by author 10.01.2024 16:09 |
| Hint | So Sui Ming | 1302. Delta-wave | 10 Jan 2024 13:55 | 1 |
Hint So Sui Ming 10 Jan 2024 13:55 Find coordinates (x,y,z) of corresponding values and find the manhattan distance between them. Do all in zero-based instead of one-based indices / numbers. e.g. input: 6, 12 (1-bases) => 5, 11 (0-based) value of 5 => (x,y,z) of (2,0,1) value of 11 => (x,y,z) of (3,1,2) manhattan dist = abs(2-3) + abs(0-1) + abs(1-2) = 3 more: input: 398 9999 (1-bases) => 397, 9998 (0-based) (19, 18, 1) (99, 98, 0) ans = 161 c++ fragment: (v = 0-based value) int u = int(ceil(sqrt(v+1))); int x = u-1; int y = -1; if (v == (x+1)*(x+1)-1) y = x; ... else |
| Hint | So Sui Ming | 1346. Intervals of Monotonicity | 10 Jan 2024 11:37 | 1 |
Hint So Sui Ming 10 Jan 2024 11:37 Get rid of consecutive duplicates which are nasty and note that the intervals do not share common point. dp is not needed. |
| this test helps with WA6 | So Sui Ming | 1377. Lara Croft | 10 Jan 2024 09:50 | 1 |
|
| WA 5 | Akashi | 1327. Fuses | 9 Jan 2024 18:04 | 2 |
WA 5 Akashi 13 Sep 2022 21:57 a = int(input()) b = int(input()) if a %2==1 and b%2==1: print(int((b-a)/2+1)) else: print((b-a)//2) Why WA?? What if a = 2 and b = 3? The answer will be 1 but your code will give 0. Now fix it. |
| wa2 c++ sort with comparator | majorro | 1100. Final Standings | 9 Jan 2024 14:58 | 2 |
Why does bool comp(pair<int,int>& a, pair<int,int>& b) { return a.second > b.second; } not AC with common sort? You are not following the bubble sort ordering :) |
| Suggestion: this problem should be removed from the problem set due to its extremely poor statements. | So Sui Ming | 1194. Handshakes | 9 Jan 2024 10:22 | 1 |
|
| How can the program recognize when there aren´t more inputs (python3)? | HUC_EDDIE | 1001. Reverse Root | 9 Jan 2024 02:50 | 2 |
How can the program recognize when there aren´t more inputs if use python3 ? my program: nums = [int(x) for x in input().split()] nums.reverse() for num in nums: print('{:.4f}'.format(num ** 0.5)) What's wrong? anyone can tell me ,pls Edited by author 29.11.2023 07:42 Edited by author 29.11.2023 07:43 The answer to your question is in the FAQ, page How to write Python solutions. |
| Hint | So Sui Ming | 1820. Ural Steaks | 8 Jan 2024 19:29 | 1 |
Hint So Sui Ming 8 Jan 2024 19:29 Consider 2 cases: (1) K >= N (2) K < N and fry one side of each steak first. Try cases like: N=7,K=1; N=7,K=2; up to N=7,K=6 and find the pattern. |
| I have some test datas | zzyzzy12 | 1158. Censored! | 7 Jan 2024 21:09 | 2 |
50 50 10 qwertyuiop[]\asdfghjkl;'zxcvbnm,./ QWERTYUIOP{}|AS aegaegu etoijqt tquqi witowwt zxcjnc oeit potieq iojge nvoq piqper ans=8881647922834867244791415981705771412427494861672253136057167374729235842468240763290 1 1 1 a a ans=0 5 10 3 abcde abc bc c ans=1048576 Edited by author 05.04.2012 20:51 - Edited by author 07.01.2024 21:19 |
| WA5 | andreyDagger`~ | 1357. Teakettle 1.0 for Dummies | 5 Jan 2024 22:54 | 1 |
WA5 andreyDagger`~ 5 Jan 2024 22:54 This is invalid test, but anyway 10 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 Answer: 00:13:58 00:13:58 00:13:58 00:13:58 00:13:58 00:27:56 00:27:56 00:27:56 00:27:56 00:27:56 |
| WHY WA#2 | MrFazer | 1086. Cryptography | 5 Jan 2024 12:00 | 2 |
#include "bits/stdc++.h" #define int long long using namespace std; vector<int> eratosfen() { int n = 168841; vector<bool> res(n + 1, false); for (int i = 2; i <= n; ++i) { if (!res[i]) { for (int j = i * i; j < n; j += i) { res[j] = true; } } } vector<int> res2; for (int i = 2; i < res.size(); ++i) { if (!res[i]) { res2.push_back(i); } } return res2; } signed main() { int t; cin >> t; vector<int> a = eratosfen(); while (t--) { int n; cin >> n; if (n == 1) { cout << 2; continue; } cout << a[n - 1] << endl; } } you should count the eratosphen for a larger n in your function |
| hint | So Sui Ming | 1917. Titan Ruins: Deadly Accuracy | 5 Jan 2024 09:38 | 1 |
hint So Sui Ming 5 Jan 2024 09:38 Use cumulative count of sorted values. int64_t is not needed (e.g.WA3). |
| Any plan to support c++ 20? | HUECTRUM | | 3 Jan 2024 20:45 | 1 |
|
| WA23 | andreyDagger`~ | 1990. Podracing | 3 Jan 2024 20:12 | 1 |
WA23 andreyDagger`~ 3 Jan 2024 20:12 It's very strange but it seems that even long double precision doesn't enough for this problem. I had function get_x(polyline, y), that calculates x coordinate of polyline on coordinate y. I implemented it through binary searching and then calculating by formula, but that resulted in WA23. Then I made an optimisation: if polyline has integer point with coordinate y: (x, y), I instantly return x. Edited by author 03.01.2024 20:12 |
| What is test 4 ? | So Sui Ming | 1980. Road to Investor | 31 Dec 2023 19:21 | 1 |
I have done bs on overspeeding with upper bound of 1e12 and EPS of 1e-9. Any idea? Regards So Sui Ming |
| HINT | __Andrewy__ | 2167. Cipher Message 5 | 31 Dec 2023 11:49 | 1 |
HINT __Andrewy__ 31 Dec 2023 11:49 |