結果
問題 | No.894 二種類のバス |
ユーザー | sitihi |
提出日時 | 2019-09-27 22:39:10 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 662 bytes |
コンパイル時間 | 323 ms |
コンパイル使用メモリ | 28,672 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 23:38:26 |
合計ジャッジ時間 | 1,058 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 1 ms
6,944 KB |
testcase_03 | AC | 1 ms
6,940 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | WA | - |
testcase_08 | AC | 1 ms
6,940 KB |
testcase_09 | WA | - |
testcase_10 | AC | 1 ms
6,944 KB |
testcase_11 | AC | 1 ms
6,940 KB |
testcase_12 | AC | 1 ms
6,940 KB |
testcase_13 | AC | 1 ms
6,944 KB |
testcase_14 | AC | 1 ms
6,940 KB |
testcase_15 | AC | 1 ms
6,944 KB |
testcase_16 | RE | - |
testcase_17 | AC | 1 ms
6,940 KB |
testcase_18 | AC | 1 ms
6,944 KB |
testcase_19 | AC | 1 ms
6,940 KB |
コンパイルメッセージ
main.c: In function 'main': main.c:18:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 18 | scanf("%llu%llu%llu", &t, &a, &b); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | unsigned long long int gcd(int x, int y){ main.c:18:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 18 | scanf("%llu%llu%llu", &t, &a, &b); | ^~~~~ main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:39:5: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 39 | printf("%llu\n", c); | ^~~~~~ main.c:39:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:39:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:39:5: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
unsigned long long int gcd(int x, int y){ while(x != 0){ int z = x; x = y%x; y = z; } return y; } unsigned long long int lcm(int x, int y){ int p = gcd(x, y); int s = x*y/p; return s; } unsigned long long int main(){ unsigned long long int t, a, b, l, c, d, e, f; scanf("%llu%llu%llu", &t, &a, &b); l = lcm(a, b); if (t%a == 0){ d = t/a; } else { d = 1+t/a; } if (t%b == 0){ e = t/b; } else { e = 1+t/b; } if (t%l == 0){ f = t/l; } else { f = 1+t/l; } c = d+e-f; printf("%llu\n", c); return 0; }