제출 #1191221

#제출 시각아이디문제언어결과실행 시간메모리
1191221TsaganaBali Sculptures (APIO15_sculpture)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie(); #define all(x) x.begin(), x.end() #define int long long #define pq priority_queue #define eb emplace_back #define lb lower_bound #define ub upper_bound #define pb push_back #define pp pop_back #define F first #define S second using namespace std; void solve () { int n, s, e; cin >> n >> s >> e; int a[n + 1]; for (int i = 1; i <= n; i++) cin >> a[i]; int ans = (1LL << 41) - 1; int l[n + 1], r[n + 1]; l[0] = r[0] = 0; for (int k = 40; k >= 0; k--) { ans ^= 1LL << k; for (int i = 1; i <= n; i++) { l[i] = INT_MAX, r[i] = INT_MIN; int s = 0; for (int j = i-1; j >= 0; j--) { s += a[j + 1]; if ((s & ans) == s) { l[i] = min(l[i], l[j] + 1); r[i] = max(r[i], r[j] + 1); } } } if (!(s <= r[n] &x& l[n] <= e)) ans ^= 1LL << k; } cout << ans << '\n'; } signed main() {IOS solve(); return 0;}

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

sculpture.cpp: In function 'void solve()':
sculpture.cpp:37:34: error: 'x' was not declared in this scope
   37 |                 if (!(s <= r[n] &x& l[n] <= e)) ans ^= 1LL << k;
      |                                  ^