본문 바로가기

UCPC

[20/05/17] I. MaratonIME divides fairly

#include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <bitset>
#include <map>
#include <set>
#include <tuple>
#include <string.h>
#include <math.h>
#include <random>
#include <functional>
#include <assert.h>
#include <math.h>
#define all(x) (x).begin(), (x).end()
#define xx first
#define yy second

using namespace std;

template<typename T, typename Pr = less<T>>
using pq = priority_queue<T, vector<T>, Pr>;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;

int main()
{
	int t;
	scanf("%d", &t);
	
	for (int i = 0; i < t; i++)
	{
	    int a, b;
	    scanf("%d %d", &a, &b);

	    if (abs(a-b) <= 1)
	    {
	        printf("Ok\n");
	        continue;
	    }
	    
	    printf("%d %d\n", (a+b)/2, (a+b+1)/2);
	}

	return 0;
}

지금 보니 잘못하면 터졌겠다 싶음

 

최댓값이 10억이라 더해서 20억 돼서 안 터진듯?

'UCPC' 카테고리의 다른 글

[20/05/17] K. MaratonIME bot  (0) 2020.05.23
[20/05/17] J. MaratonIME goes to Mito  (0) 2020.05.23
[20/05/17] H. MaratonIME gets candies  (0) 2020.05.23
[20/05/17] G. MaratonIME does a competition  (0) 2020.05.22
[20/05/17] F. MaratonIME educates  (0) 2020.05.22