結果
問題 | No.604 誕生日のお小遣い |
ユーザー |
|
提出日時 | 2018-05-21 22:55:04 |
言語 | C++11 (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 428 bytes |
コンパイル時間 | 415 ms |
コンパイル使用メモリ | 54,112 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-28 15:38:23 |
合計ジャッジ時間 | 3,063 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 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){ if (Sum+A-1<C){ Sum+=A-1; Year+=A; }else{ Year+=C-Sum; } break; } Year+=A; Sum+=A-1+B; } cout<<Year<<endl; return 0; }