제출 #941093

#제출 시각아이디문제언어결과실행 시간메모리
941093PringSelf Study (JOI22_ho_t2)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #pragma GCC optimize("O3","unroll-loops") #pragma GCC target("avx2","popcnt") using namespace std; #ifdef MIKU #define debug(x...) cout << '[' << #x << "] : ", dout(x) void dout() { cout << endl; } template <typename T, typename ...U> void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); } #else #define debug(...) 39 #endif #define int long long #define fs first #define sc second #define mp make_pair #define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++) typedef pair<int, int> pii; const int MXN = 300005; int n, m, a[MXN], b[MXN]; void miku() { cin >> n >> m; FOR(i, 0, n) cin >> a[i]; FOR(i, 0, n) cin >> b[i]; FOR(i, 0, n) ans = min(ans, max(a[i], b[i])); cout << ans << '\n'; } int32_t main() { cin.tie(0) -> sync_with_stdio(false); cin.exceptions(cin.failbit); miku(); return 0; }

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

Main.cpp: In function 'void miku()':
Main.cpp:29:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |     FOR(i, 0, n) ans = min(ans, max(a[i], b[i]));
      |                  ^~~
      |                  abs
Main.cpp:30:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |     cout << ans << '\n';
      |             ^~~
      |             abs