結果
問題 |
No.1446 ハンバーグと納豆ごはん
|
ユーザー |
![]() |
提出日時 | 2021-03-31 14:40:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 503 bytes |
コンパイル時間 | 542 ms |
コンパイル使用メモリ | 68,596 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 19:20:39 |
合計ジャッジ時間 | 3,059 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 RE * 1 |
other | AC * 23 RE * 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; 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; i++) { b++; } cout<<B+b<<"\n"; }else{ cout<<B<<"\n"; } } }