Submission #588803

# Submission time Handle Problem Language Result Execution time Memory
588803 2022-07-04T05:34:29 Z shayanebrahimi Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "art.h"
using namespace std;
typedef long long ll;
#define endl                        '\n'
#define fast_io;                 ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const ll MOD=1e9+7;//998244353//1e9+9//1111211111;
//ll tavmd(ll a,ll b){if(b==0){return 1;}if(b%2==0){ll x=tavmd(a,b/2);return(x*x)%MOD;}else{return(a%MOD*tavmd(a,b-1)%MOD)%MOD;}}
const ll MAXN=2e6+10;
const ll INF=8e18;
const ll LOG=30;
void solve(ll n){
      vector<ll>a(n),b(n),c;
      for(int i=1;i<=n;i++)
            c.push_back(i);
      for(int i=0;i<n;i++){
            b[i]=publish(c);
            for(int j=1;j<n;j++){
                  swap(c[j],c[j-1]);
            }
      }
      for(int i=0;i<n;i++){
            a[(b[i]-b[(i+1)%n]+n)/2]=i+1;
      }
      answer(a);
}

Compilation message

art.cpp:6:9: warning: ISO C++11 requires whitespace after the macro name
    6 | #define fast_io;                 ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
      |         ^~~~~~~
art.cpp: In function 'void solve(ll)':
art.cpp:17:26: error: could not convert 'c' from 'vector<long long int>' to 'vector<int>'
   17 |             b[i]=publish(c);
      |                          ^
      |                          |
      |                          vector<long long int>
art.cpp:25:14: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
   25 |       answer(a);
      |              ^
      |              |
      |              vector<long long int>
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) {
      |        ~~~~~~~~~^~~~