Submission #137055

#TimeUsernameProblemLanguageResultExecution timeMemory
137055baluteshihAncient Books (IOI17_books)C++14
Compilation error
0 ms0 KiB
#include "books.h" #pragma GCC optimize("O3") #include <bits/stdc++.h> #define jizz ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define pb push_back #define ET cout << "\n" #define ALL(v) v.begin(),v.end() #define MP make_pair #define F first #define S second #define MEM(i,j) memset(i,j,sizeof i) #define DB(a,s,e) {for(int i=s;i<e;++i) cout << a[i] << " ";ET;} using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; long long minimum_walk(vector<int> p, int s) { ll ans=0; for(int i=0;i<p.size();++i) if(p[i]==i) ans+=2; else break; fi(ans==2*p.size()) return 0; for(int i=0;i<p.size();++i) ans+=abs(p[i]-i); return ans; }

Compilation message (stderr)

books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:21:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<p.size();++i)
              ~^~~~~~~~~
books.cpp:24:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  fi(ans==2*p.size()) return 0;
     ~~~^~~~~~~~~~~~
books.cpp:24:2: error: 'fi' was not declared in this scope
  fi(ans==2*p.size()) return 0;
  ^~
books.cpp:25:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<p.size();++i)
              ~^~~~~~~~~