ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#206940 | #3726. 卡牌游戏 | Soulmate | 100 | 0ms | 1252kb | C++11 | 582b | 2024-07-26 17:40:24 | 2024-07-26 21:45:50 |
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int n,m;
cin>>n>>m;
vector<int> b(m);
vector<int> res(n,0);
for (int i=0;i<m;i++)
{
cin>>b[i];
}
for (int i=0;i<m;i++)
{
for (int j=b[i]-1;j<n;j++)
{
if (res[j]==0)
{
res[j]=b[i];
}
}
}
for (int i=0;i<n;i++) {
cout<<res[i]<<" ";
}
cout<<endl;
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
75 52 40 30 70 21 29 44 53 5 66 52 10 60 38 26 24 71 19 57 39 45 58 15 36 43 62 54 72 32 33 9 65 67 ...
output:
1 1 1 1 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 21 21 21 21 21 21 21 21 21 30 30 30 30 30 30 30 30 30 30 40 ...
result:
ok 75 numbers
Test #2:
score: 10
Accepted
time: 0ms
memory: 1248kb
input:
69 52 44 63 69 35 26 8 59 49 47 11 66 45 12 29 22 10 2 28 34 33 6 43 61 48 1 9 52 64 31 57 20 7 42 4...
output:
1 2 2 2 2 2 2 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 26 26 26 26 26 26 26 26 26 35 35 35 35 35 35 35 35...
result:
ok 69 numbers
Test #3:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
58 43 21 15 28 7 49 22 45 47 24 56 58 17 14 3 37 4 30 1 43 18 25 11 38 13 41 27 20 36 54 26 32 6 35 ...
output:
1 1 3 3 3 3 7 7 7 7 7 7 7 7 15 15 15 15 15 15 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 ...
result:
ok 58 numbers
Test #4:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
93 49 34 69 16 49 75 53 67 37 1 58 12 38 36 2 59 91 10 88 26 48 54 79 89 22 76 32 44 29 83 86 28 77 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 34 34 34 34 34 3...
result:
ok 93 numbers
Test #5:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
40 40 29 1 36 13 39 27 34 9 20 15 11 19 14 6 22 28 7 17 8 5 18 26 32 25 2 10 12 38 33 3 31 30 40 16 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 29 29 29 29 29 29 29 29 29 29 29 29
result:
ok 40 numbers
Test #6:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
53 45 9 43 17 1 20 4 5 24 36 47 38 52 39 32 44 3 14 10 49 22 25 29 6 31 51 16 40 48 23 13 42 37 11 1...
output:
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...
result:
ok 53 numbers
Test #7:
score: 10
Accepted
time: 0ms
memory: 1248kb
input:
60 60 58 3 24 26 33 51 36 17 14 40 21 28 39 30 37 54 27 47 8 56 15 45 13 20 6 49 57 2 23 34 52 44 38...
output:
1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ...
result:
ok 60 numbers
Test #8:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
76 46 55 63 68 36 37 5 60 51 23 27 53 25 12 20 10 21 48 32 65 67 66 42 4 26 33 71 38 15 43 75 62 31 ...
output:
1 2 2 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 36 36 36 36 36 36 36 36 36 36 ...
result:
ok 76 numbers
Test #9:
score: 10
Accepted
time: 0ms
memory: 1248kb
input:
40 40 17 8 31 15 3 22 33 23 24 6 5 32 12 38 34 19 35 26 21 36 14 11 2 4 29 37 27 7 9 25 13 28 1 40 3...
output:
1 2 3 3 3 3 3 8 8 8 8 8 8 8 8 8 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17...
result:
ok 40 numbers
Test #10:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
80 44 24 78 3 37 49 2 52 6 64 7 77 73 8 17 45 27 72 15 38 44 9 28 14 10 48 23 42 62 36 63 18 58 20 4...
output:
1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 ...
result:
ok 80 numbers