Submission #17237430


Source Code Expand

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <cassert>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include "atcoder/all"
using namespace atcoder;
using namespace std;
typedef long long ll;
#define pb push_back
#define rep(i, n) for(int i=0;i<(n);i++)
#define P pair<int,int>
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

namespace ori{
    template <typename T>
    void erase(std::vector<T> &v)
    {
        std::sort(v.begin(),v.end());
        v.erase(std::unique(v.begin(),v.end()),v.end());
        return;
    }

    template<typename T>
    int find_index(std::vector<T> v, T find, string key)
    {
        std::sort(v.begin(),v.end());
        if(key=="left")
        {
            return (std::distance(v.begin(),lower_bound(v.begin(),v.end(),find)));
        }
        if(key=="right")
        {
            return (std::distance(v.begin(),upper_bound(v.begin(),v.end(),find))-1);
        }
        else
        {
            return -1;
        }
    }
}

vector<string> split(const string &s, char delim) {
    vector<string> elems;
    stringstream ss(s);
    string item;
    while (getline(ss, item, delim)) {
        if (!item.empty()) {
            elems.push_back(item);
        }
    }
    return elems;
}


const int x8[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int y8[] = {-1, 1, 0, 0, -1, -1, 1, 1};
const int x4[] = {1, -1, 0, 0};
const int y4[] = {0, 0, -1, 1};
const int MOD = 1'000'000'007;

bool ok(char a, char b){
    if((a == 'A' && b == 'T') ||(a == 'T' && b == 'A') || (a == 'G' && b == 'C') ||(a == 'C' && b == 'G'))
    {
        return true;
    }
    else
        return false;
}

void task()
{
    int a,b;
    cin >> a >> b;
    cout << (a+b)/2 << " " << a - (a+b)/2 << endl;
}




int main()
{
    ios::sync_with_stdio(false); cin.tie(nullptr);
    task();
    return 0;
}

Submission Info

Submission Time
Task A - Plus Minus
User udonman
Language C++ (GCC 9.2.1)
Score 100
Code Size 2283 Byte
Status AC
Exec Time 9 ms
Memory 3608 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 12
Set Name Test Cases
Sample s1.txt, s2.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
01.txt AC 3 ms 3560 KiB
02.txt AC 3 ms 3536 KiB
03.txt AC 2 ms 3536 KiB
04.txt AC 2 ms 3608 KiB
05.txt AC 2 ms 3568 KiB
06.txt AC 3 ms 3492 KiB
07.txt AC 4 ms 3572 KiB
08.txt AC 2 ms 3488 KiB
09.txt AC 9 ms 3508 KiB
10.txt AC 2 ms 3524 KiB
s1.txt AC 2 ms 3608 KiB
s2.txt AC 2 ms 3564 KiB