제출 #993542

#제출 시각아이디문제언어결과실행 시간메모리
993542abczz마술쇼 (APIO24_show)C++17
0 / 100
2 ms1328 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...