Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 3,242 MiB 0,004 s OK
#2 7/7 3,242 MiB 0,010 s OK
#3 7/7 3,188 MiB 0,004 s OK
#4 7/7 3,242 MiB 0,037 s OK
#5 8/8 3,188 MiB 0,316 s OK
#6 8/8 3,180 MiB 0,274 s OK
#7 8/8 3,188 MiB 0,310 s OK
#8 8/8 3,188 MiB 0,298 s OK
#9 8/8 3,230 MiB 0,316 s OK
#10 8/8 3,184 MiB 0,310 s OK
#11 8/8 3,180 MiB 0,335 s OK
#12 8/8 3,184 MiB 0,316 s OK
#13 8/8 3,188 MiB 0,004 s OK

Ocenjevani program (main.cpp):
#include <bits/stdc++.h>

using namespace std;

int n;

string months[] = {"januar", "februar", "marec", "april", "maj", "junij", "julij", "avgust", "september", "oktober",
                   "november", "december"};
int month_length[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int month_id(string s) {
    for (int i = 0; i < 12; i++) {
        if (months[i] == s) {
            return i;
        }
    }
}

int day_of_year(int month, int day) {
    int ret = day;
    for (int i = 0; i < month; i++) {
        ret += month_length[i];
    }

    return ret;
}

using llong = long long;

int main() {
    int current_day = day_of_year(4 - 1, 20);

    //cout << day_of_year(2, 1) << endl;

    cin >> n;

    for (int i = 0; i < n; i++) {
        llong z;
        int f, ffrac;
        llong fl;
        string day_s, month_s;
        int year, day, month;

        cin >> z; z*=100;
        scanf("%d.%d", &f, &ffrac); fl = 100*f + ffrac;
        cin >> day_s >> month_s >> year;
        day_s.pop_back();

        sscanf(day_s.c_str(), "%d", &day);
        month = month_id(month_s);

        int d = day_of_year(month, day);
        int diff = d - current_day + 1;

        llong sranje1 = fl*diff;
        if (diff <= 0) {
            cout << "V SMETI\n";
        } else if (sranje1 >= z) {
            cout << "OK\n";
        } else if (sranje1 < z) {
            cout << "AKCIJA\n";
        }
    }

    return 0;
}