#include <bits/stdc++.h>
#include "art.h"
using namespace std;
// #pragma GCC optimize("Ofast,inline")
// #pragma GCC optimize("unroll-loops")
#define ll long long
#define INF (ll)1e9+7
#define fo(i,n) for(ll i = 0;i<n;i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define deb(x) cout << #x << " = " << x << endl;
#define pb push_back
#define F first
#define S second
#define LSOne(x) ((x) & (-x))
typedef vector<int> vi;
typedef vector<ll> vl;
// int publish(vi v){
// fo(i, v.size())cout << v[i] << " ";
// cout << endl;
// int r;
// cin >> r;
// return r;
// }
void solve(int n){
vi v(n);
fo(i, n){
v[i] = i+1;
}
vi res;
fo(i, n){
res.pb(publish(v));
reverse(all(v));
int val = v[n-1];
v.pop_back();
reverse(all(v));
v.pb(val);
}
vector<pair<ll, ll>> ans;
int last = res[n-1];
fo(i, n){
deb(last-res[i]);
ans.pb({last-res[i], i+1});
last = res[i];
}
sort(all(ans));
vi toSend;
fo(i, n-1){
toSend.pb(ans[i+1].S);
// deb(ans[i+1].S);
}
// deb(ans[0].S);
toSend.pb(ans[0].S);
answer(toSend);
}
// int main(){
// solve(3);
// return 0;
// }
Compilation message
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) {
| ~~~~~~~~~^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Expected integer, but "last-res[i]" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Expected integer, but "last-res[i]" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Expected integer, but "last-res[i]" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Expected integer, but "last-res[i]" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Expected integer, but "last-res[i]" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Expected integer, but "last-res[i]" found |
2 |
Halted |
0 ms |
0 KB |
- |