| Show all threads Hide all threads Show all messages Hide all messages |
| GIVE ME SOME TEST!!!!!! I STILL HAVE WA#2!!!!!!!!! | WuLF | 1430. Crime and Punishment | 6 Mar 2024 16:53 | 10 |
GIVE ME SOME TEST!!!!!! I STILL HAVE WA#2!!!!!!!!! [code deleted] this right? Edited by moderator 22.02.2006 00:38 var a,b,n,k1,k2:longint; begin readln(a,b,n); while n>=a do begin n:=n-a; k1:=k1+1; end; while n>=b do begin n:=n-b; k2:=k2+1; end; writeln(k1,' ',k2); end. земляк помоги решить 10 задачу или проверь Do you check if N=0?? sorry for doublepost Edited by author 11.02.2006 16:13 Whay it does not work too? (WA#2) var a, b, n: LongInt; x,y,xo,yo,q,w: LongInt; begin Read(a, b, n); x := n div a; xo := n mod a; y := n div b; yo := n mod b; q := x * a + xo div b * b; w := y * b + yo div a * a; If q >= w then WriteLn(x, ' ', xo div b) Else WriteLn(yo div a, ' ', y); end. 47 3 49 ans: 0 16 2 3 7 ans: 2 1 It is not guaranteed that A >= B and 2 test checks this. AFAIK if you will throw error if B > A, then you will get Runtime Error on test 2. Edited by author 06.03.2024 16:54 |
| Checker seems strange... @admins | Deepesson | 2049. Chemistry | 6 Mar 2024 08:46 | 1 |
"needs to make exactly k nano liters of the oxide in any of the test tubes" When you have k nano liters in a test tube that is not #1 the checker gives WA. My AC program was getting WA because my final test tube wasn't #1... Got WA #1 with the following output: 4 2 5 4 3 3 5 5 1 It seems correct, except for the fact the final tube is number 5, and not #1. Anyways, nice problem <3 |
| hint | So Sui Ming | 1537. Ents | 4 Mar 2024 10:59 | 1 |
hint So Sui Ming 4 Mar 2024 10:59 Problem statement is annoying to read. The following shows results from K=0 to K=50 (mod 1000000007). Hope this helps. 0 0 1 1 2 2 3 3 5 5 7 7 10 10 13 13 18 18 23 23 30 30 37 37 47 47 57 57 70 70 83 83 101 101 119 119 142 142 165 165 195 195 225 225 262 262 299 299 346 346 393 |
| Подправьте описание задачи на русском | Kon4enniyIdiot | 1030. Titanic | 3 Mar 2024 04:16 | 2 |
В конце замечаний на русском языке исправьте "для восточной/южной" на "для восточной/западной". Спасибо (долгота) Russian statements fixed. Thanks. |
| Hint! | Reshetnikov Andrey | 1579. Coat Transportation | 2 Mar 2024 20:57 | 1 |
Hint! Reshetnikov Andrey 2 Mar 2024 20:57 Think about O(N) solution, task much easier than is looks like. I use queue and got AC despite my solution probably has O(N * queue_work_complexity), not clearly O(N) |
| My code is accepted. | mars | 1877. Bicycle Codes | 1 Mar 2024 21:15 | 2 |
#include<iostream> using namespace std; int main(){ int a,b, thief[10000],i=0; cin>>a; cin>>b; int count = 0; for (int i = 0;i<10000;i++){ thief[i] = i; // cout<<thief[i]<<" ";
} for(i=0;i<10000;i++){ //cout<<"first"<<i<<endl; if(a==thief[i]||b==thief[i+1]){ count++;
} // cout<<"thief["<<i<<"]"<<thief[i]<<"\t"<<"thief["<<i+1<<"]"<<thief[i+1]<<endl; i=i+1; //cout<<"thief"<<i<<endl;
} if(count>0) cout<<"yes"; else cout<<"no"; } This code is not very efficient. Try this code instead: #include <iostream> using namespace std; int main(){ int key1;cin>>key1; int key2;cin>>key2; if((key1%2==0) || key2%2!=0){ cout<<"yes"<<endl; } else{ cout<<"no"<<endl; } return 0; } Edited by author 01.03.2024 21:16 Edited by author 01.03.2024 21:16 |
| WA#3 | sleepntsheep | 1705. Gangster Hares | 1 Mar 2024 14:01 | 1 |
WA#3 sleepntsheep 1 Mar 2024 14:01 What is test 3? I tried 1 (output 2) 2 (output 3) 3 (output 2) All of those are correct... |
| Hint please | sleepntsheep | 1745. Yet Another Answer | 29 Feb 2024 14:22 | 1 |
Edited by author 09.05.2025 09:16 |
| Tried all cases posted here but still getting WA3. | Gautam Singh | 1152. False Mirrors | 29 Feb 2024 07:35 | 2 |
It was due to overflow. I changed a few variables to long long and it got accepted. Edited by author 25.08.2015 13:20 Edited by author 25.08.2015 13:20 Please give some additional info |
| Can somebody help me, please ? | Abbos | 2070. Interesting Numbers | 29 Feb 2024 02:54 | 3 |
"Nikolay thinks an integer is interesting if it is a prime number. However, Asya thinks an integer is interesting if the amount of its positive divisors is a prime number " If it so, "Nikolay and Asya are happy when their tastes about some integer are common." How come it can be true, prime number is a number which does not have divisors except for 1 and itself, but it says ,in Asya sentence, that "amount of its positive divisors is a prime number ",Does it mean 1 and the number given ? Can somebody explain it to me and the sample given below the problem , please It means that all numbers, which are interesting to Nikolay, are also interesting to Asya, but there are some numbers, which are interested to Asya only. For example, in first sample: 3,5,6,7 are interested to both, 4 is interested only to Asya. And yes, surely divisors of some number include 1 and this number. Edited by author 06.08.2016 21:02 How can the number 6 be of interest to Nicholas if it is not prime? |
| Hint | So Sui Ming | 1134. Cards | 28 Feb 2024 08:03 | 1 |
Hint So Sui Ming 28 Feb 2024 08:03 The problem can be reduced to a matching problem. It can be solved by Dinic's algorithm. |
| WA 3, pls send me tests!!! | Dmitry | 1804. The Machinegunners in a Playoff | 27 Feb 2024 02:23 | 1 |
|
| WA #5 | R. Dubinin | 1929. Teddybears are not for Everyone | 26 Feb 2024 21:48 | 2 |
WA #5 R. Dubinin 22 Aug 2013 21:44 Re: WA #5 Reshetnikov Andrey 26 Feb 2024 21:48 Numbers of Haters can be placed in non-ascending order. After I started checking "1" not only at first position, I got AC |
| ternary search | Григорий | 1457. Heating Main | 25 Feb 2024 18:59 | 5 |
what about ternary search in this task? Edited by author 01.10.2020 22:01 Well I tried to do so but got wa4. I also looked at that guy's solution where he just takes the average of all p[i]. And I still cannot understand why it's right bcz, like, it's squared distance not just linear... Edited by author 29.07.2022 12:21 It's because of the first derivative. I tried it, and get WA4. I suspect I have a bug but idk where. I did some more digging. For those interested, try running your ternary search against the following test case (and then compare with the avg approach): ``` 20 9 8 5 12 5 6 89 45205 3554 1585 554422 654235 545324 548835 456432 804654 234758 444 5668 56435 ``` This in both cpp and python gives the wrong answer. By switching to the `Decimal` library in python, I was able to move past 4, and get TLE on 5. Using gmp in cpp might get you to AC, but I think the takeaway here is to only use ternary search when you can set the problem up to have an answer close to 0. |
| 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; } |