제출 #985400

#제출 시각아이디문제언어결과실행 시간메모리
985400ag_1204서열 (APIO23_sequence)C++17
0 / 100
2035 ms8368 KiB
#include<bits/stdc++.h> using namespace std; #define long long int int sequence(int N, std::vector<int> A) { int ans=0; for (int i=0;i<N;i++) { vector<int> v; multiset<int> s; for (int j=i;j<N;j++) { v.push_back(A[j]); s.insert(A[j]); sort(v.begin(),v.end()); int m=size(v); int k = m/2; if (m%2==0) { int s1=v[k], s2=v[k-1]; int t=max(s.count(s1),s.count(s2)); ans = max(k,ans); } else { int s1=v[k]; int r=s.count(s1); ans = max(r,ans); } } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

sequence.cpp: In function 'int sequence(int, std::vector<int>)':
sequence.cpp:18:21: warning: unused variable 't' [-Wunused-variable]
   18 |                 int t=max(s.count(s1),s.count(s2));
      |                     ^
#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...