-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTemplate.cpp
More file actions
65 lines (60 loc) · 2.87 KB
/
Template.cpp
File metadata and controls
65 lines (60 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#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 playerCount; // the amount of players (between 2 to 4 )
int myId; // my player ID (0 or 1)
int zoneCount; // the amount of zon es on the map
int linkCount; // the amount of links between all zones
cin >> playerCount >> myId >> zoneCount >> linkCount; cin.ignore();
for (int i = 0; i < zoneCount; i++) {
int zoneId; // this zone's ID (between 0 and zoneCount-1)
int resourceType; // Neutral=0 Rhodium=1 Platinum=2 Gold=3
int minePower; // Number of resource zone mine has
cin >> zoneId >> resourceType >> minePower; cin.ignore();
}
for (int i = 0; i < linkCount; i++) {
int zone1;
int zone2;
cin >> zone1 >> zone2; cin.ignore();
}
// game loop
while (1) {
int myRhodium; // your available Rhodium
int myPlatinum; // your available Platinum
int myGold; // your available Gold
cin >> myRhodium >> myPlatinum >> myGold; cin.ignore();
for (int i = 0; i < zoneCount; i++) {
int zId; // this zone's ID
int ownerId; // the player who owns this zone (-1 otherwise)
int explorerP0; // player 0's Explorers on this zone
int ninjaP0; // player 0's Ninjas on this zone
int terminatorP0; // player 0's Terminators on this zone
int predatorP0; // player 0's Predators on this zone
int explorerP1; // player 1's Explorers on this zone
int ninjaP1; // player 1's Ninjas on this zone
int terminatorP1; // player 1's Terminators on this zone
int predatorP1; // player 1's Predators on this zone
int explorerP2; // player 2's Explorers on this zone
int ninjaP2; // player 2's Ninjas on this zone
int terminatorP2; // player 2's Terminators on this zone
int predatorP2; // player 2's Predators on this zone
int explorerP3; // player 3's Explorers on this zone
int ninjaP3; // player 3's Ninjas on this zone
int terminatorP3; // player 3's Terminators on this zone
int predatorP3; // player 3's Predators on this zone
cin >> zId >> ownerId >> explorerP0 >> ninjaP0 >> terminatorP0 >> predatorP0 >> explorerP1 >> ninjaP1 >> terminatorP1 >> predatorP1 >> explorerP2 >> ninjaP2 >> terminatorP3 >> predatorP3 >> explorerP3 >> ninjaP3 >> terminatorP3 >> predatorP3; cin.ignore();
}
// Write an action using cout. DON'T FORGET THE "<< endl"
// To debug: cerr << "Debug messages..." << endl;
cout << "WAIT" << endl; // First line for movement commands
cout << "WAIT" << endl; // Second line for purchase commands
}
}