forked from kothariji/competitive-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path(CODEFORCES)_dima_&_bad_xor.cpp
109 lines (100 loc) · 2.34 KB
/
(CODEFORCES)_dima_&_bad_xor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#include<bits/stdc++.h>
using namespace std;
typedef string STR;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> VI;
typedef priority_queue<int> PQI;
typedef vector<LL> VLL;
typedef vector<ULL> VULL;
typedef vector<STR> VSTR;
typedef vector<char> VC;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<STR,int> PSI;
typedef pair<int,STR> PIS;
typedef map<int,int> MII;
typedef map<LL,LL> MLL;
typedef map<STR,int> MSI;
typedef map<char,int> MCI;
typedef map<int,STR> MIS;
typedef set<STR> SS;
typedef set<int> SI;
typedef set<LL> SLL;
#define FF first
#define PB push_back
#define PF push_front
#define MP make_pair
#define all(a) (a).begin(),(a).end()
#define dec(n) cout<<fixed<<setprecision(n);
#define f(i,a,b) for (i = a; i < b; i++)
#define fr(i,a,b) for (i = a; i > b; i--)
#define rep(i,n) for (i = 0 ; i < n; i++)
#define repr(i,n) for (i = n - 1; i >= 0; i--)
#define fsort(a) sort(a.begin(),a.end())
#define rsort(a) sort(a.rbegin(),a.rend())
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL))
const LL MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const LL LL_INF = 0x3f3f3f3f3f3f3f3f;
const LD PI = acosl(-1.0l);
const LL MAXN = numeric_limits<LL>::max();
const LL MINN = (1e9+1);
void solve()
{
int n,m,i,j;
cin>>n>>m;
int A[n][m];
int x=0;
rep(i,n)
{
rep(j,m)
{
cin>>A[i][j];
}
x ^=A[i][0];
}
if(x!=0)
{ cout<<"TAK\n";
rep(i,n) cout<<"1 ";
}
else{
int flag=0;
rep(i,n)
{
f(j,1,m)
{
if(A[i][j]!=A[i][0])
{flag=1;break;}
}
if(flag==1)
break;
}
if(flag==1)
{
cout<<"TAK\n";
int k=0;
rep(k,n)
{
if(k==i)
cout<<j+1<<" ";
else
cout<<1<<" ";
}
}
else
cout<<"NIE\n";
}
}
int main()
{
fast;
int t=1;
while(t)
{
t--;
solve();
}
return 0;
}