Rezultati

Up. imeNalogaJezikRezultatČas oddaje
DROPTABLE-2017 Akcija C++ 100/100OK 20. apr '17 @ 18:56

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 3,184 MiB 0,004 s OK
#2 7/7 3,262 MiB 0,004 s OK
#3 7/7 3,254 MiB 0,004 s OK
#4 7/7 3,262 MiB 0,043 s OK
#5 8/8 3,191 MiB 0,371 s OK
#6 8/8 3,262 MiB 0,341 s OK
#7 8/8 3,262 MiB 0,347 s OK
#8 8/8 3,262 MiB 0,340 s OK
#9 8/8 3,191 MiB 0,365 s OK
#10 8/8 3,262 MiB 0,359 s OK
#11 8/8 3,250 MiB 0,341 s OK
#12 8/8 3,191 MiB 0,328 s OK
#13 8/8 3,191 MiB 0,004 s OK

Ocenjevani program (akcija.cpp):
#include <iostream>
#include <map>
#include <string>

using namespace std;

int parseMonth(string s, map<string, int> month) {
	int i = s.find(".");
	int day = stoi(s.substr(0, i));
	s = s.substr(i + 2);
	return day + month[s.substr(0, s.find(" "))];
}

int main() {
	map<string, int> month;
	month["januar"] = 0;
	month["februar"] = 31;
	month["marec"] = 59;
	month["april"] = 90;
	month["maj"] = 120;
	month["junij"] = 151;
	month["julij"] = 181;
	month["avgust"] = 212;
	month["september"] = 243;
	month["oktober"] = 273;
	month["november"] = 304;
	month["december"] = 334;

	int today = 20 + month["april"];

	double f;
	string s;
	int n, z;
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> z >> f;
		getline(cin, s);
		int days = parseMonth(s, month);
		if (days < today) cout << "V SMETI\n";
		else if ((double)z / f + today <= days + 1) cout << "OK\n";
		else cout << "AKCIJA\n";
	}

	return 0;
}