Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Rubix
/*Coded by:: **Avinash Tiwary** **BE/10298/2015** **Production Engineer** **Producing <code>** */ #include<bits/stdc++.h> #define buf ios_base::sync_with_stdio (0), cin.tie (0) typedef int ll; typedef double dob; #define M5 500009 #define M6 2000009 #define M 1000000007 #define inf LLONG_MAX using namespace std; typedef vector<ll> V; typedef queue<ll > Q; typedef stack<ll> S; typedef pair<ll,ll> P; #define F first #define S second #define mp make_pair #define mt make_tuple #define pb push_back ll n,q,ar[M5],br[M5]; ll check(ll x,ll y,ll z,ll t){ if(ar[x]==ar[y]&&ar[y]==ar[z]&&ar[z]==ar[t]) return 1; return 0; } int main(){ buf; //sieve(); //fact(); ll i,j,k,test,flag,ans,t,a,b,c,d; string s; //cin>>test; test=1; while(test--){ for(i=1;i<=24;i++){ cin>>ar[i]; } flag=0; if(check(1,2,3,4)&&check(9,10,11,12)) flag+=1; if(check(16,15,13,14)&&check(17,18,19,20)) flag+=10; if(check(5,6,7,8)&&check(21,22,23,24)) flag+=100; if(flag==111) {cout<<"NO"; } else if(flag==1||flag==10||flag==100){ if(flag==1){ if(ar[13]==ar[7]&&ar[14]==ar[8]&&ar[5]==ar[19]&&ar[6]==ar[20]&& ar[17]==ar[23]&&ar[18]==ar[24]&&ar[21]==ar[15]&&ar[22]==ar[16]) {cout<<"YES"; return 0;} if(ar[13]==ar[23]&&ar[14]==ar[24]&&ar[5]==ar[15]&&ar[6]==ar[16]&& ar[17]==ar[7]&&ar[18]==ar[8]&&ar[21]==ar[19]&&ar[22]==ar[20]) {cout<<"YES"; return 0;} } if(flag==10){ if(ar[1]==ar[6]&&ar[3]==ar[8]&&ar[5]==ar[10]&&ar[7]==ar[12]&& ar[9]==ar[23]&&ar[11]==ar[21]&&ar[22]==ar[4]&&ar[24]==ar[2]) {cout<<"YES"; return 0;} if(ar[1]==ar[23]&&ar[3]==ar[21]&&ar[5]==ar[2]&&ar[7]==ar[4]&& ar[9]==ar[6]&&ar[11]==ar[8]&&ar[22]==ar[12]&&ar[24]==ar[10]) {cout<<"YES"; return 0;} } if(flag==100){ if(ar[3]==ar[18]&&ar[4]==ar[20]&&ar[17]==ar[12]&&ar[19]==ar[11]&& ar[10]==ar[15]&&ar[9]==ar[13]&&ar[16]==ar[1]&&ar[14]==ar[2]) {cout<<"YES"; return 0;} if(ar[3]==ar[15]&&ar[4]==ar[13]&&ar[17]==ar[1]&&ar[19]==ar[2]&& ar[10]==ar[18]&&ar[9]==ar[20]&&ar[16]==ar[12]&&ar[14]==ar[11]) {cout<<"YES"; return 0;} } } else{ cout<<"NO"; } } return 0; }
run
|
edit
|
history
|
help
0
PRIx64 on gcc
char
SD
Изволов#7
obracanie tablicy
volatile thread-safe object
Test 16(2020)
MoveBubble
Dijkstra
Segmented Sieve