結果
問題 |
No.604 誕生日のお小遣い
|
ユーザー |
|
提出日時 | 2018-05-21 22:30:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 366 bytes |
コンパイル時間 | 496 ms |
コンパイル使用メモリ | 54,256 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-28 15:37:08 |
合計ジャッジ時間 | 3,178 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 4 TLE * 1 -- * 8 |
ソースコード
#include <iostream> using namespace std; typedef long long LL; int main(int argc, char* argv[]) { LL A,B,C; cin>>A>>B>>C; if (A>C){ cout<<C<<endl; return 0; }else if (A==C){ cout<<A<<endl; return 0; } LL Year=A; LL Sum=A-1+B; while(Sum<C){ if (Sum+A-1+B>=C){ Year+=C-Sum; break; } Year+=A; Sum+=A-1+B; } cout<<Year<<endl; return 0; }