• Benelux Algorithm Programming Contest 2016 Preliminary


    A. Block Game

     1 #pragma GCC optimize(2)
     2 #include <bits/stdc++.h>
     3 #define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
     4 #define debug  freopen("in.txt","r",stdin),freopen("out.txt","w",stdout);
     5 #define pb push_back
     6 #define all(x) x.begin(),x.end()
     7 #define fs first
     8 #define sc second
     9 using namespace std;
    10 typedef long long ll;
    11 typedef unsigned long long ull;
    12 typedef pair<int,int> pii;
    13 const int maxn = 1e6+10;
    14 const int maxM = 1e6+10;
    15 const int inf = 0x3f3f3f3f;
    16 const ll inf2 = 0x3f3f3f3f3f3f3f3f;
    17 inline void read(int &x){
    18     int s=0,w=1;
    19     char ch=getchar();
    20     while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
    21     while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
    22     x = s*w;
    23 }
    24 
    25 ll x,y;
    26 bool dfs(ll x,ll y){
    27     if(x < y) swap(x,y);
    28     if(x == 0 || y == 0) return false;
    29     if(!dfs(y,x%y) || x / y >1) return true;
    30     return false;
    31 }    
    32 int main(){
    33     // debug;
    34     ios;
    35 
    36     cin>>x>>y;
    37     if(dfs(x,y)) cout<<"win
    ";
    38     else cout<<"lose
    ";
    39     
    40     return 0;
    41 }

     

  • 相关阅读:
    CSS 定位position
    new Date(time).getTime()在ios返回NaN
    babel.js 文件 browser.min.js
    export 和 export default 的区别
    第一个webpack例子demo1
    Kafka源码解析与实战
    Redis实战
    RabbitMQ实战
    Spring源码理解
    Java并发编程实践
  • 原文地址:https://www.cnblogs.com/meanttobe/p/13619782.html
Copyright © 2020-2023  润新知