QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#112173#5673. CornholePetroTarnavskyi#WA 2ms3332kbC++171.3kb2023-06-10 14:48:082023-06-10 14:48:11

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-10 14:48:11]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3332kb
  • [2023-06-10 14:48:08]
  • 提交

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";
}

Details

Tip: Click on the bar to expand more detailed information

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'