結果
問題 |
No.604 誕生日のお小遣い
|
ユーザー |
|
提出日時 | 2018-05-21 22:42:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 447 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 54,008 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-28 15:37:46 |
合計ジャッジ時間 | 3,032 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 TLE * 1 -- * 11 |
ソースコード
#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){ while (Sum<C){ Year++; if (Year%A==0){ Sum+=B; }else{ Sum++; } } break; } Year+=A; Sum+=A-1+B; } cout<<Year<<endl; return 0; }