結果
問題 | No.176 2種類の切手 |
ユーザー | %20 |
提出日時 | 2017-07-13 03:56:02 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 287 bytes |
コンパイル時間 | 314 ms |
コンパイル使用メモリ | 29,184 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-07 17:01:18 |
合計ジャッジ時間 | 1,365 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 1 ms
5,248 KB |
testcase_09 | AC | 1 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 1 ms
5,248 KB |
testcase_12 | AC | 1 ms
5,248 KB |
testcase_13 | AC | 1 ms
5,248 KB |
testcase_14 | AC | 1 ms
5,248 KB |
testcase_15 | AC | 1 ms
5,248 KB |
testcase_16 | AC | 1 ms
5,248 KB |
testcase_17 | AC | 1 ms
5,248 KB |
testcase_18 | AC | 1 ms
5,248 KB |
testcase_19 | AC | 1 ms
5,248 KB |
testcase_20 | AC | 1 ms
5,248 KB |
testcase_21 | AC | 1 ms
5,248 KB |
testcase_22 | AC | 1 ms
5,248 KB |
testcase_23 | AC | 1 ms
5,248 KB |
testcase_24 | AC | 1 ms
5,248 KB |
testcase_25 | AC | 1 ms
5,248 KB |
testcase_26 | AC | 1 ms
5,248 KB |
testcase_27 | AC | 1 ms
5,248 KB |
testcase_28 | AC | 1 ms
5,248 KB |
testcase_29 | AC | 1 ms
5,248 KB |
testcase_30 | AC | 1 ms
5,248 KB |
testcase_31 | AC | 1 ms
5,248 KB |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | min(a,b){return a<b?a:b;} | ^~~ main.c: In function 'min': main.c:1:1: warning: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'b' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:2:1: warning: data definition has no type or storage class 2 | A,B,T; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'A' [-Wimplicit-int] main.c:2:3: warning: type defaults to 'int' in declaration of 'B' [-Wimplicit-int] 2 | A,B,T; | ^ main.c:2:5: warning: type defaults to 'int' in declaration of 'T' [-Wimplicit-int] 2 | A,B,T; | ^ main.c:3:1: warning: data definition has no type or storage class 3 | i,m; | ^ main.c:3:1: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:3:3: warning: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 3 | i,m; | ^ main.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int] 4 | main(){ | ^~~~ main.c: In function 'main': main.c:5:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d%d%d",&A,&B,&T); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | min(a,b){return a<b?a:b;} main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d%d%d",&A,&B,&T); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:11:17: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 11 | printf("%d",T+m); | ^~~~~~ main.c:11:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:11:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-dec
ソースコード
min(a,b){return a<b?a:b;} A,B,T; i,m; main(){ scanf("%d%d%d",&A,&B,&T); if(A<30000){ m=A; for(i=0;i<A&&B*i<=T;++i){ m=min(m,(A-(T-B*i)%A)%A); } printf("%d",T+m); }else{ m=((T-1)/A+1)*A; for(i=0;A*i<=T;++i){ m=min(m,A*i+((T-A*i-1)/B+1)*B); } printf("%d",m); } }