This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "art.h"
#define el '\n'
#define fi first
#define sc second
//#define int ll
#define pii pair<int, int>
#define all(v) v.begin(), v.end()
using namespace std;
using ll=long long;
using ull=unsigned long long;
using ld=long double;
const int mod=1e9+7;
const int N=1e5+11;
int ask(int x, int n)
{
vector<int> a;
a.push_back(x);
for(int i=1;i<=n;i++) if(x!=i) a.push_back(i);
return publish(a);
}
void read(vector<int>& a, int x, int j)
{
vector<int> b;
for(int i=0;i<j;i++) b.push_back(a[i]);
b.push_back(x);
for(int i=j;i<a.size(); i++) b.push_back(a[i]);
vector<int> cc=b;
b=a;
a=cc;
}
void solve(int n)
{
vector<int> ans;
ans.push_back(1);
for(int i=2;i<=n;i++) read(ans, i, (i-ask(1,n)+ask(i,n)-1)/2);
answer(ans);
}
//signed main()
//{
//// freopen("divisor.INP", "r", stdin);
//// freopen("divisor.OUT", "w", stdout);
// ios_base::sync_with_stdio(0);
// cin.tie(0);
// int t=1;
// //cin >> t;
// while(t--)
// {
// sol();
// }
//}
Compilation message (stderr)
art.cpp: In function 'void read(std::vector<int>&, int, int)':
art.cpp:27:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
27 | for(int i=j;i<a.size(); i++) b.push_back(a[i]);
| ~^~~~~~~~~
interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
20 | if(v.size() != N) {
| ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
36 | if(v.size() != N) {
| ~~~~~~~~~^~~~
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |