結果
問題 | No.604 誕生日のお小遣い |
ユーザー |
![]() |
提出日時 | 2017-12-06 22:53:50 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 267 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 22,272 KB |
実行使用メモリ | 13,644 KB |
最終ジャッジ日時 | 2024-11-29 01:30:28 |
合計ジャッジ時間 | 16,935 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 14 OLE * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d %d %d\n", &x, &y, &z); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main() { int x,y,z; int sum = 0; int age = 1; scanf("%d %d %d\n", &x, &y, &z); while(sum < z){ sum += (age % x == 0) ? y : 1; printf("sum[%d] = %d\n", age, sum); if(sum < z){ age++; } } printf("%d\n", age); return (0); }