-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcakes.cpp
More file actions
61 lines (60 loc) · 803 Bytes
/
cakes.cpp
File metadata and controls
61 lines (60 loc) · 803 Bytes
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
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,q,a,one=0,from,to;
char tar[4][5];
cin>>n>>q;
int arr[n];
for(int k=0;k<n;k++)
{
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
cin>>tar[i][j];
if(tar[i][j]=='1')
one++;
}
}
arr[k] = one;
one=0;
getchar();
}
while(q--)
{
int fans=0;
cin>>a;
if(a==1)
{
cin>>from>>to;
for(int i=from-1;i<to;i++)
fans=arr[i]^fans;
if(fans>0)
cout<<"Pishty"<<endl;
else
cout<<"Lotsy"<<endl;
}
else
{
cin>>from;
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
cin>>tar[i][j];
if(tar[i][j]=='1')
one++;
}
}
arr[from-1]=one;
one=0;
}
}
}
return 0;
}