CSP-201812-1-小明上学
解题代码
#include <iostream>
#include <vector>
using namespace std;long long r, y, g, n, k, t, sumTime;int main() {cin >> r >> y >> g >> n;for (int i = 0; i < n; i++){cin >> k >> t;if (k == 0)sumTime += t;else if (k == 1)sumTime += t;else if (k == 2)sumTime += (t + r);}cout << sumTime;return 0;
}