| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1322704 | Johan | Infinite Race (EGOI24_infiniterace2) | C++20 | 77 ms | 22192 KiB |
#include <bits/stdc++.h>
using namespace std;
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, q;
cin >> n >> q;
map < int , vector < int > > adj;
while(q--){
int x;
cin >> x;
adj[abs(x)].push_back(x);
}
int mx = 0;
for(int i = 1; i <= n; i++){
int cnt = 0, ans = 0;
vector < int > v = adj[i];
for(int i = 0; i < v.size(); i++){
if(v[i] < 0){
ans += max(cnt - 1, 0);
cnt = 0;
}
else {
cnt++;
}
}
ans += max(cnt - 1, 0);
mx = max(mx, ans);
}
cout << mx << "\n";
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
