
Input
The input contains two integers $row$, $col$ ($0 \le row, col \le 63$), separated by a single space.Output
Output “IN” or “OUT”.Examplesinput
0 0
output
OUT
input
27 0
output
IN
input
0 27
output
OUT
input
27 27
output
IN
Solution:
#include <bits/stdc++.h>
using namespace std;
vector<string> s = {
" # # ###### # ",
" # ### # # # # ##### ",
" ### # # ## # # # ",
" #### # # ##### #### # ### # ",
" ## # # #### # # # ## ",
" # ## ##### ### ### # # ## # # # ",
" ### # # # # #### ## ## ## ## ",
" ###### ## ## ### ### ### ## # # ### ",
" ############ # # # ## ## ## # ### ",
" #################### ####### #### ########## ",
" ################################################ ",
" ################################################## ",
" ################################################## ",
" #################################################### ",
" ###################################################### ",
" ###################################################### ",
" ######################################################## ",
" ########################################################## ",
" ######################################################## ",
" ############ # ############## # # ############# ",
" ## ######### # ############### # ######## ",
" #### ##### ## # ############### ## ## # ## ## ",
" ####### # ### ### ########### # # ## ###### ",
" ######### # # ## ## ######### ## ##### # ######### ",
" ############ ## ### ### ####### # # ### ########### ",
" ######### # ### ### ######## # ##### # # # ######## ",
"############ ### # # # # ###### # # ## ### #########",
"########### # # ## ### ### #### # ### #### ### # #########",
"########### ###### #### # # # # # # #### ### #########",
"########### # # ### ### # # ## ## # # # # #########",
"############ ## #### ## ### # ### #### # ###### ##########",
"########### ### # # ### # ### #### # ### # #########",
"############# ## ### ## ### ## # ## ## # # #########",
"############## ## # # # # # # # ## # ## ## ############",
"############ #### # # # # #### ## # # ### ### ###########",
"############# # # ### #### # ## # ## #############",
"################ ### # ## ## ## ## # ### # # ############",
"################## # ###### ####### # ################",
" ################ # ##### # ########### # ############## ",
" ############################## ############################ ",
" ########################### # # ############################# ",
" ######################### # ################################ ",
" ######################## # ############################# ",
" ####### ################### ############################### ",
" ####### # ################ ##################### ####### ",
" ####### # ########### # ########### ##### # ###### ",
" ####### # # # # # ## # ## # # # ## ## # ####### ",
" ######## ## # ## ## # # ### ######## ",
" ####### # #### #### ### ### ### ##### # ######### ",
" ########## # # # # #### ### ## # # ######### ",
" ######## ## ## # # # # ### # ########## ",
" ######### ## ##### ## # # # ## ############# ",
" ######### ### # # ### # ### # ########### ",
" ######### #### ### ## #### #### ############ ",
" ######### ## # # # # ############## ",
" ############ # #### ## ## # ## ############ ",
" ############# #### # ############ ",
" #################### ################# ",
" #################################### ",
" ################################ ",
" ############################## ",
" ######################## ",
" #################### ",
" ############ "};
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int r, c;
cin >> r >> c;
cout << (s[r] == '#' ? "IN" : "OUT") << '\n';
return 0;
}
Related posts:
Zuma
Expression parsing
Clockwork Bomb
Bribes
Lost Array
Splitting the Uniqueness
Calculating the determinant using Kraut method in $O(N^3)$
Sum of Odd Integers
Closest Equals
A + B Strikes Back
Vertical decomposition
Operations on polynomials and series
Divide by three, multiply by two
Party
Travel Card
Processing Queries
Irreducible Anagrams
Two Sets
Letters Removing
Sherlock's bet to Moriarty
Xors on Segments
The Door Problem
Epic Convolution
Suns and Rays
Rectangles and Square
Primality tests
Preorder Test
Binomial Coefficients
Road Repair in Treeland
Beautiful IP Addresses
Linear Congruence Equation
Cách giải hay cho những bài toán trên vnspoj