結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー eviebileviebil
提出日時 2021-03-31 14:49:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 511 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 69,908 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-08 16:34:03
合計ジャッジ時間 2,976 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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";
    }
  }
}
0