답안 #1113440

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1113440 2024-11-16T14:58:35 Z Nonoze Make them Meet (EGOI24_makethemmeet) C++17
21.409 / 100
9 ms 1532 KB
#include <bits/stdc++.h>
using namespace std;

#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define cmin(a, b) a=min(a, b)
#define cmax(a, b) a=max(a, b)
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define int long long

void solve();

signed main() {
	ios::sync_with_stdio(0); cin.tie(0);
	solve();
	return 0;
}

vector<vector<int>> vec;


void print() {
	cout << sz(vec) << endl;
	for (auto &a: vec) {
		for (auto &u: a) cout << u << ' ';
		cout << endl;
	}
	cout << endl;
}

void add(vector<int> &a) { vec.pb(a); }


int n, m;
vector<int> a;


void solve() {
	cin >> n >> m; a.clear(), a.resize(n, -1);
	for (int t=0; t<10; t++) {
		int cnt=0;
		for (int i=0; i+1<n; i+=2) {
			a[i]=a[i+1]=cnt++;
		}
		if (n%2) a[n-1]=cnt++;
		for (int i=0; i<n-1; i++) {
			add(a);
			int bk=a.back();
			a.pop_back();
			if (!count(all(a), bk)) a.insert(a.begin(), bk);
			else a.insert(a.begin(), cnt++);
		}
	}
	print();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 508 KB If people start at 0 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 2 ms 336 KB Output is correct
6 Correct 2 ms 336 KB Output is correct
7 Correct 2 ms 592 KB Output is correct
8 Correct 3 ms 592 KB Output is correct
9 Partially correct 8 ms 1532 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 3 ms 592 KB Output is correct
5 Partially correct 8 ms 1360 KB Partially correct
6 Partially correct 9 ms 1360 KB Partially correct
7 Partially correct 5 ms 848 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 508 KB If people start at 0 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 508 KB If people start at 0 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -