제출 #1000004

#제출 시각아이디문제언어결과실행 시간메모리
1000004daffuwuGlobal Warming (CEOI18_glo)C++14
28 / 100
2074 ms3020 KiB
#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

int n, x, t[200069], ans;
vector<int> lis; 

int main() 
{
    int i, j;
    scanf("%d%d", &n, &x);
    for (i=1; i<=n; i++) scanf("%d", t+i);
    for (i=0; i<=n; i++)
    {
        t[i] -= x;
        for (j=1; j<=n; j++)
        {
            auto it = lower_bound(lis.begin(), lis.end(), t[j]);
            if (it == lis.end()) lis.push_back(t[j]);
            else *it = t[j];
        }
        ans = max(ans, (int)lis.size());
        lis.clear();
    }
    printf("%d\n", ans);
}

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

glo.cpp: In function 'int main()':
glo.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     scanf("%d%d", &n, &x);
      |     ~~~~~^~~~~~~~~~~~~~~~
glo.cpp:14:31: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     for (i=1; i<=n; i++) scanf("%d", t+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...