Submission #588806

#TimeUsernameProblemLanguageResultExecution timeMemory
588806shayanebrahimiArt Collections (BOI22_art)C++17
100 / 100
1559 ms768 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; typedef int 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 (stderr)

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:10:14: warning: overflow in conversion from 'double' to 'll' {aka 'int'} changes value from '8.0e+18' to '2147483647' [-Woverflow]
   10 | const ll INF=8e18;
      |              ^~~~
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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...