제출 #1124472

#제출 시각아이디문제언어결과실행 시간메모리
1124472dosts서열 (APIO23_sequence)C++17
11 / 100
2095 ms4164 KiB
#include "sequence.h" //Dost SEFEROĞLU #include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define ff first #define ss second #define sp << " " << #define all(cont) cont.begin(),cont.end() #define vi vector<int> int32_t sequence(int32_t N, std::vector<int32_t> A) { int ans = 0; for (int i=0;i<N;i++) { for (int j = i;j<N;j++) { for (int k = i;k<=j;k++) { int b = 0,s = 0,o = 0; for (int kk = i;kk<=j;kk++) { if (A[kk] < A[k]) s++; else if (A[kk] > A[k]) b++; else o++; } if (abs(b-s) <= o) ans = max(ans,o); } } } 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...