QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#344903#3809. Wooden SignsPetroTarnavskyi#WA 1ms3708kbC++202.1kb2024-03-05 18:23:172024-03-05 18:23:18

Judging History

This is the latest submission verdict.

  • [2024-03-05 18:23:18]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3708kb
  • [2024-03-05 18:23:17]
  • Submitted

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: ''