Submission #558507

#TimeUsernameProblemLanguageResultExecution timeMemory
558507karonReversing a Sequence (IOI16_reverse)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define pb push_back #define rs resize #define debug printf("Hello\n") #define Pi 3.141592653589793 #define sz(a) ll((a).size()) #define all(x) (x).begin(), (x).end() #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define endl "\n" #define mp make_pair #define f first #define s second #define vt vector #define rst(a,b) memset((a),(b), sizeof(a)) #define FOR(a, b, c) for (ll a = (b); (a) < (c); ++(a)) #define FORE(a, b, c) for (ll a = (b); (a) <= (c); ++(a)) #define FORR(a, b, c) for (ll a = (b); (a) >= (c); --(a)) #define umap unordered_map #define len(a) (a).length() #define pqueue priority_queue using namespace std; using vi = vector<int>; using ui = unsigned int; using ll = long long; using pll = pair<ll,ll>; using vll = vector<ll>; using ull = unsigned long long; using pii = pair<int, int>; ll e(ll base, ll pwr, ll mm = LLONG_MAX){ if(pwr == 1) return base%mm;; if(pwr == 0) return 1; if(pwr % 2 == 1){ ull t = e(base, (pwr-1)/2,mm)%mm; return (t*t)%mm*base%mm ; } if(pwr % 2 == 0){ ull t = e(base, pwr/2, mm)%mm; return (t*t)%mm; } return 0; } ll flt(ll a, ll p){ return e(a,p-2,p); } ll combination(ll n, ll r){ if(r>n/2)return combination (n,n-r); ll k=1; for(ll x=n,j=1;x>n-r||j<=r;--x,++j){ if(x>n-r)k*=x; if(j<=r)k/=j; } return k; } vector<ll> getFactor(ll n){ vector<ll> tmp; vector<ll> ans; if(n == 1)return vt<ll>{1}; else if(n==2) return vt<ll> {1,2}; for(ll i = 1;i<=ceil(sqrt(n));++i){ if(!(n%i)){ ans.pb(i); if(i!=n/i && abs(i-(n/i)) != 1)tmp.pb(n/i); } } for(ll i=tmp.size()-1;i>-1;--i){ ans.pb(tmp[i]); } return ans; } bool isPrime(ll n) {if(n == 1)return 0;for(ll i = 2;i*i <= n;++i){if(!(n%i))return 0;}return 1;} const int dx[4] = {0,0,-1,1}; const int dy[4] = {1,-1,0,0}; const char dir[4] = {'R', 'L', 'U', 'D'}; const int mod = 1e9+7; const int inf = 0x3f3f3f3f; const ll INF = 0x3f3f3f3f3f3f3f3f; void reverse(ll a[], ll result[]){ result = reverse(a , a + sizeof(a)/sizeof(ll)); } int main(){ fastio; #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif }

Compilation message (stderr)

reverse.cpp: In function 'void reverse(ll*, ll*)':
reverse.cpp:88:34: warning: 'sizeof' on array function parameter 'a' will return size of 'll*' {aka 'long long int*'} [-Wsizeof-array-argument]
   88 |  result = reverse(a , a + sizeof(a)/sizeof(ll));
      |                                 ~^~
reverse.cpp:87:17: note: declared here
   87 | void reverse(ll a[], ll result[]){
      |              ~~~^~~
reverse.cpp:88:18: error: void value not ignored as it ought to be
   88 |  result = reverse(a , a + sizeof(a)/sizeof(ll));
      |           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
reverse.cpp: In function 'int main()':
reverse.cpp:95:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   95 |  freopen("input.txt", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
reverse.cpp:96:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   96 |  freopen("output.txt", "w", stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~