For this task:1805E - There Should Be a Lot of Maximums
This submission passed:318633319
This submission also passed: 318874332
Here is a testcase where their outputs differ (the first submission outputs a wrong answer)
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | adamant | 152 |
| 3 | Proof_by_QED | 146 |
| 3 | Um_nik | 146 |
| 5 | Dominater069 | 144 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
For this task:1805E - There Should Be a Lot of Maximums
This submission passed:318633319
This submission also passed: 318874332
Here is a testcase where their outputs differ (the first submission outputs a wrong answer)
8
4 6
5 1
1 6
6 2
2 3
3 8
7 8
3 1 4 2 2 4 1 3
4
4
4
0
0
4
4
4
4
4
2
2
4
4
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define inf INT_MAX
#define ll long long
#define mod 1000000007
map<ll,pair<ll,ll>> m;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll n,x; cin>>n>>x;
ll a[n];
for(int i=0;i<n;i++){
cin>>a[i];
m[a[i]].first++;
m[a[i]].second=i+1;
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
ll req=x-(a[i]+a[j]),h=m[req].first;
if(req==a[i] && req==a[j] && h>=3){
cout<<i+1<<" "<<j+1<<" "<<m[req].second;
return 0;
}
else if((req==a[i] || req==a[j]) && !(req==a[i] && req==a[j]) && h>=2){
cout<<i+1<<" "<<j+1<<" "<<m[req].second;
return 0;
}
else if((req!=a[i] && req!=a[j]) && h>=1){
cout<<i+1<<" "<<j+1<<" "<<m[req].second;
return 0;
}
}
}
cout<<"IMPOSSIBLE";
}
The complexity is O(n^2/2*logN) considering that N is up to 5000 the complexity would be 10^8*1.5 which is enough for 1 second. I also do simple operations like addition and subtraction.
Hello Codeforces I tried submitting my code for the problem A1. Gardener and the Capybaras (easy version) in the contest:Codeforces Round #843 (Div 2) and it said that the output was wrong for test case 1. Heres test case 1:bbba. My output: bb b a. What the Codeforces Judge says: wrong answer Ordering constrains were violated (test case 1). I'm sure that my output satisfies this condition: b≤a and b≤c. Is there something I missed because I read the problem a couple times and cant find any thing related to why my output would be wrong.
| Name |
|---|


