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