QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#32411 | #3820. Antisocial network | marqueslua | TL | 0ms | 0kb | C++ | 1.5kb | 2022-05-19 21:58:40 | 2022-05-19 21:58:41 |
Judging History
answer
#include <bits/stdc++.h>
#define pb push_back
#define mk make_pair
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define debug(a) cerr << #a << " = " << a << endl;
#define debug2(a, b) cerr << #a << " = " << a << " --- " << #b << " = " << b << endl;
#define debug3(a, b, c) cerr << #a << " = " << a << " --- " << #b << " = " << b << " --- " << #c << " = " << c << endl;
#define PI 3.1415926535897932384626433832795028841971
#define INF 0x3f3f3f3f
#define MAXV 1000006
#define MOD 1000000007
#define F first
#define S second
#define ms(a, b) memset(a, b, sizeof(a))
#define all(S) (S).begin(),(S).end()
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
ll value[MAXV], sum[MAXV];
int aux[MAXV];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
srand(time(NULL));
int n, m, k;
cin >> n >> m >> k;
rep(i, 1, n+1)
{
rep(j, 0, 1)
{
int x = rand()&1;
if(x)
value[i] |= (1LL<<j);
}
}
int a, b;
while(m--)
{
cin >> a >> b;
sum[a] ^= value[b];
sum[b] ^= value[a];
}
// rep(i, 1, n+1)
// debug3(i, value[i], sum[i])
int s;
while(k--)
{
ll sumtot = 0;
cin >> s;
rep(i, 0, s)
{
cin >> aux[i];
sumtot ^= value[aux[i]];
}
//debug(sumtot)
rep(i, 0, s)
sum[aux[i]] ^= (sumtot ^ value[aux[i]]);
}
rep(i, 1, n+1)
{
cout << (sum[i] ? "NIE" : "TAK") << endl;
//debug(sum[i])
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
input:
250000 200000 1746 212935 222993 209401 26644 194475 81010 35228 215397 18862 157757 2921 119716 75263 105477 120130 237099 135220 74270 74081 203661 199185 31171 17047 141501 209614 142989 118306 112566 189676 35913 199306 161761 173066 47468 44575 23683 98741 104427 65879 102354 3294 113844 91188 ...
output:
NIE NIE TAK NIE TAK NIE TAK TAK NIE NIE TAK TAK TAK NIE NIE TAK NIE TAK TAK NIE TAK TAK TAK NIE NIE TAK TAK TAK TAK NIE TAK NIE NIE NIE TAK TAK NIE NIE TAK NIE NIE TAK TAK NIE NIE TAK NIE TAK TAK TAK TAK NIE NIE NIE TAK TAK TAK TAK TAK TAK NIE TAK TAK NIE NIE TAK TAK TAK TAK TAK TAK NIE TAK TAK TAK ...