Submission #218204

# Submission time Handle Problem Language Result Execution time Memory
218204 2020-04-01T14:05:41 Z EntityIT 라멘 (JOI14_ramen) C++14
100 / 100
6 ms 384 KB
#include<bits/stdc++.h>
using namespace std;

#include "ramen.h"

#define all(x) (x).begin(), (x).end()
#define sz(x) ( (int)(x).size() )
using LL = long long;

mt19937 rng( (uint32_t)chrono::steady_clock::now().time_since_epoch().count() );

void Ramen(int N) {
    vector<int> small, big;
    for (int i = 0; i < N; i += 2) {
        if (i + 1 < N) {
            if (~Compare(i, i + 1) ) {
                big.emplace_back(i + 1);
                small.emplace_back(i);
            }
            else {
                big.emplace_back(i);
                small.emplace_back(i + 1);
            }
        }
        else {
            small.emplace_back(i);
            big.emplace_back(i);
        }
    }

    int x = big[0];
    for (int i = 1; i < sz(big); ++i) if (~Compare(x, big[i]) ) x = big[i];

    int y = small[0];
    for (int i = 1; i < sz(small); ++i) if (~Compare(small[i], y) ) y = small[i];

    Answer(x, y);
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct