UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#206945#3726. 卡牌游戏sesame1002ms1252kbC++11328b2024-07-26 17:46:362024-07-26 21:46:03

answer

#include<bits/stdc++.h>
using namespace std;
int n,m,b,a[110];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>b;
		for(int j=b;j<=n;j++){
			if(!a[j])	a[j]=b;
//			cout<<a[j];
		}
//		cout<<endl;
	}
	for(int i=1;i<=n;i++){
		cout<<a[i]<<' ';
	}
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1248kb

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: 1ms
memory: 1252kb

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: 1248kb

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: 1248kb

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: 1248kb

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: 1ms
memory: 1252kb

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