Advertisement
xTheEc0

CodinGame.com // Skynet: the Chasm // Easy

Oct 22nd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. /**
  9.  * Auto-generated code below aims at helping you parse
  10.  * the standard input according to the problem statement.
  11.  **/
  12. int main()
  13. {
  14.     int road; // the length of the road before the gap.
  15.     cin >> road; cin.ignore();
  16.     int gap; // the length of the gap.
  17.     cin >> gap; cin.ignore();
  18.     int platform; // the length of the landing platform.
  19.     cin >> platform; cin.ignore();
  20.    
  21.     cerr << gap << endl;
  22.    
  23.     // game loop
  24.     while (1) {
  25.         int speed; // the motorbike's speed.
  26.         cin >> speed; cin.ignore();
  27.         int coordX; // the position on the road of the motorbike.
  28.         cin >> coordX; cin.ignore();
  29.  
  30.         // Write an action using cout. DON'T FORGET THE "<< endl"
  31.         // To debug: cerr << "Debug messages..." << endl;
  32.  
  33.         //cout << "SPEED" << endl; // A single line containing one of 4 keywords: SPEED, SLOW, JUMP, WAIT.
  34.        
  35.         if (speed < gap + 1 && coordX < road) cout << "SPEED" << endl;
  36.         else if (speed > gap + 1 && coordX < road) cout << "SLOW" << endl;
  37.         else if (coordX == road - 1) cout << "JUMP" << endl;
  38.         else if (coordX > road && speed > 0) cout << "SLOW" << endl;
  39.         else cout << "WAIT" << endl;
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement