Submission #424283

# Submission time Handle Problem Language Result Execution time Memory
424283 2021-06-11T19:03:35 Z flappybird Vision Program (IOI19_vision) C++14
0 / 100
14 ms 1768 KB
#include "vision.h"

#include <bits/stdc++.h>
#include <unordered_map>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")

using namespace std;
typedef int ll;

ll H, W;

unordered_map<ll, vector<ll>> sum, sub;
unordered_map<ll, ll> sum_, sub_;

ll getloc(ll x, ll y) {
	return y * W + x;
}

void construct_network(int H_, int W_, int K) {
	H = H_;
	W = W_;
	ll i, j;
	ll s = 100000000, e = 0;
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			sum[i + j].push_back(getloc(i, j));
			sub[i - j].push_back(getloc(i, j));
			e = max(e, i - j);
			s = min(s, i - j);
		}
	}
	unordered_map<ll, vector<ll>>::iterator it;
	for (it = sum.begin(); it != sum.end(); it++) sum_[it->first] = add_or(it->second);
	for (it = sub.begin(); it != sub.end(); it++) sub_[it->first] = add_or(it->second);
	vector<ll> res;
	for (i = 0; i + K <= W + H - 2; i++) {
		vector<ll> v;
		v.push_back(sum_[i]);
		v.push_back(sum_[i + K]);
		res.push_back(add_and(v));
	}
	for (i = s; i + K <= e; i++) {
		vector<ll> v;
		v.push_back(sub_[i]);
		v.push_back(sub_[i + K]);
		res.push_back(add_and(v));
	}
	add_or(res);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 288 KB Output is correct
3 Correct 3 ms 332 KB Output is correct
4 Incorrect 2 ms 384 KB on inputs (0, 0), (31, 0), expected 1, but computed 0
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 1768 KB on inputs (126, 120), (176, 169), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -