이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
#include "Alice.h"
#include <iostream>
#include <random>
#include <algorithm>
#define ll long long
using namespace std;
std::vector<std::pair<int,int>> Alice(){
mt19937_64 mt(69);
vector <pair<int, int>> edges;
vector <ll> perm;
ll n = 5000;
ll x = setN(5000);
ll mx = 0;
for (int i=3; i<=n; ++i) {
perm.push_back(i);
}
shuffle(perm.begin(), perm.end(), mt);
edges.push_back({1, 2});
for (int i=0; i<60; ++i) {
for (int j=i*83; j<(i+1)*83; ++j) {
edges.push_back({(x & 1) + 1, perm[j]});
mx = max(mx, (ll)j);
}
x /= 2;
}
for (int i=mx+1; i<perm.size(); ++i) {
edges.push_back({1, perm[i]});
}
shuffle(edges.begin(), edges.end(), mt);
return edges;
}
#include <vector>
#include "Bob.h"
#include <iostream>
#include <random>
#include <algorithm>
#define ll long long
using namespace std;
long long Bob(std::vector<std::pair<int,int>> V){
mt19937_64 mt(69);
vector <ll> perm;
ll n = 5000, X[5001], k = 1, f = 0;
for (int i=3; i<=n; ++i) {
X[i] = -1;
perm.push_back(i);
}
shuffle(perm.begin(), perm.end(), mt);
for (auto [a, b] : V) {
X[b] = a;
}
for (int i=0; i<60; ++i) {
ll bit = 0;
for (int j=i*83; j<(i+1)*83; ++j) {
if (X[perm[j]] != -1) bit = X[perm[j]]-1;
}
//cout << bit;
f += bit * k;
k *= 2;
}
//cout << endl;
return f;
}
컴파일 시 표준 에러 (stderr) 메시지
Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:29:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
29 | for (int i=mx+1; i<perm.size(); ++i) {
| ~^~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |