結果
| 問題 | No.734 Careful Engineer | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-09-28 23:11:43 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 331 bytes | 
| コンパイル時間 | 511 ms | 
| コンパイル使用メモリ | 25,216 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2025-01-18 00:04:55 | 
| 合計ジャッジ時間 | 1,233 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 10 WA * 1 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c: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);
      |            ~~^         ~~
      |              |         |
      |              |         double *
      |              long int *
      |            %le
main.c:6:17: 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.c:6:20: 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.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%ld%ld%ld", &A, &B, &C);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(void)
{
    double A, B, C;
    scanf("%ld%ld%ld", &A, &B, &C);
    A *= 60;
    C *= 3600;
    if (B > A) puts("-1");
    else {
        if ((long)(C / (A - B)) == C / (A - B)) printf("%ld", (long)(C / (A - B)));
        else printf("%ld", (long)(C / (A - B) + 1));
    }
    return 0;
}
            
            
            
        