Code Submission Evaluation System Login

CSES - HIIT Open 2018

HIIT Open 2018

Contest start:2018-05-26 11:00:00
Contest end:2018-05-26 16:00:00

Task list | Submit code | Submissions | Messages | Scoreboard | Statistics


History
2018-05-26 14:29:43
2018-05-26 14:24:51
2018-05-26 14:24:25
2018-05-26 14:19:25
2018-05-26 14:17:31
2018-05-26 14:12:18
2018-05-26 11:43:13
2018-05-26 11:16:56
2018-05-26 11:10:19
Task:Coins
Sender:El Numero Uno
Submission time:2018-05-26 14:29:43
Status:READY
Result:WRONG ANSWER

Show test data

Code

#include <iostream>
#include "stdio.h"

using namespace std;

int main()
{
    int N, c, s;
    long s1[3] {0,0,0};
    long s2[3] {0,0,0};
    cin >> N;
    for (int _ = 0; _ < N; _++) {
        cin >> c >> s;
        if (s == 1) {

            if (s1[0]==0||c < s1[1]) s1[1] = c;
            if (c > s1[2]) s1[2] = c;
            s1[0] += 1;
        } else {

            if (s2[0]==0||c < s2[1]) s2[1] = c;
            if (c > s2[2]) s2[2] = c;
            s2[0] += 1;
        }

        if (s1[2] < s2[1] && s1[0] <= s2[0]){
            printf("<\n");
        } else if (s2[2] < s1[1] && s1[0] <= s1[0]) {

            printf(">\n");
        } else {
            printf("?\n");
        }


    }
    return 0;
}