Submission #550757

#TimeUsernameProblemLanguageResultExecution timeMemory
550757tht2005Financial Report (JOI21_financial)C++17
5 / 100
139 ms5572 KiB
#include <bits/stdc++.h> using namespace std; const int N = 300005; int n, d, m, a[N], v[N]; int main() { scanf("%d %d", &n, &d); for(int i = 0; i < n; ++i) { scanf("%d", a + i); v[i] = a[i]; } sort(v, v + n); m = unique(v, v + n) - v; for(int i = 0; i < n; ++i) { a[i] = lower_bound(v, v + m, a[i]) - v; } for(int i = 0; i < n; ++i) { v[i] = 2e9; } int res = 0; for(int i = 0; i < n; ++i) { int k = lower_bound(v, v + n, a[i]) - v; v[k] = a[i]; res = max(res, k + 1); } printf("%d", res); return 0; }

Compilation message (stderr)

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