답안 #408550

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
408550 2021-05-19T08:00:43 Z abc864197532 코알라 (APIO17_koala) C++17
4 / 100
6 ms 308 KB
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define info() cerr << __PRETTY_FUNCTION__ << ": " << __LINE__ << endl
void abc() {cerr << endl;}
template <typename T, typename ...U> void abc(T a, U ...b) {
    cerr << a << ' ', abc(b...);
}
template <typename T> void printv(T l, T r) {
    while (l != r) cout << *l << " \n"[++l == r];
}
template <typename A, typename B> istream& operator >> (istream& o, pair<A, B> &a) {
    return o >> a.X >> a.Y;
}
template <typename A, typename B> ostream& operator << (ostream& o, pair<A, B> a) {
    return o << '(' << a.X << ", " << a.Y << ')';
}
template <typename T> ostream& operator << (ostream& o, vector<T> a) {
    bool is = false;
    for (T i : a) {o << (is ? ' ' : '{'), is = true, o << i;}
    return o << '}';
}
template <typename T> struct vv : vector <vector <T>> {
    vv(int n, int m, T v) : vector <vector <T>> (n, vector <T>(m, v)) {}
};
template <typename T> struct vvv : vector <vv <T>> {
    vvv(int n, int m, int k, T v) : vector <vv <T>> (n, vv <T>(m, k, v)) {}
};
#ifdef Doludu
#define test(args...) info(), abc("[" + string(#args) + "]", args)
#define owo
#include "koala-grader.cpp"
#else
#define test(args...)
#define owo ios::sync_with_stdio(false); cin.tie(0)
#endif
// const int mod = 998244353, N = 1000001, logN = 20, K = 111;

void playRound(int *b, int *r);

int minValue(int n, int w) {
    int cur[n]{}, res[n];
    cur[0] = 1;
    playRound(cur, res);
    if (res[0] < 2) return 0;
    for (int i = 1; i < n; ++i) if (res[i] == 0) return i;
}

int maxValue(int n, int w) {
    int cur[n]{}, res[n]{};
    vector <bool> possible(n, true);
    for (int i = 0; i < n; ++i) if (res[i] > 1) possible[i] = true;
    return 0;
}

int greaterValue(int n, int w) {
    int cur[n]{}, res[n];
    cur[0] = cur[1] = 7;
    playRound(cur, res);
    if (res[0] > 7) return 0;
    if (res[1] > 7) return 1;
    cur[0] = cur[1] = 1;
    playRound(cur, res);
    if (res[0] > 1) return 0;
    if (res[1] > 1) return 1;
    assert(false);
    /*
     * 2 2 0 0 0 0
     * min < 1 + 2 + 3 + 4
     * 10 10 0 0 0
     *
     */
}

void allValues(int n, int w, int *p) {
    if (w == n * 2) {

    } else {

    }
}

/*
2 1
6 6 5 3 2 1 6 4

 */

Compilation message

koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:58:9: warning: unused variable 'cur' [-Wunused-variable]
   58 |     int cur[n]{}, res[n]{};
      |         ^~~
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 200 KB Output is correct
2 Correct 5 ms 200 KB Output is correct
3 Correct 6 ms 200 KB Output is correct
4 Correct 5 ms 308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 200 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 200 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 200 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 200 KB Output isn't correct
2 Halted 0 ms 0 KB -