Submission #64301534
Source Code Expand
Copy
# include <bits/stdc++.h>using namespace std;int n , t , r = 1 , cnt , maxn , a[110] , f[110];int main(){cin >> n;for(int i = 1 ; i <= n ; i ++){cin >> a[i];}cnt = n;while(cnt){t = maxn = 0;for(int i = 1 ; i <= n ; i ++){if(!f[i]){maxn = max(maxn , a[i]);}}
# include <bits/stdc++.h> using namespace std; int n , t , r = 1 , cnt , maxn , a[110] , f[110]; int main() { cin >> n; for(int i = 1 ; i <= n ; i ++) { cin >> a[i]; } cnt = n; while(cnt) { t = maxn = 0; for(int i = 1 ; i <= n ; i ++) { if(!f[i]) { maxn = max(maxn , a[i]); } } for(int i = 1 ; i <= n ; i ++) { if(a[i] == maxn) { f[i] = r; cnt --; t ++; } } r += t; } for(int i = 1 ; i <= n ; i ++) { cout << f[i] << "\n"; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Ranking with Ties |
User | zhangyimin12345 |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 737 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3676 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 03_sorted_00.txt, 03_sorted_01.txt, 04_handmade_00.txt, 04_handmade_01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3624 KB |
00_sample_01.txt | AC | 1 ms | 3480 KB |
00_sample_02.txt | AC | 1 ms | 3464 KB |
00_sample_03.txt | AC | 1 ms | 3524 KB |
01_random_00.txt | AC | 1 ms | 3408 KB |
01_random_01.txt | AC | 1 ms | 3536 KB |
01_random_02.txt | AC | 1 ms | 3472 KB |
01_random_03.txt | AC | 1 ms | 3676 KB |
02_random2_00.txt | AC | 1 ms | 3488 KB |
02_random2_01.txt | AC | 1 ms | 3460 KB |
02_random2_02.txt | AC | 1 ms | 3480 KB |
02_random2_03.txt | AC | 1 ms | 3484 KB |
02_random2_04.txt | AC | 1 ms | 3540 KB |
02_random2_05.txt | AC | 1 ms | 3676 KB |
02_random2_06.txt | AC | 1 ms | 3524 KB |
02_random2_07.txt | AC | 1 ms | 3588 KB |
02_random2_08.txt | AC | 1 ms | 3452 KB |
03_sorted_00.txt | AC | 1 ms | 3488 KB |
03_sorted_01.txt | AC | 1 ms | 3676 KB |
04_handmade_00.txt | AC | 1 ms | 3536 KB |
04_handmade_01.txt | AC | 1 ms | 3532 KB |