Submission #844783

#TimeUsernameProblemLanguageResultExecution timeMemory
844783midiCave (IOI13_cave)C++14
0 / 100
174 ms548 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define vc vector typedef vc<ll> vcll; #define pr pair typedef pr<ll, ll> prll; #define f0r(i,a,n) for (i=a; i<n; i++) #define f1r(i,a,n) for (i=a; i<=n; i++) #define r0f(i,n,a) for (i=n; i>a; i--) #define r1f(i,n,a) for (i=n; i>=a; i--) #define pb push_back #define mp make_pair #define INF (LLONG_MAX>>4ll) #define mxN 5010ll ll n; int bar[mxN]; int gar[mxN]; int perm[mxN]; void exploreCave(int N) { n=N; ll i2; f0r(i2,0,n) { bar[i2]=0; perm[i2]=-1; gar[i2]-1; } f0r(i2,0,n) { ll i = tryCombination(bar); ll j; ll l=0, r=n-1; // both incl. while (l<r) { ll m; if (l+1==r) m=l; else m = (l+r)/2; ll i3; f1r(i3, l, m) if (gar[i3]!=-1) bar[i3]!=bar[i3]; j = tryCombination(bar); if (j<i) { i=j; r=m; } else if (j==i) { l=m+1; } else { f1r(i3, l, m) if (gar[i3]!=-1) bar[i3]!=bar[i3]; l=m+1; } } gar[l]=bar[l]; perm[l]=i; } // f0r(i,0,n) printf("gar[%lli]: %lli, perm[%lli]: %lli\n", i, gar[i], i, perm[i]); answer(gar, perm); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:37:10: warning: statement has no effect [-Wunused-value]
   37 |   gar[i2]-1;
      |   ~~~~~~~^~
cave.cpp:52:42: warning: self-comparison always evaluates to false [-Wtautological-compare]
   52 |    f1r(i3, l, m) if (gar[i3]!=-1) bar[i3]!=bar[i3];
      |                                   ~~~~~~~^~~~~~~~~
cave.cpp:52:42: warning: statement has no effect [-Wunused-value]
   52 |    f1r(i3, l, m) if (gar[i3]!=-1) bar[i3]!=bar[i3];
      |                                   ~~~~~~~^~~~~~~~~
cave.cpp:67:43: warning: self-comparison always evaluates to false [-Wtautological-compare]
   67 |     f1r(i3, l, m) if (gar[i3]!=-1) bar[i3]!=bar[i3];
      |                                    ~~~~~~~^~~~~~~~~
cave.cpp:67:43: warning: statement has no effect [-Wunused-value]
   67 |     f1r(i3, l, m) if (gar[i3]!=-1) bar[i3]!=bar[i3];
      |                                    ~~~~~~~^~~~~~~~~
#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...