Submission #155313

#TimeUsernameProblemLanguageResultExecution timeMemory
155313jhnah917Languages (IOI10_languages)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "lang.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int n = 100, m = 56; /* map<ll, int> cnt[56]; map<ll, int> cnt2[56]; map<ll, int> cnt3[56]; */ map<ll, int> cnt4[56]; ll f(ll a, ll b){ return (a << 16) | b; } ll f(ll a, ll b, ll c){ return (a << 32) | (b << 16) | c; } ll f(ll a, ll b, ll c, ll d){ return (a << 48) | (b << 32) | (c << 16) | d; } void excerpt(int *arr){ int mx = 0, idx = 0; for(int i=0; i<m; i++){ int now = 0; for(int j=0; j<n; j++){ /* now += cnt[i][arr[j]]; if(j == n-1) continue; now += cnt[i][f(arr[j], arr[j+1])]; if(j == n-2) continue; now += cnt[i][f(arr[j], arr[j+1], arr[j+2])]; */ if(j == n-3) continue; now += cnt[i][f(arr[j], arr[j+1], arr[j+2], arr[j+3])]; } if(now > mx){ mx = now; idx = i; } } int ans = language(idx); for(int i=0; i<n; i++){ /* cnt[ans][arr[i]] = 1; if(i == n-1) continue; cnt[ans][f(arr[i], arr[i+1])] = 1; if(i == n-2) continue; cnt[ans][f(arr[i], arr[i+1], arr[i+2])] = 1; */ if(i == n-3) continue; cnt[ans][f(arr[i], arr[i+1], arr[i+2], arr[i+3])] = 1; } }

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:41:11: error: 'cnt' was not declared in this scope
    now += cnt[i][f(arr[j], arr[j+1], arr[j+2], arr[j+3])];
           ^~~
lang.cpp:41:11: note: suggested alternative: 'cnt4'
    now += cnt[i][f(arr[j], arr[j+1], arr[j+2], arr[j+3])];
           ^~~
           cnt4
lang.cpp:58:3: error: 'cnt' was not declared in this scope
   cnt[ans][f(arr[i], arr[i+1], arr[i+2], arr[i+3])] = 1;
   ^~~
lang.cpp:58:3: note: suggested alternative: 'cnt4'
   cnt[ans][f(arr[i], arr[i+1], arr[i+2], arr[i+3])] = 1;
   ^~~
   cnt4