3211 Codeforces Round #321 (Div. 2) Contest Problems / Contest Standing A. Kefa and First Stepsn개의 숫자가 주어졌을 때, maximum non-decreasing subsegment를 찾는 게 문제이다.어떤 수열의 subsegment는 연속한 부분수열을 의미한다. 차례대로 수열의 원소들을 보면서, 새 원소가 이전의 원소보다 더 크다면 이전 원소의 maximum non-decreasing subsegment에 1을 더하여 답에 갱신하고, 아니면 현재의 maximum non-decreasing subsegment을 길이 1로 만들어 계속 진행해 나가는 방법으로 풀린다. O(n)에 풀 수 있다.#include int n, res, cnt, a[100005], bf; int main() { scan.. 2015. 9. 27. 이전 1 다음