# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
775691 | davitmarg | 코알라 (APIO17_koala) | C++17 | 20 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "koala.h"
/*
-----orz------
DavitMargaryan
-----orz------
*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <bitset>
#include <stack>
#include <cassert>
#include <iterator>
#include <random>
#include <chrono>
#define mod 998244353ll
#define LL long long
#define LD long double
#define MP make_pair
#define PB push_back
#define all(v) v.begin(), v.end()
#define fastIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 500005;
int n, w;
int B[N], R[N];
void query()
{
for (int i = 0; i < n; i++)
R[i] = 0;
playRound(B, R);
}
void query(vector<int> b)
{
for (int i = 0; i < n; i++)
B[i] = b[i];
query();
}
int minValue(int nn, int ww) {
n = nn;
w = ww;
B[0] = 1;
query();
if(R[0] < 2)
return 0;
for(int i = 0; i < n; i++)
if(R[i] == 0)
return i;
}
int maxValue(int nn, int ww) {
n = nn;
w = ww;
int res = 0;
vector<int> p;
for(int i = 0; i < n; i++)
p.push_back(i);
int k = 1;
while(p.size() > 1)
{
for(int i = 0; i < n; i++)
B[i] = 0;
for(int i = 0; i < p.size(); i++)
B[p[i]] = k;
query();
vector<int> np;
for(int i = 0; i < p.size(); i++)
if(R[p[i]] > B[p[i]])
np.push_back(p[i]);
p = np;
k++;
}
return p[0];
}
int greaterValue(int nn, int ww) {
return 0;
}
void allValues(int nn, int ww, int *P) {
if (ww == 2*nn) {
// TODO: Implement Subtask 4 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
} else {
// TODO: Implement Subtask 5 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
}
}
/*
2 1
5 5
3 5 4 1 2
2 1
6 6
5 3 2 1 4 6
*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |