QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#112173 | #5673. Cornhole | PetroTarnavskyi# | WA | 2ms | 3332kb | C++17 | 1.3kb | 2023-06-10 14:48:08 | 2023-06-10 14:48:11 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define FILL(a, b) memset(a, b, sizeof(a))
const int N = 22;
string s[N][2];
bool isSet(int i1, int j1, int i2, int j2, int i3, int j3) {
FOR(k, 0, 4) {
char c1 = s[i1][j1][k], c2 = s[i2][j2][k], c3 = s[i3][j3][k];
int cntEq = (c1 == c2) + (c2 == c3) + (c3 == c1);
if (cntEq != 0 && cntEq != 3) {
assert(cntEq == 1);
return false;
}
}
return true;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
FOR(i, 0, n) {
FOR(j, 0, 2) {
cin >> s[i][j];
}
}
int ans = 0;
FOR(i, 0, n) {
FOR(j, i + 1, n) {
FOR(k, j + 1, n) {
bool ok = false;
FOR(ii, 0, 2) FOR (jj, 0, 2) FOR(kk, 0, 2) {
ok |= isSet(i, ii, j, jj, k, kk) && isSet(i, ii ^ 1, j, jj ^ 1, k, kk ^ 1);
}
if (ok) {
ans++;
}
}
}
}
cout << ans << "\n";
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3332kb
input:
2 1 0 4
output:
0
result:
wrong answer 1st lines differ - expected: '1 3', found: '0'