답안 #439766

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
439766 2021-06-30T19:07:01 Z negar_a Sob (COCI19_sob) C++14
110 / 110
571 ms 46812 KB
//!yrt tsuj uoy srettam gnihton no emoc
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define pii pair <int, int>
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define F first
#define S second

inline void solve(vector <pii> a, vector <pii> b){
	if((int)a.size() == 1){
		cout << a[0].S << " " << b[0].S << '\n';
		return;
	}
	vector <pii> a1, a2, b1, b2;
	for(auto u : a){
		if(u.F & 1){
			a2.pb({u.F / 2, u.S});
		}else{
			a1.pb({u.F / 2, u.S});
		}
	}
	if((int)a1.size() != (int)a2.size() && (b[0].F & 1)){
		b[0].F --;
	}
	for(auto u : b){
		if(u.F & 1){
			b2.pb({u.F / 2, u.S});
		}else{
			b1.pb({u.F / 2, u.S});
		}
	}
	solve(a1, b1);
	solve(a2, b2);
}

int main(){
	fast_io;
	int n, m;
	cin >> n >> m;
	vector <pii> a, b;
	for(int i = 0; i < n; i ++){
		a.pb({i, i});
		b.pb({m + i, m + i});
	}
	solve(a, b);
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 261 ms 24424 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 588 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 263 ms 24404 KB Output is correct
7 Correct 131 ms 11960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 261 ms 24424 KB Output is correct
5 Correct 3 ms 588 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 263 ms 24404 KB Output is correct
11 Correct 131 ms 11960 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 384 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 356 KB Output is correct
19 Correct 60 ms 5376 KB Output is correct
20 Correct 204 ms 19356 KB Output is correct
21 Correct 7 ms 972 KB Output is correct
22 Correct 4 ms 588 KB Output is correct
23 Correct 309 ms 29232 KB Output is correct
24 Correct 516 ms 46812 KB Output is correct
25 Correct 571 ms 46452 KB Output is correct