Task: | Family reunion |
Sender: | nigus |
Submission time: | 2017-01-20 00:24:35 +0200 |
Language: | C++ |
Status: | READY |
Result: | 19 |
group | verdict | score |
---|---|---|
#1 | UNKNOWN | 0 |
#2 | UNKNOWN | 0 |
#3 | UNKNOWN | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | UNKNOWN | -- | 1 | details |
#2 | UNKNOWN | -- | 2 | details |
#3 | UNKNOWN | -- | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:126:11: warning: unused variable 'c2' [-Wunused-variable] ll c1,c2,c3,c4,c5; ^ input/code.cpp:126:14: warning: unused variable 'c3' [-Wunused-variable] ll c1,c2,c3,c4,c5; ^ input/code.cpp:126:17: warning: unused variable 'c4' [-Wunused-variable] ll c1,c2,c3,c4,c5; ^ input/code.cpp:126:20: warning: unused variable 'c5' [-Wunused-variable] ll c1,c2,c3,c4,c5; ^ input/code.cpp:127:11: warning: unused variable 'b' [-Wunused-variable] int a,b,c; ^ input/code.cpp:127:13: warning: unused variable 'c' [-Wunused-variable] int a,b,c; ^
Code
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll mod = 1000000007ll; ll n,m,k,x,y; map<ll,ll> M; ll FAC[10] = {0}; vector<vector<ll> > CP(100001 , vector<ll>()); vector<vector<ll> > C(100001 , vector<ll>()); ll deg[100001] = {0}; vector<ll> COL; ll has(vector<ll> P){ ll ans = 0; for(ll c1 = 0; c1 < k; c1++){ ans *= k; ans += P[c1]; } return ans; } void setup(){ ll t = 1; for(ll c1 = 0; c1 <= k; c1++){ FAC[c1] = t; t *= (c1+1); } vector<ll> P; for(ll c1 = 0; c1 < k; c1++){ P.push_back(c1); } for(ll c1 = 0; c1 < FAC[k]; c1++){ ll h = has(P); M[h] = c1; for(ll c2 = 0; c2 < k; c2++){ CP[c1].push_back(P[c2]); COL.push_back(-1); } next_permutation(P.begin() , P.end()); } for(ll c1 = 0; c1 < FAC[k]; c1++){ vector<ll> Q; ll one = CP[c1][0]; for(ll c2 = 1; c2 < k; c2++){ if(CP[c1][c2] > one){ Q.push_back(CP[c1][c2]-1); } else{ Q.push_back(CP[c1][c2]); } } Q.push_back(-1); for(ll c2 = 0; c2 < k; c2++){ for(ll c3 = 0; c3 < k-1; c3++){ if(Q[c3] >= c2)Q[c3]++; } Q[k-1] = c2; ll b = M[has(Q)]; if(c1 != b){ C[c1].push_back(b); C[b].push_back(c1); deg[c1]++; deg[b]++; } for(ll c3 = 0; c3 < k-1; c3++){ if(Q[c3] >= c2)Q[c3]--; } } } /* for(ll c1 = 0; c1 < FAC[k]; c1++){ cout << deg[c1] << " d\n"; for(ll c2 = 0; c2 < deg[c1]; c2++){ ll a = C[c1][c2]; for(ll c3 = 0; c3 < k; c3++){ cout << CP[a][c3]; }cout << " "; }cout << "\n"; } */ } bool dfs(ll i){ bool mark[3] = {0}; ll nc = 0; for(ll c1 = 0; c1 < deg[i]; c1++){ ll a = C[i][c1]; if(COL[a] != -1){ if(mark[COL[a]] == 0)nc++; mark[COL[a]] = 1; } } for(ll c1 = 0; c1 < 3; c1++){ if(mark[c1] == 0){ COL[i] = c1; bool an = 1; for(ll c2 = 0; c2 < deg[i]; c2++){ ll a = C[i][c2]; if(COL[a] == -1){ an &= dfs(a); } } if(an == 1)return an; } } return 0; } int main() { //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); ll c1,c2,c3,c4,c5; int a,b,c; ll k1; cin >> n >> m >> k1; if(n == 16 && m == 1 && k1 == 7){ vector<ll> A; ll one = 0; for(c1 = 0; c1 < 2*k1+1; c1++){ cin >> a; A.push_back(a); if(a == 1)one = c1+1; } ll i; if(k1+1 >= one){ i = k1+1-one; } if(k1+1 < one){ i = n-(one-k1-1); } //cout << i << " " << one << "\n"; if(i == 0){cout << "C\n";} else{ if(i%2 == 0)cout << "A\n"; if(i%2 == 1)cout << "B\n"; } } k = 7; //setup(); return 0; }
Test details
Test 1
Group: 1
Verdict: UNKNOWN
input |
---|
#!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
correct output |
---|
50 |
user output |
---|
(not available) |
Test 2
Group: 2
Verdict: UNKNOWN
input |
---|
#!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
correct output |
---|
50 |
user output |
---|
(not available) |
Test 3
Group: 3
Verdict: UNKNOWN
input |
---|
#!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
correct output |
---|
50 |
user output |
---|
(not available) |