結果
問題 | No.894 二種類のバス |
ユーザー | sitihi |
提出日時 | 2019-09-27 22:33:47 |
言語 | C (gcc 12.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 1,116 ms |
コンパイル使用メモリ | 27,520 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-24 23:14:43 |
合計ジャッジ時間 | 4,382 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
コンパイルメッセージ
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; }