Show all threads Hide all threads Show all messages Hide all messages |
for those WA on #3 or #4 | cyc | 1921. Chaos and Order | 24 Feb 2024 07:45 | 1 |
please consider very small cases |
For people who have WA 6 | Komron | 1012. K-based Numbers. Version 2 | 23 Feb 2024 17:43 | 4 |
First i tried to solve this problem using int64 (long long) , i got WA6. Then i used long number theory to solve this problem and i got AC!) Good luck! what's that "long number theory" ? i think we need to switch to python. Yeah! Just use Python and it will be accepted! I think it's time to start to learn Java, just some simple things(like input and output) and BigInt. It could probably help me in those long arithmetics case. |
hint | So Sui Ming | 1692. Flags for Provinces | 23 Feb 2024 08:03 | 1 |
hint So Sui Ming 23 Feb 2024 08:03 Problem can be reduced to edges in complete graph: Given no. of edges, what is the max no. of vertices in a complete graph? |
WA on test 1, am I misunderstanding the output format? | sweepea | 1110. Power | 20 Feb 2024 17:27 | 1 |
del Edited by author 20.02.2024 17:47 |
Самая тупая задача | andreyDagger`~ | 1824. Ifrit Bomber | 20 Feb 2024 03:20 | 1 |
Я просто накидал кучу каких-то непонятных оптимизаций, и оно почему-то зашло |
problem 1001 c++ | Vasilisa | 1001. Reverse Root | 18 Feb 2024 11:36 | 1 |
//please tell me what's wrong, cause i cant understand... #include <bits/stdc++.h> #include<fstream> #define all(a) (a).begin(), (a).end() #define ll long long #define sz size #define dbl double #define vll vector <ll> #define INF LLONG_MAX #define uniq(x) x.resize(unique(begin(x),end(x))-begin(x)) #define forik(i,m,n) for(ll i=m;i<n;++i) #define re return using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(); vll numbers; ll num; while (cin >> num) { numbers.push_back(num); } for (ll i = numbers.size() - 1; i >= 0; i--) { dbl nek = sqrt(numbers[i]); cout << fixed << setprecision(4) << nek << endl; } re 0; } |
I don't know what is wrong with my code, could I use stack here? | JK Love | 1001. Reverse Root | 16 Feb 2024 11:59 | 2 |
#include <iostream> #include <stack> #include <cmath> using namespace std; int main() { stack<double> root; double input;
while(cin >> input) { root.push(sqrt(input)); }
while(!root.empty()) { cout << root.top() << endl; root.pop(); }
return 0; } Here your first input while is going infinnity. You have to stop it. |
Tests | Mescheryakov_Kirill [SESC17] | 1348. Goat in the Garden 2 | 16 Feb 2024 02:29 | 2 |
Tests Mescheryakov_Kirill [SESC17] 24 May 2016 22:57 435 981 301 -384 -1 345 0 Correct answer: 371.78 789.08 thanks for the test found a mistake ( ˘ ³˘)♥︎ |
Smallest possible automaton | Yury_Semenov | 1999. The secret module | 14 Feb 2024 16:19 | 1 |
My solution produces an automaton with 2n^2 + n states, but what is the smallest possible size? Is it still ~n^2? Edited by author 14.02.2024 16:19 |
Yes Accepted 0.078s | Shen Yang | 1999. The secret module | 14 Feb 2024 16:16 | 10 |
worked at least two months.... I think it is a hard problem,harder than some rating>1e4 problems... How did you get the skill to solve such a hard problems? I know generic patterns to effective skill training Interested in particular case Edited by author 08.11.2017 21:17 Just stop solving easy problems,and trying harder one.. I start solving hard problems since year 2010 practicing at http://poj.org solving AC<100 problems and at year 2013 I start solving topcoder Div I 1000pts.. later I found codeforces and start solve fewest AC problems.. There are also some Chinese oj hardest problems is very hard such like http://www.lydsy.com/JudgeOnline/ http://uoj.ac/ Yeah, solving hard is very helpful, I felt it At some point I noticed that I am just not able to solve some harder problem Because it takes very much time to solve So even if trying whole day then cannot solve Maybe whole week is enough But very rarely have an opportunity to solve a problem the whole week Typical have only three hours per day But it's at cost of sacrificing important things So I feel like I cannot improve further Yeah, solving hard is very helpful, I felt it At some point I noticed that I am just not able to solve some harder problem Because it takes very much time to solve So even if trying whole day then cannot solve Maybe whole week is enough But very rarely have an opportunity to solve a problem the whole week Typical have only three hours per day But it's at cost of sacrificing important things So I feel like I cannot improve further you can choose some easier than hardest problems but harder than medium problems if you don't have enough time to practice On spoj.com I have lot of tasks in my TODO list... Why do you consider it a hard problem? It felt quite straightforward to me Timus has very few constructive problems (at least with difficulty >= 2000), so this problem may seem hard compared to others if constructive problems are not your strong point |
How to test | Yury_Semenov | 1999. The secret module | 14 Feb 2024 16:13 | 1 |
Bruteforce all short numbers (i. e. length <= 3) and feed them to both input and output automata, then compare. Here are some useful tests: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 0 1 0 1 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 8 3 0 1 0 1 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 |
Many many tests | andreyDagger`~ | 1955. Boss, I Can See You! | 13 Feb 2024 22:59 | 1 |
These tests didn't help me figure out the issue, but maybe they can be useful for community 7 0 0 0 2 1 1 1 3 3 1 0 -1 -1 0 3.95284707521047407042 6 0 1 1 2 0 2 -1 1 -1 0 1 0 2.82842712474619029095 7 2 0 2 3 -2 3 -2 0 -2 -2 0 -2 2 -2 6.40312423743284853117 3 0 0 1 0 0 1 1.41421356237309514547 8 1 2 1 3 2 2 2 1 1 0 1 1 0 1 0 2 3.00000000000000000000 12 2 0 1 1 0 1 1 0 0 -2 -1 1 -1 2 0 2 -1 3 -4 0 0 -4 0 -1 6.79869268479037932229 12 2 0 1 1 0 1 1 0 -2 0 -1 1 -1 2 0 2 -1 3 -4 0 -3 -1 0 -1 6.00000000000000000000 7 0 0 1 2 1 1 3 1 1 -1 1 -3 -1 0 5.00000000000000000000 16 3 0 4 1 3 1 3 2 2 2 2 1 1 1 1 2 0 2 0 1 -1 1 -1 2 -2 2 -2 1 -3 1 -2 0 7.00000000000000000000 |
How to get AC on C++ | LeTim | 1306. Sequence Median | 13 Feb 2024 14:44 | 1 |
1. Use scanf/printf instead of cin/cout 2. Use make_heap, push_heap and pop_heap instead of priority_queue 3. Use C-style array instead of vector 4. Do not allocate n elements for an array |
its working in codeblocks so whats wrong?? | afia | 1068. Sum | 1 Feb 2024 21:33 | 1 |
#include<stdio.h> int main() { int i,n,sum; scanf("%d",&n); if(n>0) { for (i=1;i<=n;i++) { sum=sum+i; } printf("%d",sum); } if(n<0) { for (i=n;i<=1;i++) { sum=sum+i;} printf("%d",sum);} else if(n==0){ printf("not applicable");} } |
Test #5 / Тест 5 ошибка - решение | Danil Morozov | 1192. Ball in a Dream | 31 Jan 2024 16:52 | 1 |
If you are getting an error on test 5 then use double instead of float. Если у вас ошибка при 5ом тесте, используйте переменные double вместо float. |
WA 3 | Raphael Osipov | 1127. Colored Bricks | 31 Jan 2024 14:45 | 1 |
WA 3 Raphael Osipov 31 Jan 2024 14:45 |
O(1) c++ solution and BEST EXPLANATION | Mohamed | 1607. Taxi | 28 Jan 2024 07:35 | 2 |
i kinda changed the variables a = the first sum suggested by petr b = the ---------------------- taxi driver c = amount added by petr everytime d = ---------------- taxi driver we can say that at step n of bargaining: petr -> a + n*c taxi -> b - n*d where looking for a time when petr's suggestion is less than the drivers which means a + nc <= c - n*d but there sometime when petr suggest more than what the driver suggest the previous time. that's why i am comparing between the last petr's suggestion and the previous one of the driver a+c*n > b-d*(n-1). in this case petr says ok to the taxi driver and do not suggest more than that. void solve() { int a, c, b, d; cin >> a >> c >> b >> d; if (a >= b) { cout << a; return; } int n = (b-a)/(c+d); if ((b-1)%(c+d)!=0) n++; if (a+c*n > b-d*(n-1)) { cout << b - d*(n-1) << ln; } else { cout << a + n*c << ln; } } Edited by author 10.09.2022 21:11 could you help explain why: if ((b-1)%(c+d)!=0) n++; |
WA 7 | Catalin Cocis | 1232. Asteroid Landing | 27 Jan 2024 15:52 | 2 |
WA 7 Catalin Cocis 23 Apr 2010 23:34 I had WA7 when I computed maximal rotation angle incorrectly. |
WA2 | Yury_Semenov | 1473. Farm 2 | 25 Jan 2024 12:48 | 1 |
WA2 Yury_Semenov 25 Jan 2024 12:48 |
What is test#3 | bilibilitdasc | 1655. Somali Pirates | 24 Jan 2024 13:13 | 2 |
I kept getting wrong answer in test#3. What should I do? |