제출 #982102

#제출 시각아이디문제언어결과실행 시간메모리
982102vjudge1서열 (APIO23_sequence)C++17
0 / 100
42 ms7516 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_mset; int sequence(int n, vector <int> a){ bool sp = 1; int ans = 0; if(sp){ //unos y tres int current = 0, sup = 0, dos = 0; for(int i=0; i<n; i++){ if(a[i] == 1){ if(current+1>=0) { current++; sup++; } else { current=1; sup = 1; } } else current--; ans = max(sup, ans); } sup = current = 0; for(int i=0; i<n; i++){ if(a[i] == 3){ if(current+1>=0) { current++; sup++; } else { current=1; sup = 1; } } else current--; ans = max(sup, ans); } for(int i=0; i<n; i++) if(a[i] == 2) dos++; return max(dos, ans); } }

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

sequence.cpp: In function 'int sequence(int, std::vector<int>)':
sequence.cpp:58:1: warning: control reaches end of non-void function [-Wreturn-type]
   58 | }
      | ^
#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...