Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
80749 sh25_zhuwy 机器翻译 C++ Accepted 0 MS 264 KB 371 2026-01-04 15:29:54

Tests(10/10):


#include<bits/stdc++.h> using namespace std; int n, m; int a[1010]; int b[1010]; int ans; int l, r; int main(){ cin >> m >> n; for(int i = 1; i <= n; i++){ int x; cin >> x; if (!a[x]){ r++; b[r] = x; a[x] = 1; ans++; if (m < r){ l++; a[b[l]] = 0; } } } cout << ans; return 0; }


Judgement Protocol: