Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x[10], sum=0;
- for(int i=0;i<10;i++)
- {
- cin>>x[i];
- sum+=x[i];
- }
- if(sum/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0";
- return 0;
- }
- else
- {
- //1
- if(((x[3]+1)==x[1]) && ((x[4]+1)==x[1]) && ((x[7]+1)==x[1]) && ((x[8]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+5)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n1\n0\n0\n0\n0\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //2
- if(((x[8]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+2)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n1\n0\n0\n0\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //3
- if(((x[7]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+2)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n1\n0\n0\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //4
- if(((x[2]+1)==x[1]) && ((x[4]+1)==x[1]) && ((x[8]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+4)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n0\n1\n0\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //5
- if(((x[5]+1)==x[1]) && ((x[7]+1)==x[1]) && ((x[8]+1)==x[1]))
- {
- if((sum+3)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n0\n0\n1\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //6
- if(((x[1]+1)==x[1]) && ((x[2]+1)==x[1]) && ((x[3]+1)==x[1]) && ((x[4]+1)==x[1]) && ((x[7]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+6)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0";
- return 0;
- }
- }
- //7
- if(((x[0]+1)==x[1]) && ((x[1]+1)==x[1]) && ((x[3]+1)==x[1]) && ((x[5]+1)==x[1]) && ((x[7]+1)==x[1]) && ((x[8]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+7)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n0\n0\n0\n0\n1\n0\n0\n0";
- return 0;
- }
- }
- //8
- if((x[9]+1)==x[1])
- {
- if((sum+1)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n0\n0\n0\n0\n0\n1\n0\n0";
- return 0;
- }
- }
- //9
- if(((x[6]+1)==x[1]) && ((x[7]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+3)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n0\n0\n0\n0\n0\n0\n1\n0";
- return 0;
- }
- }
- //10
- if(((x[4]+1)==x[1]) && ((x[6]+1)==x[1]) && ((x[8]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+4)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"1\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1";
- return 0;
- }
- }
- //1 & 2
- if(((x[3]+1)==x[1]) && ((x[4]+1)==x[1]) && ((x[7]+1)==x[1]) && ((x[8]+2)==x[1]) && ((x[9]+2)==x[1]))
- {
- if((sum+7)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"2\n1\n1\n0\n0\n0\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //2 & 3
- if(((x[7]+1)==x[1]) && ((x[8]+1)==x[1]) && ((x[9]+2)==x[1]))
- {
- if((sum+4)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"2\n0\n1\n1\n0\n0\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //3 & 5
- if(((x[5]+1)==x[1]) && ((x[7]+2)==x[1]) && ((x[8]+1)==x[1]) && ((x[9]+2)==x[1]))
- {
- if((sum+6)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"2\n0\n0\n1\n0\n1\n0\n0\n0\n0\n0";
- return 0;
- }
- }
- //5 & 8
- if(((x[5]+1)==x[1]) && ((x[7]+1)==x[1]) && ((x[8]+1)==x[1]) && ((x[9]+1)==x[1]))
- {
- if((sum+4)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"2\n0\n0\n0\n0\n1\n0\n0\n1\n0\n0";
- return 0;
- }
- }
- //2 & 8
- if(((x[8]+1)==x[1]) && ((x[9]+2)==x[1]))
- {
- if((sum+3)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"2\n0\n1\n0\n0\n0\n0\n0\n1\n0\n0";
- return 0;
- }
- }
- //3 & 8
- if(((x[7]+1)==x[1]) && ((x[9]+2)==x[1]))
- {
- if((sum+3)/10==x[1])
- {
- cout<<"GALIMA"<<endl;
- cout<<"2\n0\n0\n1\n0\n0\n0\n0\n1\n0\n0";
- return 0;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement