結果
問題 |
No.1446 ハンバーグと納豆ごはん
|
ユーザー |
![]() |
提出日時 | 2021-03-31 14:52:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 493 bytes |
コンパイル時間 | 766 ms |
コンパイル使用メモリ | 68,224 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 22:03:51 |
合計ジャッジ時間 | 1,911 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; } if(A<B){ if(B-A>=M){ for (size_t i = 0; i < (B-A)/(M+1); i++) { a++; } cout<<A+a; }else{ cout<<A; } } if(B<A){ if(A-B>=N){ for (size_t i = 0; i < (A-B)/(N+1); i++) { b++; } cout<<B+b; }else{ cout<<B; } } return 0; }