Submission #4278906


Source Code Expand

Copy
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/






int A, B;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A >> B;

    if (B % A == 0) cout << A + B << endl;
    else cout << B - A << endl;
}

Submission Info

Submission Time
Task A - B +/- A
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1486 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All Sample
Score / Max Score 100 / 100 0 / 0
Status
AC × 11
AC × 3
Set Name Test Cases
All 0_normal_1, 0_normal_2, 0_normal_3, 0_normal_4, 1_hand_1, 1_hand_2, 1_hand_3, 1_hand_4, sample_01, sample_02, sample_03
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_normal_1 AC 1 ms 256 KB
0_normal_2 AC 1 ms 256 KB
0_normal_3 AC 1 ms 256 KB
0_normal_4 AC 1 ms 256 KB
1_hand_1 AC 1 ms 256 KB
1_hand_2 AC 1 ms 256 KB
1_hand_3 AC 1 ms 256 KB
1_hand_4 AC 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB