답안 #284256

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
284256 2020-08-27T05:51:09 Z 임성재(#5754) Arcade (NOI20_arcade) C++17
0 / 100
0 ms 384 KB
#include<bits/stdc++.h>
using namespace std;

#define fast ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf = 1e9;
const ll INF = 1e18;

ll n, m;
vector<pll> v;
set<ll> s;
ll a[500010];
ll t[500010];

int main() {
	fast;

	cin >> n >> m;

	for(int i=1; i<=m; i++) {
		cin >> a[i];
	}

	for(int i=1; i<=m; i++) {
		cin >> t[i];

		v.eb(t[i] + a[i], t[i] - a[i]);
	}

	sort(all(v), [&](pll i, pll j){
		if(i.fi == j.fi) return i.se > j.se;
		return i.fi > j.fi;
	});

	for(auto i : v) {
		//if(s.lower_bound(i.se) != s.end()) s.erase(s.lower_bound(i.se));
		//s.insert(i.se);

		for(auto j : v) {
			if(i.fi < j.fi && i.se > j.se) {
				cout << 2;
				return 0;
			}
		}
	}

	//cout << s.size();

	cout << 1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -