Submission #776976

#TimeUsernameProblemLanguageResultExecution timeMemory
776976Dan4LifeSequence (APIO23_sequence)C++17
0 / 100
40 ms4184 KiB
#include "sequence.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; template<class T> using Tree = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>; #define sz(a) (int)a.size() #define fi first #define se second Tree<pair<int,int>> S; map<int,int> tot; int n; int sequence(int N, vector<int> a) { n = N; int ans = 1; for(int i = 0; i < n; i++){ int j = i; while(i<n-1 and a[i]==a[i+1]) i++; ans = max(ans, i-j+1); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...