| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1178513 | Moonn | Infinite Race (EGOI24_infiniterace2) | C++20 | 9 ms | 1864 KiB |
#pragma GCC optimize("O3")//thanks SIGMA :)
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define AI ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const ll sz=1e6+4;
void solve()
{
ll n,q,x,ma=0,i;
cin>>n>>q;
ll sa[n+1]={0};
for(i=0;i<q;i++)
{
cin>>x;
if(x>0)
{
sa[x]++;
ma=max(ma,sa[x]-1);
}
else
{
x=abs(x);
if(sa[x])
sa[x]--;
}
}
cout<<ma<<endl;
}
int main()
{
AI
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
ll t;
t=1;
while(t--)
solve();
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
