QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#640807#1086. Bank Security UnificationMinche1992Compile Error//C++14938b2024-10-14 16:10:422024-10-14 16:10:42

Judging History

你现在查看的是最新测评结果

  • [2024-10-14 16:10:42]
  • 评测
  • [2024-10-14 16:10:42]
  • 提交

answer

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
ll N;
inline ll macs(ll a, ll b) {
    if (a > b) return a;
    return b;
}
int main() {
    // freopen("rose.in","r",stdin);
    // freopen("rose.out","w",stdout);
    ios_base::sync_with_stdio(0);z
	cin.tie(0), cout.tie(0);
    cin >> N;
    vector<ll> num;
    num.push_back(0);
    vector<ll> pos(50);
    ll tmp;
    for (ll i=1; i<=N; i++) {
        cin >> tmp;
        num.push_back(tmp);
    }
    ll ans = 0, mx = 0;
    vector<ll> dp(N+1, 0);
    dp[0] = dp[1] = 0;  
    for (ll i=1; i<=N; i++) {
        dp[i] = mx;
        for (ll j=0; j<=40; j++) {
            if (num[i]>>j & 1) {
                dp[i] = macs(dp[i], dp[pos[j]]+(num[i]&num[pos[j]]));
                pos[j] = i;
            }
        }
        ans = macs(dp[i], ans);
        mx = macs(dp[i], mx);
    }
    cout << ans;
    return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:13:34: error: ‘z’ was not declared in this scope
   13 |     ios_base::sync_with_stdio(0);z
      |                                  ^