제출 #957779

#제출 시각아이디문제언어결과실행 시간메모리
957779ALTAKEXE서열 (APIO23_sequence)C++17
11 / 100
2079 ms4188 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) { ll ans = 0; for (ll i = 0; i < A.size(); i++) { ll s = 0, c = 0; for (ll j = i; j >= 0; 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:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   for (ll 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...