| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1234916 | p4r4d0_x | Infinite Race (EGOI24_infiniterace2) | C++20 | 7 ms | 3400 KiB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
void solve(){
ll n, x, q; cin >> n >> q;
map<ll, ll> m;
ll ans = 0;
vector<ll> a(q);
for(int i = 0; i < q; ++i){
cin >> a[i];
}
m[a[0]]++;
a.pb(-1);
for(int i = 1; i <= q; ++i){
if(a[i] != a[i - 1]){
ans += m[a[i - 1]] - 1;
m[a[i - 1]] = 0;
}
m[a[i]]++;
}
cout << ans << "\n";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
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... | ||||
