제출 #957777

#제출 시각아이디문제언어결과실행 시간메모리
957777ALTAKEXE서열 (APIO23_sequence)C++17
11 / 100
2063 ms7508 KiB
#include <bits/stdc++.h> #define ll long long #define f first #define s second using namespace std; int sequence(int N, std::vector<int> A) { int ans = 0; for (int i = 0; i < A.size(); i++) { int s = 0, c = 0; for (int j = i; j > -1; j--) { if (A[i] == A[j]) c++; if (A[i] > A[j]) s--; if (A[i] < A[j]) s++; if (abs(s) <= c) ans = max(ans, c); } } return ans; }

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

sequence.cpp: In function 'int sequence(int, std::vector<int>)':
sequence.cpp:9:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   for (int i = 0; i < A.size(); i++)
      |                   ~~^~~~~~~~~~
#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...