| Show all threads Hide all threads Show all messages Hide all messages |
| WA 8 | Maherka Vasyl (Ternopil NPU) | 1572. Yekaterinozavodsk Great Well | 10 Jul 2018 04:11 | 2 |
WA 8 Maherka Vasyl (Ternopil NPU) 27 Nov 2007 22:16 may be swap(2,3),i had wa8 and i swapped(2,3),somewhere |
| what is test 2 | shota | 1966. Cycling Roads | 9 Jul 2018 15:31 | 1 |
I tried everything and cannot pass the second test .. any help? |
| TO WA30 | Swadian | 1389. Roadworks | 6 Jul 2018 09:38 | 1 |
You guys have to sort the roads to be the same sequence as the input means first input,first output |
| shitty problem but i like him | pivasik | 1150. Page Numbers | 4 Jul 2018 23:17 | 1 |
Edited by author 04.07.2018 23:18 Edited by author 04.07.2018 23:18 |
| С++ | Nikita | 1910. Titan Ruins: Hidden Entrance | 4 Jul 2018 19:52 | 3 |
С++ Nikita 4 Jul 2018 16:06 Edited by author 04.07.2018 19:52 Why did you post that? What's the point? |
| I have solution, but I need some help. | I.J. Matrix | 1028. Stars | 3 Jul 2018 14:39 | 4 |
I have an O(n*log(n)) algorithm, which works successfull on all test cases at my Celeron 300. The time of working is incredible low (I used test with 15000 stars), but timus gives me Time limit exceeded. If anyone here has an idea where is the matter, I am ready to share my program with him. Mine is O(C*n).C is a constant number! Consider the most difficult way to make your programme been dead! Do not ignore any side! If your programme is written in C or C++, maybe I can help you! Send it to my box:ls223224@163.com! You know, if you'll always allocate a segment tree of size upper bound of N you will indeed acquire an O(n) solution... Although, it will be actually slower than the O(nlogn) one. I mean, boasting about your (undescribed) O(n) is never a good thing. (And also, I wanna boast with my algorithm theory knowledge and tell you that "O(C*n).C is a constant number!" looks quite silly). |
| Who has any idea on what's special about test 4? I've been debugging for days and have no clues. | Xifan | 1171. Lost in Space | 3 Jul 2018 12:49 | 1 |
Thanks a lot if anyone can give me some help! |
| WA4 Test | Gleb Koveshnikov | 1570. Eating High | 3 Jul 2018 12:23 | 1 |
WA4 Test Gleb Koveshnikov 3 Jul 2018 12:23 |
| WA #13. Dear Author, please comment | Darwin's Grove | 1964. Chinese Dialects | 3 Jul 2018 08:03 | 5 |
long min = n; for (int i = 0; i < k; i++) for (int j = i + 1; j < k; j++) { long diff = (data[i] + data[j] - n); if (diff < min) min = diff; } Console.WriteLine(min < 0 ? 0 : min); Sorry, it's my fault. This case find Max, not Min. Does you algorithm work (with your last changes)? It probably shouldn't (if I am correct) Consider the following 3 3 2 2 2 The answer, program will give you in this case is 1 But i can easily prove it is wrong: First man speaks dialects 1 and 2 Second one speaks dialects 2 and 3 The third speaks dialects 3 and 1 Therefore there is nobody, who can speak all three dialects |
| in case of WA#4 | nikitaevg | 1964. Chinese Dialects | 3 Jul 2018 06:56 | 4 |
Just use __int64 instead of long long. That helped me. int is enough for this problem. Using 64-bit ints didn't matter for my solution. However, this test case helped me fix WA 4: 10 3 5 4 8 |
| Poor test case | Haloom | 1404. Easy to Hack! | 2 Jul 2018 18:44 | 1 |
the original answer of fskdkskylp is ansthisone but my accepted code give this answer aêsthisone. my accepted code #include<bits/stdc++.h> using namespace std; int main() { char c[104]; scanf("%s",c); int l=strlen(c); int a[l+5]; int b[l+5]; for(int i=0; i<l; i++) { a[i]=c[i]-'a'; } b[0]=a[0]; if(a[0]<5) { b[0]=b[0]+26; } for(int i=1; i<l; i++) { int j=1; while((b[i]=a[i]+j*26)) { if(b[i]%26==a[i]&& b[i]>=b[i-1]) break; j++; } } printf("%c",b[0]-5+'a'); for(int i=1; i<l; i++) { int j=abs(b[i]-b[i-1]); printf("%c",j+'a'); } printf("\n"); return 0; } |
| WA5 test (AC program) | Gleb Koveshnikov | 1389. Roadworks | 2 Jul 2018 14:15 | 1 |
9 8 1 2 1 6 1 8 1 3 1 4 4 5 1 7 7 9 Answer: 3 7 9 1 2 4 5 |
| If you've got WA #11 | Pavel Khaustov [Tomsk PU] | 1542. Autocompletion | 30 Jun 2018 19:16 | 4 |
If you've got WA #11 then your program deals bad with repeatative queries. Try this test: -------------------- 2 acm 10000 acmicpc 10000 2 ac ac --------------------- Correct answer is: --------------------- acm acmicpc acm acmicpc --------------------- this code works fine for above input but still gives wa#11 I believe, this will help you 18 a 10 ba 0 bb 1 bc 1 bd 1 be 1 bf 1 bg 1 bh 1 bi 1 bj 1 bk 1 bl 1 bm 1 bn 1 bo 1 bp 1 bq 1 1 b ba can't be with zero frequency: 1 ≤ n_i ≤ 106 |
| question (+) | Vadimov Vasiliy[NNSU] | 1673. Admission to Exam | 29 Jun 2018 19:59 | 3 |
Is it true that k=f(n), where f(n) is Euler function? Edited by author 13.02.2009 22:03 Re: question(+) Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 13 Feb 2009 21:56 Yes =) 2 ADMINS: don't delete this hint. Really, it's easy to think it out - harder is to write If anyone got stuck with this. here is the well-known formula for computing phi function: phi(n) = product of [ p^{a - 1} * (p - 1) ], where factorized n = product [ p^a ]. The problem has a pretty fast brute force solution. Once you find a number K such that (K + 1) is prime and K divides phi(n) try to construct n with this prime (multiply by (K + 1) once and continue while phi(n) / (K + 1)^b is a multiple of (K + 1)). |
| WA8 | Alloiya | 2056. Scholarship | 28 Jun 2018 20:14 | 1 |
WA8 Alloiya 28 Jun 2018 20:14 |
| HINT! | Egor Suvorov | 1036. Lucky Tickets | 26 Jun 2018 11:29 | 13 |
HINT! Egor Suvorov 20 May 2007 15:45 Answers for big tests is very big. For example, for test "50 500" answer is "854559745684320697549060368131279814466643179689928095831053239604130293492672614469791533133321". Don't use long long or int64! Use long numbers (long arithmetic)! (Длинная арифметика) I dont have idea. Who can explain to me, how to solve this problem? thx a lot. Thank you for your hint,though I know to use long arithmetic(my arithmetic is wrong). I think the answer for the test"50 500" is "2691417369747203226859471552248904568444092968464995017156586373422740263569136967872156335261820969253753890314496",does anybody get the same answer as me? WAITING FOR HELP. I think the answer for the test"50 500" is "2691417369747203226859471552248904568444092968464995017156586373422740263569136967872156335261820969253753890314496",does anybody get the same answer as me? WAITING FOR HELP. The "HINT!" from Yegor Suvorov is correst, so yours is not. Re: HINT! Oleg Strekalovsky [Retired] 8 Feb 2010 01:16 Thanks!!!:) Edited by author 19.11.2010 11:14 Edited by author 28.10.2015 19:11 Yes, I think so! I think the answer for the test"50 500" is "2691417369747203226859471552248904568444092968464995017156586373422740263569136967872156335261820969253753890314496",does anybody get the same answer as me? WAITING FOR HELP. no! the answer is "854559745684320697549060368131279814466643179689928095831053239604130293492672614469791533133321" Edited by author 03.01.2017 23:05 hints :- 50 500 854559745684320697549060368131279814466643179689928095831053239604130293492672614469791533133321 ( this ans is correct ) make sure value of each digit must not exceed 9 |
| Some hint. | MrBones | 1943. Space Rummy | 26 Jun 2018 00:15 | 2 |
It's really very easy problem! Just shuffle! Indeed, I solved this problem by repeatedly testing random shuffles and printing NO if none of them was winning. |
| Wrong Answer on Test Case 2, Help me out | ismail5g | 1086. Cryptography | 25 Jun 2018 19:11 | 1 |
#include<bits/stdc++.h> using namespace std; int arr[15000],newarr[15000]; void sieve() { arr[0]=1; arr[1]=1; newarr[1]=2; for(int i=4; i<15000; i+=2) arr[i]=1; for(int i=3; i<15000; i+=2){ if(arr[i]!=1){ for(int j=i*2; j<15000; j+=i){ arr[j]=1; } } } } int main() { int n, t, k=1; sieve(); //cin>>n; for(int i=1; i<15000; i++){ if(arr[i]!=1){ newarr[k]=i; k++; } } cin>>t; while(t--){ cin>>n; cout<<newarr[n]<<endl; } return 0; } |
| Hint | KALO | 1246. Tethered Dog | 25 Jun 2018 12:52 | 2 |
Hint KALO 21 Nov 2010 18:23 Calculate the signed area of the polygon... Re: Hint Gilles Deleuze 25 Jun 2018 12:52 Firstly, find any point with largest X (or Y) coordinate and then compute the cross product of two vectors formed by two adjacent points and this point. You need to find a point with largest X (or Y) coordinate as the polygon is not convex. |
| accepted | Mikhail | 1821. Biathlon | 22 Jun 2018 17:20 | 1 |
//#pragma GCC optimize("Ofast,no-stack-protector") //#pragma GCC target("avx") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds; using namespace std;
#define re return #define pb push_back #define eb emplace_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define sqrt(x) sqrt(abs(x)) #define mp make_pair #define pi (3.14159265358979323846264338327950288419716939937510) #define fo(i, n) for(int i = 0; i < n; ++i) #define ro(i, n) for(int i = n - 1; i >= 0; --i) #define unique(v) v.resize(unique(all(v)) - v.begin())
template <class T> T abs (T x) { re x > 0 ? x : -x; } template <class T> T sqr (T x) { re x * x; } template <class T> T gcd (T a, T b) { re a ? gcd (b % a, a) : b; } template <class T> int sgn (T x) { re x > 0 ? 1 : (x < 0 ? -1 : 0); }
typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<string> vs; typedef double D; typedef long double ld; typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef unsigned long long ull; typedef tree <pair<int, char>, null_type, less<pair<int, char>>, rb_tree_tag, tree_order_statistics_node_update> _tree; vector< tuple <int, int, string> > v; vs ans; int calc() { string ans; cin >> ans; re (ans[0] - '0') * 6000 + (ans[1] - '0') * 600 + (ans[3] - '0') * 100 + (ans[4] - '0') * 10 + (ans[6] - '0'); } int main() { int best = (int) 1e9, n, cur; cin >> n; string str; fo(i, n) { cin >> str; cur = calc(); v.pb(make_tuple(cur + i * 300, cur, str)); } sort(all(v)); int finish, res; fo(i, v.size()) { tie(finish, res, str) = v[i]; if (res < best) { best = res; ans.pb(str); } } sort(all(ans)); cout << ans.size() << endl; for (auto &j : ans) cout << j << '\n'; re 0; } Edited by author 22.06.2018 17:22 |