#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
template<class T> using indexed_set = tree<T, null_type, less_equal<T>,
rb_tree_tag, tree_order_statistics_node_update>;
#define fbo find_by_order //(k-indexed val with 0-indexing)
#define ook order_of_key //(num of vals in set that are strictly less)
#define ms(x, a) memset(x, a, sizeof(x))
#define siz(x) (int)x.size()
#define len(x) (int)x.length()
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vals, Args&&... values){
cout << vals << " = ";
string delim = "";
(...,(cout << delim << values, delim = ", "));
cout << endl;
}
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9+7;
//===========================================
int main(){
cin.tie(0)->sync_with_stdio(0);
int n, t; cin >> n >> t;
while (t--){
int a, b; cin >> a >> b;
for (int i = 0; i < 10; i++){
if ((a&(1<<i)) != (b&(1<<i))){
cout << ((a&(1<<i))? 11 : 1)+i << "\n";
break;
}
}
}
}
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
template<class T> using indexed_set = tree<T, null_type, less_equal<T>,
rb_tree_tag, tree_order_statistics_node_update>;
#define fbo find_by_order //(k-indexed val with 0-indexing)
#define ook order_of_key //(num of vals in set that are strictly less)
#define ms(x, a) memset(x, a, sizeof(x))
#define siz(x) (int)x.size()
#define len(x) (int)x.length()
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vals, Args&&... values){
cout << vals << " = ";
string delim = "";
(...,(cout << delim << values, delim = ", "));
cout << endl;
}
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9+7;
//===========================================
int main(){
cin.tie(0)->sync_with_stdio(0);
int n, t; cin >> n >> t;
while (t--){
int q, h; cin >> q >> h;
bool on = (h > 10);
if (h > 10) h -= 11;
else h--;
cout << ((q&(1<<h)) > 0 == on? "yes\n" : "no\n");
}
}
Compilation message
/usr/bin/ld: /tmp/ccZvOiAl.o: in function `main':
grader_encode.c:(.text.startup+0x0): multiple definition of `main'; /tmp/ccSMgYHn.o:encoder.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccZvOiAl.o: in function `main':
grader_encode.c:(.text.startup+0x129): undefined reference to `encode(int, int, int)'
collect2: error: ld returned 1 exit status
decoder.cpp: In function 'int main()':
decoder.cpp:42:29: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
42 | cout << ((q&(1<<h)) > 0 == on? "yes\n" : "no\n");
| ~~~~~~~~~~~^~~
/usr/bin/ld: /tmp/ccilcNq9.o: in function `main':
grader_decode.c:(.text.startup+0x0): multiple definition of `main'; /tmp/cccHumR8.o:decoder.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccilcNq9.o: in function `main':
grader_decode.c:(.text.startup+0x22f): undefined reference to `decode(int, int, int)'
collect2: error: ld returned 1 exit status