QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#215008 | #6550. Elimination Race | ucup-team1716# | WA | 0ms | 3856kb | C++20 | 950b | 2023-10-15 02:11:41 | 2023-10-15 02:11:42 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n;
cin >> n;
vector<vector<pair<int, int>>> order(n);
for(int i=0; i<n-1; i++)
{
for(int j=0; j<n; j++)
{
int x;
cin >> x;
order[x-1].pb({j+1, i+1});
}
}
vector<int> ans;
for(int i=0; i<n; i++)
{
sort(order[i].begin(), order[i].end());
for(int j=1; j<n; j++)
{
if(order[i][j-1].first <= j) ans.pb(order[i][j-1].second);
else break;
}
if(ans.size()==n-1)
{
cout << "Yes\n";
for(int i=n-2; i>=0; i--) cout << ans[i] << " ";
cout << "\n";
}
else cout << "No\n";
ans.clear();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
4 1 2 3 4 2 1 3 4 4 3 1 2
output:
Yes 3 2 1 No No No
result:
ok n=4, yes=1, no=3
Test #2:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
3 2 1 3 2 1 3
output:
No Yes 2 1 No
result:
ok n=3, yes=1, no=2
Test #3:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
2 1 2
output:
Yes 1 No
result:
ok n=2, yes=1, no=1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
2 2 1
output:
No Yes 1
result:
ok n=2, yes=1, no=1
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3624kb
input:
11 4 3 6 1 11 10 5 7 8 9 2 11 6 5 1 10 3 8 2 7 9 4 5 9 2 11 3 4 1 10 8 6 7 9 11 8 3 5 4 1 6 7 10 2 3 9 7 6 5 10 1 4 11 8 2 8 2 4 1 5 9 3 7 6 10 11 3 8 2 9 1 4 5 10 11 6 7 10 11 4 1 7 5 2 6 8 9 3 10 6 9 3 2 1 4 8 11 7 5 8 11 9 1 4 10 2 5 3 7 6
output:
No No No No No No No No No No No
result:
wrong answer Jury has the answer but participant has not