#55632: c++ 直觀解


61247091s@gapps.ntnu.edu.tw (wei)


#include <bits/stdc++.h>
using namespace std;

int main(){
    int b,num;
    cin>>b>>num;
    vector <int> v(num);
    for(int i=0;i<num;i++)cin>>v[i];
    bool drew=true;
    for(int i=0;i<num;i++){
        cout<<b<<" ";
        if(v[i]==0&&b==2){cout<<": Lost at round "<<i+1<<endl;drew=false;break;}
        if(v[i]==2&&b==5){cout<<": Lost at round "<<i+1<<endl;drew=false;break;}
        if(v[i]==5&&b==0){cout<<": Lost at round "<<i+1<<endl;drew=false;break;}
        if(v[i]==0&&b==5){cout<<": Won at round "<<i+1<<endl;drew=false;break;}
        if(v[i]==2&&b==0){cout<<": Won at round "<<i+1<<endl;drew=false;break;}
        if(v[i]==5&&b==2){cout<<": Won at round "<<i+1<<endl;drew=false;break;}
        if(i!=0&&v[i]==v[i-1]){
            if(v[i]==5)b=2;
            else if(v[i]==0)b=5;
            else if(v[i]==2)b=0;}
        else b=v[i];
    }
    if(drew)cout<<": Drew at round "<<num<<endl;
   
    return 0;
}