제출 #1136826

#제출 시각아이디문제언어결과실행 시간메모리
1136826uranhishigInfinite Race (EGOI24_infiniterace2)C++20
0 / 100
74 ms14404 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(a) (a).begin(),(a).end()
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
const int mod = 1000000007;

signed main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n, q;
	cin >> n >> q;
	vector<int> a(q);
	map<int, int> mp;
	for(int i = 0; i < q; i++) {
		cin >> a[i];
		int x = a[i];
		if(a[i] < 0) {
			mp[x]--;
		}
		else {
			mp[x]++;
		}
	}
	int ans = 0;
	for(int i = 1; i < n; i++) {
		ans = max(ans, mp[i]);
	}
	int z=0;
	cout << max(z, ans-1);
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...