Task: | Good grades |
Sender: | aalto2024j_002 |
Submission time: | 2024-11-06 17:24:50 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | WRONG ANSWER | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | ACCEPTED | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
#18 | ACCEPTED | 0.00 s | details |
#19 | ACCEPTED | 0.00 s | details |
#20 | WRONG ANSWER | 0.00 s | details |
#21 | WRONG ANSWER | 0.00 s | details |
#22 | WRONG ANSWER | 0.00 s | details |
#23 | WRONG ANSWER | 0.00 s | details |
#24 | ACCEPTED | 0.00 s | details |
#25 | WRONG ANSWER | 0.00 s | details |
#26 | ACCEPTED | 0.00 s | details |
#27 | ACCEPTED | 0.00 s | details |
#28 | ACCEPTED | 0.00 s | details |
#29 | ACCEPTED | 0.00 s | details |
#30 | WRONG ANSWER | 0.00 s | details |
#31 | WRONG ANSWER | 0.00 s | details |
#32 | WRONG ANSWER | 0.00 s | details |
#33 | WRONG ANSWER | 0.00 s | details |
#34 | WRONG ANSWER | 0.00 s | details |
#35 | WRONG ANSWER | 0.00 s | details |
#36 | WRONG ANSWER | 0.00 s | details |
#37 | WRONG ANSWER | 0.00 s | details |
#38 | WRONG ANSWER | 0.00 s | details |
#39 | WRONG ANSWER | 0.00 s | details |
#40 | WRONG ANSWER | 0.00 s | details |
#41 | WRONG ANSWER | 0.00 s | details |
#42 | WRONG ANSWER | 0.00 s | details |
#43 | WRONG ANSWER | 0.00 s | details |
#44 | WRONG ANSWER | 0.00 s | details |
#45 | WRONG ANSWER | 0.00 s | details |
#46 | WRONG ANSWER | 0.00 s | details |
#47 | WRONG ANSWER | 0.00 s | details |
#48 | WRONG ANSWER | 0.00 s | details |
#49 | WRONG ANSWER | 0.00 s | details |
#50 | WRONG ANSWER | 0.00 s | details |
#51 | WRONG ANSWER | 0.00 s | details |
#52 | WRONG ANSWER | 0.00 s | details |
#53 | WRONG ANSWER | 0.00 s | details |
#54 | WRONG ANSWER | 0.00 s | details |
#55 | WRONG ANSWER | 0.00 s | details |
#56 | WRONG ANSWER | 0.00 s | details |
#57 | WRONG ANSWER | 0.00 s | details |
#58 | WRONG ANSWER | 0.00 s | details |
#59 | WRONG ANSWER | 0.00 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:35:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare] 35 | if(i==smart.size()-1){ | ~^~~~~~~~~~~~~~~~ input/code.cpp:54:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare] 54 | for(int i=0; i<smart.size(); i++){ | ~^~~~~~~~~~~~~ input/code.cpp:58:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 58 | for(int i=0;i<output.size(); i++){ | ~^~~~~~~~~~~~~~ input/code.cpp:60:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'}...
Code
#include <iostream> #include <vector> #include <bits/stdc++.h> #include <set> using namespace std; int main(){ int n, g; cin >> n >> g; vector<pair<int, int>> smart(n); set<int> s; for(int i=0; i<n; i++){ int temp; cin >> temp; smart[i]=make_pair(temp,i); s.insert(temp); } sort(smart.begin(), smart.end()); vector<int> group(n); int grp=1; // g -> numerp de grupos // grp -> assignar numeros int actual = -1; for(int i=smart.size()-1; i>=0; i--){ if(i==smart.size()-1){ actual = smart[i].first; group[i] = grp; } else if(grp == g){ group[i] = grp; } else if (smart[i].first==actual and i>g-grp) { group[i] = grp; } else{ grp += 1; group[i] = grp; } } vector<int> output(n); for(int i=0; i<smart.size(); i++){ output[smart[i].second]=group[i]; } for(int i=0;i<output.size(); i++){ cout << output[i]; if(i!=output.size()-1)cout << " "; } cout << endl; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1 1 8 |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Verdict: ACCEPTED
input |
---|
2 2 7 6 |
correct output |
---|
2 1 |
user output |
---|
1 2 |
Test 3
Verdict: ACCEPTED
input |
---|
2 1 7 7 |
correct output |
---|
1 1 |
user output |
---|
1 1 |
Test 4
Verdict: ACCEPTED
input |
---|
2 2 7 1 |
correct output |
---|
2 1 |
user output |
---|
1 2 |
Test 5
Verdict: ACCEPTED
input |
---|
3 1 5 10 8 |
correct output |
---|
1 1 1 |
user output |
---|
1 1 1 |
Test 6
Verdict: ACCEPTED
input |
---|
3 1 6 10 2 |
correct output |
---|
1 1 1 |
user output |
---|
1 1 1 |
Test 7
Verdict: ACCEPTED
input |
---|
4 1 10 10 4 2 |
correct output |
---|
1 1 1 1 |
user output |
---|
1 1 1 1 |
Test 8
Verdict: ACCEPTED
input |
---|
4 4 5 1 5 4 |
correct output |
---|
3 1 4 2 |
user output |
---|
2 4 1 3 |
Test 9
Verdict: WRONG ANSWER
input |
---|
4 2 1 6 7 1 |
correct output |
---|
1 2 2 1 |
user output |
---|
2 2 1 2 |
Test 10
Verdict: ACCEPTED
input |
---|
5 3 6 8 9 7 9 |
correct output |
---|
1 2 3 1 3 |
user output |
---|
3 2 1 3 1 |
Test 11
Verdict: ACCEPTED
input |
---|
5 3 10 8 10 1 2 |
correct output |
---|
3 2 3 1 1 |
user output |
---|
1 2 1 3 3 |
Test 12
Verdict: ACCEPTED
input |
---|
5 3 2 1 10 6 10 |
correct output |
---|
1 1 3 2 3 |
user output |
---|
3 3 1 2 1 |
Test 13
Verdict: WRONG ANSWER
input |
---|
5 3 1 8 9 3 2 |
correct output |
---|
1 3 3 2 1 |
user output |
---|
3 2 1 3 3 |
Test 14
Verdict: ACCEPTED
input |
---|
5 5 10 6 2 10 9 |
correct output |
---|
4 2 1 5 3 |
user output |
---|
2 4 5 1 3 |
Test 15
Verdict: ACCEPTED
input |
---|
5 2 1 9 9 3 4 |
correct output |
---|
1 2 2 1 1 |
user output |
---|
2 1 1 2 2 |
Test 16
Verdict: ACCEPTED
input |
---|
5 5 10 4 3 9 1 |
correct output |
---|
5 3 2 4 1 |
user output |
---|
1 3 4 2 5 |
Test 17
Verdict: ACCEPTED
input |
---|
5 1 3 8 4 5 10 |
correct output |
---|
1 1 1 1 1 |
user output |
---|
1 1 1 1 1 |
Test 18
Verdict: ACCEPTED
input |
---|
5 5 1 10 3 9 4 |
correct output |
---|
1 5 2 4 3 |
user output |
---|
5 1 4 2 3 |
Test 19
Verdict: ACCEPTED
input |
---|
5 1 4 6 5 5 1 |
correct output |
---|
1 1 1 1 1 |
user output |
---|
1 1 1 1 1 |
Test 20
Verdict: WRONG ANSWER
input |
---|
10 6 6 8 9 7 9 6 9 5 7 7 |
correct output |
---|
2 4 5 3 5 2 6 1 3 3 |
user output |
---|
6 2 1 5 1 6 1 6 4 3 |
Test 21
Verdict: WRONG ANSWER
input |
---|
10 5 10 8 10 1 2 4 10 2 3 1 |
correct output |
---|
5 4 5 1 2 3 5 2 2 1 |
user output |
---|
1 2 1 5 5 3 1 5 4 5 |
Test 22
Verdict: WRONG ANSWER
input |
---|
10 5 2 1 10 6 10 5 5 5 4 4 |
correct output |
---|
1 1 5 4 5 3 3 3 2 2 |
user output |
---|
5 5 1 2 1 5 4 3 5 5 |
Test 23
Verdict: WRONG ANSWER
input |
---|
10 6 1 8 9 3 2 6 6 9 5 9 |
correct output |
---|
1 5 6 2 1 4 4 6 3 6 |
user output |
---|
6 2 1 6 6 4 3 1 5 1 |
Test 24
Verdict: ACCEPTED
input |
---|
10 10 10 6 2 10 9 8 7 7 6 3 |
correct output |
---|
9 3 1 10 8 7 5 6 4 2 |
user output |
---|
2 8 10 1 3 4 6 5 7 9 |
Test 25
Verdict: WRONG ANSWER
input |
---|
10 3 1 9 9 3 4 10 10 5 1 7 |
correct output |
---|
1 3 3 1 2 3 3 2 1 2 |
user output |
---|
3 3 2 3 3 1 1 3 3 3 |
Test 26
Verdict: ACCEPTED
input |
---|
10 9 10 4 3 9 1 1 4 2 10 6 |
correct output |
---|
8 4 3 7 1 1 5 2 9 6 |
user output |
---|
2 6 7 3 9 9 5 8 1 4 |
Test 27
Verdict: ACCEPTED
input |
---|
10 1 3 8 4 5 10 8 5 10 4 6 |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 |
user output |
---|
1 1 1 1 1 1 1 1 1 1 |
Test 28
Verdict: ACCEPTED
input |
---|
10 9 1 10 3 9 4 6 9 3 5 1 |
correct output |
---|
1 9 2 7 4 6 8 3 5 1 |
user output |
---|
9 1 8 3 6 4 2 7 5 9 |
Test 29
Verdict: ACCEPTED
input |
---|
10 1 4 6 5 5 1 2 4 2 1 3 |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 |
user output |
---|
1 1 1 1 1 1 1 1 1 1 |
Test 30
Verdict: WRONG ANSWER
input |
---|
100 55 636562060 767928734 906523441 ... |
correct output |
---|
32 42 50 33 51 29 50 23 35 37 ... |
user output |
---|
42 23 9 41 7 47 8 55 35 32 55 ... |
Test 31
Verdict: WRONG ANSWER
input |
---|
100 42 773442532 122816 137572579 324... |
correct output |
---|
34 1 8 16 9 13 6 20 10 19 18 3... |
user output |
---|
22 42 42 42 42 42 42 42 42 42 ... |
Test 32
Verdict: WRONG ANSWER
input |
---|
100 44 198730372 27838076 590195590 4... |
correct output |
---|
9 1 28 21 23 20 15 16 7 10 36 ... |
user output |
---|
44 44 33 44 44 44 44 44 44 44 ... |
Test 33
Verdict: WRONG ANSWER
input |
---|
100 56 75940263 760367935 901888417 3... |
correct output |
---|
6 44 51 19 8 33 36 54 29 54 1 ... |
user output |
---|
56 21 9 56 56 40 34 5 50 3 56 ... |
Test 34
Verdict: WRONG ANSWER
input |
---|
100 97 967034924 587586158 185430194 ... |
correct output |
---|
94 59 19 88 79 67 77 64 27 15 ... |
user output |
---|
4 41 82 10 20 33 22 36 74 86 7... |
Test 35
Verdict: WRONG ANSWER
input |
---|
100 23 59249204 934941692 892631472 2... |
correct output |
---|
2 22 21 6 10 23 12 3 15 11 19 ... |
user output |
---|
23 7 11 23 23 3 23 23 23 23 20... |
Test 36
Verdict: WRONG ANSWER
input |
---|
100 90 356460601 224848374 881788059 ... |
correct output |
---|
23 14 83 4 1 28 8 54 7 48 56 3... |
user output |
---|
77 87 10 90 90 72 90 44 90 51 ... |
Test 37
Verdict: WRONG ANSWER
input |
---|
100 8 244103474 837431431 342493822 ... |
correct output |
---|
2 7 3 5 7 5 3 6 3 5 1 1 5 3 1 ... |
user output |
---|
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ... |
Test 38
Verdict: WRONG ANSWER
input |
---|
100 88 11934038 257096283 933290530 4... |
correct output |
---|
1 24 83 40 56 80 23 44 1 62 46... |
user output |
---|
88 73 6 55 36 10 74 49 88 28 4... |
Test 39
Verdict: WRONG ANSWER
input |
---|
100 2 391337048 538883744 535937150 ... |
correct output |
---|
1 2 2 2 1 1 1 1 1 1 2 1 1 1 1 ... |
user output |
---|
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ... |
Test 40
Verdict: WRONG ANSWER
input |
---|
200 110 636562060 767928734 906523441 ... |
correct output |
---|
69 86 99 70 101 61 100 47 74 7... |
user output |
---|
76 41 17 75 15 91 16 110 66 61... |
Test 41
Verdict: WRONG ANSWER
input |
---|
200 84 773442532 122816 137572579 324... |
correct output |
---|
66 1 14 28 16 23 11 36 18 35 3... |
user output |
---|
46 84 84 84 84 84 84 84 84 84 ... |
Test 42
Verdict: WRONG ANSWER
input |
---|
200 88 198730372 27838076 590195590 4... |
correct output |
---|
17 3 53 42 45 40 29 30 13 18 6... |
user output |
---|
88 88 78 88 88 88 88 88 88 88 ... |
Test 43
Verdict: WRONG ANSWER
input |
---|
200 111 75940263 760367935 901888417 3... |
correct output |
---|
8 85 100 35 14 62 71 106 51 10... |
user output |
---|
111 49 20 111 111 93 78 10 111... |
Test 44
Verdict: WRONG ANSWER
input |
---|
200 194 967034924 587586158 185430194 ... |
correct output |
---|
185 114 39 173 151 128 147 124... |
user output |
---|
11 84 161 23 46 70 50 74 149 1... |
Test 45
Verdict: WRONG ANSWER
input |
---|
200 45 59249204 934941692 892631472 2... |
correct output |
---|
3 43 41 11 19 45 25 5 30 21 37... |
user output |
---|
45 12 21 45 45 6 45 45 45 45 4... |
Test 46
Verdict: WRONG ANSWER
input |
---|
200 179 356460601 224848374 881788059 ... |
correct output |
---|
54 33 162 8 4 61 15 113 14 99 ... |
user output |
---|
142 164 22 179 179 134 179 78 ... |
Test 47
Verdict: WRONG ANSWER
input |
---|
200 16 244103474 837431431 342493822 ... |
correct output |
---|
4 14 6 8 13 9 6 10 5 10 2 2 8 ... |
user output |
---|
16 16 16 16 16 16 16 16 16 16 ... |
Test 48
Verdict: WRONG ANSWER
input |
---|
200 175 11934038 257096283 933290530 4... |
correct output |
---|
2 40 165 67 105 157 37 77 2 11... |
user output |
---|
175 153 11 124 80 20 156 113 1... |
Test 49
Verdict: WRONG ANSWER
input |
---|
200 3 391337048 538883744 535937150 ... |
correct output |
---|
2 2 2 2 1 1 1 1 1 1 3 2 1 1 1 ... |
user output |
---|
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ... |
Test 50
Verdict: WRONG ANSWER
input |
---|
500 275 636562060 767928734 906523441 ... |
correct output |
---|
176 215 251 178 254 161 252 12... |
user output |
---|
184 107 46 182 40 218 44 275 1... |
Test 51
Verdict: WRONG ANSWER
input |
---|
500 209 773442532 122816 137572579 324... |
correct output |
---|
163 1 31 72 37 57 23 89 45 87 ... |
user output |
---|
113 209 209 209 209 209 209 20... |
Test 52
Verdict: WRONG ANSWER
input |
---|
500 218 198730372 27838076 590195590 4... |
correct output |
---|
42 8 130 102 113 97 73 75 34 4... |
user output |
---|
218 218 191 218 218 218 218 21... |
Test 53
Verdict: WRONG ANSWER
input |
---|
500 276 75940263 760367935 901888417 3... |
correct output |
---|
20 205 249 85 32 149 165 267 1... |
user output |
---|
276 121 46 276 276 220 192 16 ... |
Test 54
Verdict: WRONG ANSWER
input |
---|
500 484 967034924 587586158 185430194 ... |
correct output |
---|
469 290 97 438 372 322 367 317... |
user output |
---|
18 200 400 49 117 168 122 173 ... |
Test 55
Verdict: WRONG ANSWER
input |
---|
500 111 59249204 934941692 892631472 2... |
correct output |
---|
5 104 100 24 42 109 55 9 70 46... |
user output |
---|
111 32 54 111 111 10 111 111 1... |
Test 56
Verdict: WRONG ANSWER
input |
---|
500 447 356460601 224848374 881788059 ... |
correct output |
---|
154 88 394 30 18 168 46 279 43... |
user output |
---|
330 403 61 447 447 315 447 191... |
Test 57
Verdict: WRONG ANSWER
input |
---|
500 39 244103474 837431431 342493822 ... |
correct output |
---|
9 33 13 18 31 19 13 23 11 21 3... |
user output |
---|
39 39 39 39 39 39 39 39 39 39 ... |
Test 58
Verdict: WRONG ANSWER
input |
---|
500 437 11934038 257096283 933290530 4... |
correct output |
---|
7 101 407 167 251 388 97 191 7... |
user output |
---|
437 384 34 313 209 55 389 284 ... |
Test 59
Verdict: WRONG ANSWER
input |
---|
500 6 391337048 538883744 535937150 ... |
correct output |
---|
3 4 4 4 1 2 3 2 1 2 6 3 2 2 2 ... |
user output |
---|
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 ... |