Submission #63879


ソースコード

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
#include<stdio.h>
int main()
{
int a,b,c[1000],d,e=0,f=0,g,i,j;
scanf("%d%d",&a,&b);
for(i=0;i<b;i++)
scanf("%d%d",&c[i],&d);
for(i=0;i<b;i++){
for(j=i+1;j<b;j++){
if(c[i]<c[j]){
g=c[i];
c[i]=c[j];
c[j]=g;
}}}
for(i=0;i<b;i++){
if(c[i]>=a)
e++;
else{
f+=a-c[i];
e++;
}
if(e==b-1)break;
}
printf("%d\n",f);
}

ステータス

項目 データ
問題 0593 - ポイントカード (Point Card)
ユーザー名 sth19_y-tamaru
投稿日時 2020-09-08 17:55:14
言語 C
状態 Accepted
得点 100
ソースコード長 378 Byte
最大実行時間 23 ms
最大メモリ使用量 456 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2017-yo-t2-in1.txt AC 23 ms 376 KB
1
2017-yo-t2-in2.txt AC 19 ms 436 KB
2
2017-yo-t2-in3.txt AC 21 ms 456 KB
3
2017-yo-t2-in4.txt AC 21 ms 412 KB
4
2017-yo-t2-in5.txt AC 23 ms 436 KB
5