Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- using namespace std;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- int main()
- {
- int surfaceN; // the number of points used to draw the surface of Mars.
- int X; //Coordinates of the mars lander
- int Y; // ^^
- int hSpeed; // the horizontal speed (in m/s), can be negative.
- int vSpeed; // the vertical speed (in m/s), can be negative.
- int fuel; // the quantity of remaining fuel in liters.
- int rotate; // the rotation angle in degrees (-90 to 90).
- int power; // the thrust power (0 to 4).
- int landX; // X coordinate of a surface point. (0 to 6999)
- int landY; // Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
- cin >> surfaceN; cin.ignore();
- for (int i = 0; i < surfaceN; i++) {
- cin >> landX >> landY; cin.ignore();
- }
- // game loop
- while (1) {
- cin >> X >> Y >> hSpeed >> vSpeed >> fuel >> rotate >> power; cin.ignore();
- // Write an action using cout. DON'T FORGET THE "<< endl"
- // To debug: cerr << "Debug messages..." << endl;
- if (Y < 3500){
- if (vSpeed <= -40) cout << "0 4" << endl;
- if (vSpeed > -40) cout << "0 0" << endl;
- }
- else cout << "0 0" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement