답안 #218204

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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);
}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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