QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#344903 | #3809. Wooden Signs | PetroTarnavskyi# | WA | 1ms | 3708kb | C++20 | 2.1kb | 2024-03-05 18:23:17 | 2024-03-05 18:23:18 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
struct SAT2
{
int n;
vector<VI> g, gr;
VI used;
void init(int _n)
{
n = _n;
g.resize(n);
gr.resize(n);
}
void addEdge(int from, int to)
{
}
bool solve()
{
}
};
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<tuple<string, int, int>> a(n);
FOR(i, 0, n)
{
string s;
int who, cnt;
cin >> s >> who >> cnt;
a[i] = {s, who - 1, cnt};
}
int ans = 0;
FOR(i0, 0, 26)
{
FOR(i1, 0, i0)
{
FOR(i2, 0, i1)
{
bool ok = true;
SAT2 S;
S.init(2 * 26);
FOR(i, 0, n)
{
int j0 = get<0>(a[i])[0] - 'A';
int j1 = get<0>(a[i])[1] - 'A';
int who = get<1>(a[i]);
int cnt = get<2>(a[i]);
int num = 0;
num += (j0 == i0) + (j0 == i1) + (j0 == i2);
num += (j1 == i0) + (j1 == i1) + (j1 == i2);
if(2 - num < cnt)
{
ok = false;
break;
}
if(num == 2)
{
continue;
}
if(num == 1)
{
int id = j0;
if((j0 == i0) + (j0 == i1) + (j0 == i2) > 0)
id = j1;
id = 2 * id + who;
S.addEdge(id ^ cnt, id ^ 1 ^ cnt);
continue;
}
if(cnt != 1)
{
cnt /= 2;
FOR(it, 0, 2)
{
int id = j0;
id = 2 * id + who;
S.addEdge(id ^ cnt, id ^ 1 ^ cnt);
swap(j0, j1);
}
continue;
}
int u = (2 * j0 + who);
int v = (2 * j1 + who);
S.addEdge(u ^ 1, v);
S.addEdge(v ^ 1, u);
}
if(!ok || !S.solve())
continue;
ans++;
}
}
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3708kb
input:
5 2 6 5 1 4 3
output:
result:
wrong answer 1st lines differ - expected: '6', found: ''