結果

問題 No.734 Careful Engineer
ユーザー greentea011greentea011
提出日時 2018-10-04 10:24:42
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 300 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 30,464 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 15:31:49
合計ジャッジ時間 762 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 WA -
testcase_02 AC 1 ms
6,940 KB
testcase_03 WA -
testcase_04 AC 0 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 0 ms
6,944 KB
testcase_08 AC 0 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 0 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 2 has type ‘double*’ [-Wformat=]
    6 |     scanf("%ld %ld %ld", &a, &b, &c);
      |            ~~^           ~~
      |              |           |
      |              long int*   double*
      |            %le
main.cpp:6:18: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 3 has type ‘double*’ [-Wformat=]
    6 |     scanf("%ld %ld %ld", &a, &b, &c);
      |                ~~^           ~~
      |                  |           |
      |                  long int*   double*
      |                %le
main.cpp:6:22: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 4 has type ‘double*’ [-Wformat=]
    6 |     scanf("%ld %ld %ld", &a, &b, &c);
      |                    ~~^           ~~
      |                      |           |
      |                      long int*   double*
      |                    %le
main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%ld %ld %ld", &a, &b, &c);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main() {
    double a,b,c;
    scanf("%ld %ld %ld", &a, &b, &c);

    a*=60;
    c*=3600;

    double x = c / (a-b);
    int ans;
    if (x < 0) {
        ans = -1;
    }
    else {
        ans = (int) ceil(x);
    }
    printf("%d\n", ans);
    return 0;
}
0