NC15826. chess
描述
输入描述
The input will consist of a series of pairs of integers a and b, Indicates the distance from the west boundary and the distance from the south boundary.
输出描述
For each pair of input integers a and b you should output the winner's name in one line;
示例1
输入:
1 2 3 5 1 1 3 2
输出:
Lao Wang Lao Wang Xiao Ren Xiao Ren
C++ 解法, 执行用时: 456ms, 内存消耗: 2620K, 提交时间: 2022-03-09 16:40:27
#include<bits/stdc++.h> using namespace std; int main() { int a,b; while(cin>>a>>b) cout<<((int)(((sqrt(5)+1)/2)*(max(a,b)-min(a,b)))==min(a,b) ? "Lao Wang":"Xiao Ren")<<endl; return 0; }