제출 #982220

#제출 시각아이디문제언어결과실행 시간메모리
982220vjudge1서열 (APIO23_sequence)C++17
11 / 100
2065 ms54612 KiB
#include "sequence.h" #include<bits/extc++.h> #include<bits/stdc++.h> using namespace std; using namespace __gnu_pbds; tree<int,null_type,less_equal<>,rb_tree_tag,tree_order_statistics_node_update> st; multiset<int>st2; int sequence(int N, std::vector<int> A) { int ans=0; for(int i=0;i<N;i++){ st.clear(); st2.clear(); for(int j=i;j<N;j++) { st.insert(A[j]); st2.insert(A[j]); int A=*st.find_by_order(j-i>>1); int B=*st.find_by_order(j-i+1>>1); ans=max(ans,(int)st2.count(A)); ans=max(ans,(int)st2.count(B)); } } return ans; }

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

sequence.cpp: In function 'int sequence(int, std::vector<int>)':
sequence.cpp:16:38: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   16 |             int A=*st.find_by_order(j-i>>1);
      |                                     ~^~
sequence.cpp:17:40: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   17 |             int B=*st.find_by_order(j-i+1>>1);
      |                                     ~~~^~
#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...