結果
問題 |
No.604 誕生日のお小遣い
|
ユーザー |
|
提出日時 | 2017-12-16 01:53:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 344 bytes |
コンパイル時間 | 548 ms |
コンパイル使用メモリ | 54,080 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 16:48:38 |
合計ジャッジ時間 | 1,374 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 RE * 2 |
other | RE * 21 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:13: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=] 7 | scanf("%d%d%d",&A,&B,&C); | ~^ ~~ | | | | int* long long int* | %lld main.cpp:7:15: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long long int*’ [-Wformat=] 7 | scanf("%d%d%d",&A,&B,&C); | ~^ ~~ | | | | int* long long int* | %lld main.cpp:7:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 4 has type ‘long long int*’ [-Wformat=] 7 | scanf("%d%d%d",&A,&B,&C); | ~^ ~~ | | | | int* long long int* | %lld main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d%d%d",&A,&B,&C); | ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream> using namespace std; int main(void){ auto start = clock(); long long A,B,C; scanf("%d%d%d",&A,&B,&C); long long block,remain; block = (A - 1) + B; remain = C % block; if(remain == 0) { return (C / block) * A; } else { return (C / block) * A + remain; } }