Submission #1229399


Source Code Expand

int main(){
  int N;
  int A;
  int B;
  int i; 
  cin >> N >> A >> B;
    
  //for(i=1;(A+B)*i<N;i++){
  if( N%(A+B)==0 ){
    cout <<  "Bug" <<endl;
  }else if(0<A-N%(A+B)){
    cout << "Ant" << endl;
  }else if(0<N%(A+B)-A){
    cout << "Bug" << endl;
  }
  return 0;
}
  

Submission Info

Submission Time
Task A - 小石を取るゲーム
User k16180
Language C++14 (GCC 5.4.1)
Score 0
Code Size 294 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:6:3: error: ‘cin’ was not declared in this scope
   cin >> N >> A >> B;
   ^
./Main.cpp:10:5: error: ‘cout’ was not declared in this scope
     cout <<  "Bug" <<endl;
     ^
./Main.cpp:10:22: error: ‘endl’ was not declared in this scope
     cout <<  "Bug" <<endl;
                      ^
./Main.cpp:12:5: error: ‘cout’ was not declared in this scope
     cout << "Ant" << endl;
     ^
./Main.cpp:12:22: error: ‘endl’ was not declared in this scope
     cout << "Ant" << endl;
                      ^
./Main.cpp:14:5: error: ‘cout’ was not declared in this scope
     cout << "Bug" << endl;
     ^
./Main.cpp:14:22: error: ‘endl’ was not declared in this scope
     cout << "Bug" << endl;
                      ^