Submission #846969

#TimeUsernameProblemLanguageResultExecution timeMemory
846969SUNWOOOOOOOOFinancial Report (JOI21_financial)C++17
5 / 100
46 ms4432 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = 300005; int n, d, A[mxN], lis[mxN]; int main() { scanf("%d %d", &n, &d); for (int i = 1; i <= n; i++) scanf("%d", &A[i]); int ans = 0; lis[ans] = -1; for (int i = 1; i <= n; i++){ if (A[i] > lis[ans]) lis[++ans] = A[i]; else { int idx = lower_bound(lis, lis + ans, A[i]) - lis; lis[idx] = A[i]; } } printf("%d\n", ans); return 0; }

Compilation message (stderr)

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