# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1036239 |
2024-07-27T06:43:22 Z |
vjudge1 |
Med (COCI22_med) |
C++17 |
|
0 ms |
348 KB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int const N=2e5+5;
int const mod=1e9+7;
int main(){
int n;
cin>>n;
pair<int,string> con[n];
for (int i = 0; i < n; ++i)
{
cin>>con[i].second;
for (int j = 0; j < 5; ++j)
{
int a;
cin>>a;
con[i].first-=a;
}
// cout<<con[i].first<<' '<<con[i].second<<endl;
}
sort(con,con+n);
// for (int i = 0; i < n; ++i)
// {
// cout<<con[i].first<<' '<<con[i].second<<endl;
// }
pair<int,string> cur;
for (int i = 0; i < n; ++i)
{
cur=con[i];
//find best
cur.first-=500;
// con[i].first-=500;
int b=i,w=n-1;
for (int j = 0; j < i; ++j)
{
if(cur<=con[j]){
b=j;
break;
}
}
cur.first+=1000;
// con[i].first+=1000;
for (int j = i+1; j < n; ++j)
{
if(cur<=con[j]){
w=j-1;
break;
}
}
// con[i].first-=500;
cout<<b+1<<' '<<w+1<<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |