| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 648259 | kingfran1907 | Popcount (COCI19_popcount) | C++14 | 5 ms | 340 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long llint;
const int maxn = 510;
const int base = 31337;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;
int n, k;
vector< string > sol;
string pot[maxn];
string add(string a, string b) {
	while (a.size() < b.size()) a.push_back('0');
	while (b.size() < a.size()) b.push_back('0');
	int car = 0;
	string out;
	for (int i = 0; i < a.size(); i++) {
		int tren = (int)a[i] + b[i] - 2 * '0' + car;
		out.push_back((tren % 10) + '0');
		car = tren / 10;
	}
	if (car > 0) out.push_back(car + '0');
	while (out.back() == '0') out.pop_back();
	return out;
}
string conv(int x) {
	if (x == 0) return "0";
	string out;
	while (x > 0) {
		out.push_back((x % 10) + '0');
		x /= 10;
	}
	reverse(out.begin(), out.end());
	return out;
}
int main() {
	scanf("%d%d", &n, &k);
	pot[0] = "1";
	for (int i = 1; i < n; i++) 
		pot[i] = add(pot[i - 1], pot[i - 1]);
	for (int i = 1; i < n; i *= 2) {
		string num = "0";
		string comp = "0";
		for (int j = 0; j < n; j++) {
			if (j & i) num = add(num, pot[j]);
			else comp = add(comp, pot[j]);
		}
		reverse(num.begin(), num.end());
		reverse(comp.begin(), comp.end());
		string tren = "A=((A&" + comp + ")+((A&" + num + ")>>" + conv(i) + "))";
		sol.push_back(tren);
	}
	cout << sol.size() << "\n";
	for (string tren : sol) cout << tren << "\n";
	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... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
