Submission #1122958

#TimeUsernameProblemLanguageResultExecution timeMemory
1122958marinalucaHyper-minimum (IZhO11_hyper)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> /** #pragma GCC optimize ("O3") #pragma GCC optimize ("fast-math") #pragma GCC optimize ("unroll-loops") **/ #define f (i, n) for (int i = 0; i < n; i ++) using namespace std; /** //#define int long long #define ll long long #define all (x) begin(x), end (x) #define xx first #define yy second using pii = pair <int, int>; using tii = tuple <int, int, int>; **/ int n, m; constexpr int NMAX = (int) 30; int dp[NMAX + 1][NMAX + 1][NMAX + 1][NMAX + 1]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m; f(i, n) f(i1, n) f(i2, n) f(i3, n) cin >> dp[i][i1][i2][i3]; f(i, n) f(i1, n) f(i2, n) f(i3, n - m + 1) f(X, m) dp[i][i1][i2][i3] = min(dp[i][i1][i2][i3], dp[i][i1][i2][i3 + X]); f(i, n) f(i1, n) f(i2, n - m + 1) f(i3, n) f(X, m) dp[i][i1][i2][i3] = min(dp[i][i1][i2][i3], dp[i][i1][i2 + X][i3]); f(i, n) f(i1, n - m + 1) f(i2, n) f(i3, n) f(X, m) dp[i][i1][i2][i3] = min(dp[i][i1][i2][i3], dp[i][i1 + X][i2][i3]); f(i, n - m + 1) f(i1, n) f(i2, n) f(i3, n) f(X, m) dp[i][i1][i2][i3] = min(dp[i][i1][i2][i3], dp[i + X][i1][i2][i3]); f(i, n - m + 1) f(i1, n - m + 1) f(i2, n - m + 1) f(i3, n - m + 1) cout << dp[i][i1][i2][i3] << ' '; cout << '\n'; return 0 ^ 0; }

Compilation message (stderr)

hyper.cpp: In function 'int main()':
hyper.cpp:7:12: error: 'i' was not declared in this scope
    7 | #define f (i, n) for (int i = 0; i < n; i ++)
      |            ^
hyper.cpp:30:4: note: in expansion of macro 'f'
   30 |    f(i, n) f(i1, n) f(i2, n) f(i3, n) cin >> dp[i][i1][i2][i3];
      |    ^