Rezultati

Up. imeNalogaJezikRezultatČas oddaje
bitikubiti-2017 Akcija Java 100/100OK 20. apr '17 @ 18:52

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 34,754 MiB 0,000 s OK
#2 7/7 33,352 MiB 0,000 s OK
#3 7/7 34,164 MiB 0,000 s OK
#4 7/7 38,352 MiB 0,000 s OK
#5 8/8 65,469 MiB 0,467 s OK
#6 8/8 60,910 MiB 0,413 s OK
#7 8/8 65,609 MiB 0,458 s OK
#8 8/8 65,809 MiB 0,467 s OK
#9 8/8 62,266 MiB 0,496 s OK
#10 8/8 63,422 MiB 0,465 s OK
#11 8/8 64,430 MiB 0,487 s OK
#12 8/8 63,125 MiB 0,440 s OK
#13 8/8 33,645 MiB 0,000 s OK

Ocenjevani program (A.java):
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

/**
 * Created by bitikubiti-2017 on 4/20/17.
 */
public class A {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        StringBuilder out = new StringBuilder();
        //String data[] = "140 2.76 19. april 2017".split(" ", 3);
        for (int ii = 0; ii < n; ii++) {
            String data[] = br.readLine().split(" ", 3);
            long days = daysleft(data[2]);
            long perday = Integer.parseInt(data[1].split("\\.")[0])*100 + Integer.parseInt(data[1].split("\\.")[1]);
            long tosell = Integer.parseInt(data[0])*100;
            if(days <= 0){
                out.append("V SMETI\n");
            }
            else{
                if(perday*days >= tosell) out.append("OK\n");
                else out.append("AKCIJA\n");
            }
        }
        System.out.print(out);
//        System.out.println(daysleft("19. april 2017"));
//        System.out.println(daysleft("20. april 2017"));
//        System.out.println(daysleft("30. april 2017"));
//        System.out.println(daysleft("1. maj 2017"));
//        System.out.println(daysleft("31. maj 2017"));
//        System.out.println(daysleft("1. junij 2017"));
    }

    private static int daysleft(String date){
        int sum = 0;
        int day = Integer.parseInt(date.split("\\.")[0]);
        String month = date.split(" ")[1];
        switch(month){
            case "december": sum+=30;
            case "november": sum+=31;
            case "oktober": sum+=30;
            case "september": sum+=31;
            case "avgust": sum+=31;
            case "julij": sum+=30;
            case "junij": sum+=31;
            case "maj": sum+=30;
            case "april": break;
            default: sum-=1000;
        }
        sum += day;
        sum -= 19;
        return sum;
    }
}