Submission #20882


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<stdio.h>
int main(){
int n,m;
int cnt;
int temp;
int i,j;
int ans;
cnt=0;
ans=0;
scanf("%d %d",&n,&m);
int p[2][m];
for(i=0;i<m;i++){
scanf("%d %d",&p[0][i],&p[1][i]);
if(p[0][i]>=n){
cnt++;
p[0][i]=0;
}
}
m--;
for(i=0;i<m-cnt;i++){
for(j=0;j<m-i;j++){
if(p[0][j]>p[0][j+1]){
temp=p[0][j];
p[0][j]=p[0][j+1];
p[0][j+1]=temp;
}
}
ans+=n-p[0][m-i];
}
printf("%d\n",ans);
}

ステータス

項目 データ
問題 0593 - ポイントカード (Point Card)
ユーザー名 ei1710
投稿日時 2017-07-06 17:17:33
言語 C
状態 Accepted
得点 1
ソースコード長 500 Byte
最大実行時間 104 ms
最大メモリ使用量 564 KB

セット

セット 得点 Cases
1 set1 20 / 20 *t2*1.txt
2 set2 0 / 20 *t2*2.txt
3 set3 0 / 20 *t2*3.txt
4 set4 0 / 20 *t2*4.txt
5 set5 0 / 20 *t2*5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2017-yo-t2-in1.txt AC 104 ms 480 KB
1
2017-yo-t2-in2.txt AC 10 ms 404 KB
2
2017-yo-t2-in3.txt AC 44 ms 456 KB
3
2017-yo-t2-in4.txt AC 38 ms 512 KB
4
2017-yo-t2-in5.txt AC 23 ms 564 KB
5