結果
問題 |
No.1446 ハンバーグと納豆ごはん
|
ユーザー |
![]() |
提出日時 | 2021-03-31 14:51:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 816 ms |
コンパイル使用メモリ | 68,520 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 21:56:43 |
合計ジャッジ時間 | 1,907 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 23 WA * 10 |
ソースコード
#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { int A,B,N,M,a=0,b=0; cin>>A>>B>>N>>M; if(A==B){ cout<<A<<"\n"; } if(A<B){ if(B-A>=M){ for (size_t i = 0; i < (B-A)/(M+1); i++) { a++; } cout<<A+a<<"\n"; }else{ cout<<A<<"\n"; } } if(B<A){ if(A-B>=N){ for (size_t i = 0; i < (A-B)/(N+1); i++) { b++; } cout<<B+b<<"\n"; }else{ cout<<B<<"\n"; } } return 0; }