제출 #844781

#제출 시각아이디문제언어결과실행 시간메모리
844781midi동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 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; f0r(i,0,n) { bar[i]=0; perm[i]=-1; gar[i]-1; } ll i2; 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); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:31:6: error: 'i' was not declared in this scope
   31 |  f0r(i,0,n)
      |      ^
cave.cpp:11:25: note: in definition of macro 'f0r'
   11 | #define f0r(i,a,n) for (i=a; i<n; i++)
      |                         ^
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];
      |                                    ~~~~~~~^~~~~~~~~