#include<bits/stdc++.h> #define LL long long #define Pi acos(-1.0) #define INF 2147483646 #define eps 1e-9 #define MS 100009 #define mss 17 usingnamespace std; // Notice the data size // Notice the input and output
#include<bits/stdc++.h> #define LL long long #define Pi acos(-1.0) #define INF 2147483646 #define eps 1e-9 #define MS 100009 #define mss 17 usingnamespace std; // Notice the data size // Notice the input and output
int p[10] = {0,1,2,3,4,5,6,7,8,9}; // 需要递增
intBinSearch(int tar){ int l = 0 ,r = 9; while(l<=r){ int mi = (l+r)/2; if(p[mi] == tar) return mi+1; // 返回逻辑序号 if(p[mi] < tar) l = mi+1; else r = mi-1; } return0; }
intmain(){ int tar; cin >> tar; printf("%d\n",BinSearch(tar)); return0; }
#include<bits/stdc++.h> #define LL long long #define Pi acos(-1.0) #define INF 2147483646 #define eps 1e-9 #define MS 10000 usingnamespace std; // Notice the data size
#include<bits/stdc++.h> #define LL long long #define Pi acos(-1.0) #define INF 2147483646 #define eps 1e-9 #define MS 100009 #define mss 17 usingnamespace std; // Notice the data size // Notice the input and output
constint m = 13;
int p[15] = {16,74,60,43,54,90,46,31,29,88,77}; structnode{ node *next; int val; }*head[m+1],*tail[m+1];