| Show all threads Hide all threads Show all messages Hide all messages |
| Good simulation problem | silverfox | 1131. Copying | 28 Apr 2022 22:29 | 1 |
Hint: we start from kk = 1, then kk += kk (2), kk += kk (4) but we cannot advance when kk > k. get to the maximum kk with this and the remaining n - kk can be easily calculated with (n - kk) / k + (((n - kk) % k) > 0) |
| Use array of bitset | Сонечка | 1249. Ancient Necropolis | 24 Apr 2022 16:01 | 2 |
Or array of vector <bool>. It uses less memory too. |
| tle in c++ and ac in java | alphaplus | 1208. Legendary Teams Contest | 24 Apr 2022 12:49 | 3 |
my same logic got tle in c++ but AC in java so beware LOL. That's interesting. Could you share code please? That's because in Java objects like String pass by their links, when in C++ strings pass by their values(all chars). So when you move a string in Java you do less operations than you do in C++ Edited by author 24.04.2022 12:50 |
| Hint | basuki | 1491. Unreal Story | 24 Apr 2022 11:50 | 2 |
Hint basuki 25 Mar 2019 08:32 Segment Tree/ Fenwick Tree with range update and point query Too expensive for this problem. You can just add c to some array[a] and add -c to array[b + 1]. So when you need to print the answer, you just do loop through all knights from 1 to n and firstly add value from array[i] to some variable, then print this variable. |
| WA#15 | hduads2022_20321227 | 1628. White Streaks | 24 Apr 2022 11:34 | 1 |
WA#15 hduads2022_20321227 24 Apr 2022 11:34 please give me some tips! Edited by author 24.04.2022 16:19 |
| Python3 answer | Evgeniy | 1787. Turn for MEGA | 23 Apr 2022 15:50 | 3 |
k, n = [int(x) for x in input().split()] a = list(map(int, input().split())) m = 0 for i in a: m += i if (m - k >= 0): m -= k else: m = 0 print(m) explain please. for whar we need n then? try this example: 4 3 1 5 6 You cannot pass the sixth test. In the first minute there are 0 cars left. In the second minute there was 1 car left. At the third minute there were 2+1 cars left. Read the conditions of the task more carefully. )))) |
| if you have #WA 8 ... try this test case... | Adhambek | 2034. Caravans | 22 Apr 2022 13:45 | 5 |
6 6 1 2 2 3 3 4 4 5 1 6 6 5 1 5 6 ans : 0 oh,no!my answer is 0 but WA in test 8...... Actually it's 0. We should stay in 6, since there is only 1 shortest path. I have an another test case: 8 8 1 2 1 6 2 4 6 7 3 4 4 5 7 8 5 8 1 8 3 Answer: 3 |
| USE e=0.000000001 to get AC | samplex | 1011. Conductors | 21 Apr 2022 19:48 | 3 |
With e=0.0000001 I have WA#14 with 0.000001 i got AC Me too. round(v, 6) in Python. |
| Test for WA 1 | _Otabek | 1018. Binary Apple Tree | 21 Apr 2022 19:37 | 1 |
7 5 1 2 20 2 5 100 2 3 20 6 3 70 4 1 10 3 7 5 Answer: 220 Edited by author 21.04.2022 19:37 |
| WRONG ANSWER ON TEST #3??? | the114514 | 1012. K-based Numbers. Version 2 | 21 Apr 2022 18:36 | 1 |
#include <iostream> #include <string> #include <cmath> #include <cstdio> #include <cctype> #include <cstring> #include <iomanip> #include <cstdlib> #include <ctime> #include <set> #include <map> #include <utility> #include <queue> #include <vector> #include <bitset> #include <stack> #include <sstream> #include <algorithm> #define ll long long using namespace std; #define maxn 1805 #define maxk 1805 const int MAX_ONE = 1000000000; struct x86_64 { int Length = 0, BigNum[1024] = {}; x86_64(int Num = 0) { int Index = 0; while (Num) { BigNum[Index++] = Num % MAX_ONE; Num /= MAX_ONE; } Length = Index; } void operator =(int Num) { memset(BigNum, 0, sizeof(BigNum)); int Index = 0; while (Num) { BigNum[Index++] = Num % MAX_ONE; Num /= MAX_ONE; } Length = Index; } }; void print(x86_64 Num) { for (int i = Num.Length - 1; i >= 0; i--) { if (i != Num.Length - 1) { printf("%09d", Num.BigNum[i]); } else { printf("%d", Num.BigNum[i]); } } } x86_64 operator +(x86_64 A, x86_64 B) { int Length = max(A.Length, B.Length); int Carry = 0; x86_64 Answer; for (int i = 0; i < Length + 1; i++) { Answer.BigNum[i] = (A.BigNum[i] + B.BigNum[i] + Carry) % MAX_ONE; Carry = (A.BigNum[i] + B.BigNum[i] + Carry) / MAX_ONE; } Answer.Length = (Answer.BigNum[Length] == 1) + Length; return Answer; } x86_64 operator *(x86_64 A, int B) { int Length = A.Length; int Carry = 0; x86_64 Answer; for (int i = 0; i < Length + 1; i++) { Answer.BigNum[i] = (A.BigNum[i] * (ll)B + Carry) % MAX_ONE; Carry = (A.BigNum[i] * (ll)B + Carry) / MAX_ONE; } int Index = 0; while (Answer.BigNum[Index] != 0) { Index++; } Answer.Length = Index; return Answer; } x86_64 dp[maxn][2]; int main() { int N, K; scanf("%d %d", &N, &K); dp[1][1] = K - 1; for (int i = 2; i <= N; i++) { dp[i][0] = dp[i - 1][1]; dp[i][1] = dp[i - 1][0] + dp[i - 1][1] * (K - 1); } print(dp[N][0] + dp[N][1]); putchar('\n'); return 0; } |
| WHY WA#6?HERE IS MY CODE!!THANK!!!! | CHIDEMYAN SERGEY | 1012. K-based Numbers. Version 2 | 21 Apr 2022 18:09 | 12 |
#include<iostream.h> #include<stdio.h> int main() { int n,i,k;unsigned __int64 a[2000],p; cin>>n>>k;a[1]=k-1;a[2]=k*(k-1); for(i=3;i<=n;i++) {a[i]=(k-1)*(a[i-1]+a[i-2]);p=a[i];} if(n==1) cout<<k-1; else if(n==2) cout<<k*(k-1); else if(n>=3) printf("%I64u", p); return 0; } Edited by author 10.04.2007 21:30 Edited by author 10.04.2007 21:31 Edited by author 10.04.2007 21:32 I have no idea!I have submit 3 times I WA at test 6 !My Good! I have no idea!I have submit 3 times My AC code for input 10 170 gives 20035832260288179816689 Compare this to the max value of unsigned __int64: 18446744073709551615 Yeah, in this problem the answer can be bigger than int64. Use high precision instead, or Java. "我操!高精度?" What?! Edited by author 14.12.2011 12:24 Edited by author 14.12.2011 12:24 Edited by author 14.12.2011 12:24 "我操!高精度?" What?! Edited by author 14.12.2011 12:24 Edited by author 14.12.2011 12:24 Edited by author 14.12.2011 12:24 It means "F*CK! High precision?" It's not just High precision! Easy : 6 8 2 6 4 1 3 means 3146286 Hard : 286 146 3 means 3146286 |
| TLE on Test Case 2 | Jyotirmay Nag | 1083. Factorials!!! | 21 Apr 2022 10:13 | 1 |
#include<bits/stdc++.h> using namespace std; int main() { int n; int mul = 1; string s; cin>>n>>s; int k = s.size(); if(n%k==0){ int in = n; int temp = k; while(1){ mul = mul*in; in = in - k; if(in==k){ mul*=in; break; } } } else{ int in = n; while(1){ mul = mul*in; in = in - k; if(in==(n%k)){ mul*=in; break; } } } cout<<mul<<endl; return 0; } What is test case 2? |
| Why can the Author do trick on me | DarksideCoder | 2093. All Roads Lead to Snowdrift | 21 Apr 2022 05:10 | 1 |
WA5,and never get Accept without High Eps.It isn't a good Problem. |
| what's the answer when N=170 and K=10? | mythysjh | 1012. K-based Numbers. Version 2 | 20 Apr 2022 18:19 | 3 |
what's the answer when N=170 and K=10? 19140929114881653462476041684116627391559236845580909494492016732196087599513580596508681339397425705393057484060909466165965897483835868175679753976672747715432612675930 What a nice......no, what a long answer! Edited by author 20.04.2022 18:19 |
| Test for WA4 and WA5 | Anton Smoliakov | 2144. Cleaning the Room | 20 Apr 2022 11:36 | 1 |
If you get WA4, try this test: 2 3 1 3 2 1 5 NO For WA5 try this: 2 1 5 1 5 YES |
| WA 23 | Tengiz | 1510. Order | 19 Apr 2022 17:25 | 1 |
WA 23 Tengiz 19 Apr 2022 17:25 |
| runtime c# | Gerasimov Alexander Dmitrievich | 1250. Sea Burial | 18 Apr 2022 22:56 | 1 |
runtime c# Gerasimov Alexander Dmitrievich 18 Apr 2022 22:56 if you get runtime in c#, it's probably stack overflow. So use bfs instead of dfs, it helped me! |
| Hack | DarksideCoder | 1441. From the History of Gringotts Bank | 18 Apr 2022 06:37 | 1 |
Hack DarksideCoder 18 Apr 2022 06:37 InPut 5 5 1 4 4 5 5 1 1 2 2 3 OutPut 3 2 1 4 5 1 |
| WA Test 8 | Mar-i-ya | 1604. Country of Fools | 18 Apr 2022 01:46 | 1 |
|
| Why wrong answer? | Ferro | 1138. Integer Percentage | 16 Apr 2022 18:44 | 1 |
#include <iostream> #include <vector> using namespace std; int main() { int n, s; cin >> n >> s; vector<int> nums(n + 1, 1); for (int i = s; i <= n; i++) { for (int j = 101; j <= 200; j++) { if ((i * j) % 100 == 0 and (i * j) / 100 <= n) { nums[(i * j) / 100] = nums[(i * j) / 100] > nums[i] + 1 ? nums[(i * j) / 100] : nums[i] + 1; } } } cout << nums[n] << endl; return 0; } |