| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 129490 | E869120 | Binary Subsequences (info1cup17_binary) | C++14 | 733 ms | 1348 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
using namespace std;
bool used[1 << 20];
void init(int pos) {
	for (int i = 2; i <= pos; i++) {
		if (used[i] == true || pos%i != 0) continue;
		for (int j = i; j <= pos; j += i) used[j] = true;
	}
}
int main() {
	int T; cin >> T;
	for (int i = 1; i <= T; i++) {
		int A; cin >> A;
		
		for (int j = 1; j <= A + 2; j++) used[j] = false;
		init(A + 2);
		long long cnt = 0, ret = (1 << 30), mask = 0;
		for (int j = 1; j <= A + 2; j++) {
			if (used[j] == true) continue;
			cnt++;
			if (j > ((A + 2) >> 1) + 1) continue;
			int t1 = j, t2 = (A + 2) - j; long long mask1 = 0, lens = 0;
			while (t1 >= 1 && t2 >= 1) {
				if (t1 < t2) { t2 -= t1; }
				else { mask1 += (1LL << lens); t1 -= t2; }
				lens++; if (lens == 60) break;
			}
			if (ret > lens) {
				ret = lens; mask = mask1;
			}
		}
		cout << cnt << endl;
		for (int j = 0; j < ret - 1; j++) {
			if (j) cout << " "; cout << (mask / (1LL << j)) % 2;
		}
		cout << endl;
	}
	return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
