# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1221866 | vladilius | 질문 (CEOI14_question_grader) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, tt; cin>>n>>tt;
while (tt--){
int x, y; cin>>x>>y;
if (x > y){
for (int i = 10; i >= 1; i--){
int j = i - 1;
bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
if (x1 != y1){
cout<<i<<"\n";
break;
}
}
}
else {
for (int i = 10; i >= 1; i--){
int j = i - 1;
bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
if (x1 != y1){
cout<<i + 10<<"\n";
break;
}
}
}
}
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, tt; cin>>n>>tt;
while (tt--){
int q, h; cin>>q>>h;
if (h <= 10){
if ((q >> (h - 1)) & 1){
cout<<"yes"<<"\n";
}
else {
cout<<"no"<<"\n";
}
}
else {
h -= 10;
if ((q >> (h - 1)) & 1){
cout<<"no"<<"\n";
}
else {
cout<<"yes"<<"\n";
}
}
}
}