제출 #901307

#제출 시각아이디문제언어결과실행 시간메모리
901307tkm_algorithms서열 (APIO23_sequence)C++17
0 / 100
2097 ms9384 KiB
#include <bits/stdc++.h> using namespace std; int sequence(int n, vector<int> a) { int ans = 0; for (int i = 0; i < n; ++i) { multiset<int> x; for (int j = i; j < n; ++j) { x.insert(a[j]); int cnt = 0; int a = (i - j) >> 1; int b = (i - j + 1) >> 1; int c1 = 0, c2 = 0; for (auto k: x) { if (cnt == a) c1 = k; if (cnt == b) { c2 = k; break; } ++cnt; } if (x.count(c1) > ans) ans = x.count(c1); if (x.count(c2) > ans) ans = x.count(c2); } } return ans; }

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

sequence.cpp: In function 'int sequence(int, std::vector<int>)':
sequence.cpp:24:29: warning: comparison of integer expressions of different signedness: 'std::multiset<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   24 |             if (x.count(c1) > ans)
      |                 ~~~~~~~~~~~~^~~~~
sequence.cpp:26:29: warning: comparison of integer expressions of different signedness: 'std::multiset<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   26 |             if (x.count(c2) > ans)
      |                 ~~~~~~~~~~~~^~~~~
#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...