标签:unsigned soft init 链接 sign owb 分享 ide pac
分析 :
没啥分析的...
画个表格,填一填,就会发现和奇异局势的前几项一样
然后打个奇异局势的表就能 AC 了
#include<bits/stdc++.h> #define LL long long #define ULL unsigned long long #define pb(i) push_back(i) #define pii pair<int, int> #define pll pair<long long, long long> #define MK(i, j) make_pair(i, j) #define mem(a, b) memset(a, b, sizeof(a)) #define ins(i) insert(i) #define lowbit(i) (i & (-i)) #define lson l, m, rt<<1 #define rson m+1, r, rt<<1|1 #define INF (0x3f3f3f3f) using namespace std; const int maxn = 1e4 + 10; int arr[maxn]; inline void init() { mem(arr, -1); int num = 0; for(int i=0; i+num<maxn; i++){ if(arr[i] == -1){ arr[i] = i+num; arr[i+num] = i; num++; } } } int main(void) { init(); int a, b; while(~scanf("%d %d", &a, &b)){ if(arr[a] == b || arr[b] == a) puts("Lao Wang"); else puts("Xiao Ren"); } return 0; }
标签:unsigned soft init 链接 sign owb 分享 ide pac
原文地址:https://www.cnblogs.com/Rubbishes/p/8977037.html