Guest User

Untitled

a guest
Oct 1st, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5.     freopen("powerstower.in", "r", stdin);
  6.     freopen("powerstower.out", "w", stdout);
  7.  
  8.     int n;
  9.     cin >> n;
  10.  
  11.     int a0;
  12.     cin >> a0;
  13.  
  14.     a0 %= 3;
  15.  
  16.     if(a0 == 0) cout << 0;
  17.     else if(a0 == 1) cout << 1;
  18.     else if(n == 1) cout << 2;
  19.     else{
  20.         int a1;
  21.         cin >> a1;
  22.         if(a1 % 2 == 1) cout << 2;
  23.         else cout << 1;
  24.     }
  25.  
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment