Submission #545267

#TimeUsernameProblemLanguageResultExecution timeMemory
545267Ai7081Money (IZhO17_money)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1000005; const int inf = 1e9; int n, a, out, now=inf, nxt; multiset<int> s; int main() { scanf(" %d", &n); while (n--) { scanf(" %d", &a); if (a < now || a > nxt) out++; auto it = s.insert(a); it++; nxt = (it == s.end()) ? inf : *it; now = a; } printf("%d", out); return 0; }

Compilation message (stderr)

money.cpp: In function 'int main()':
money.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf(" %d", &n);
      |     ~~~~~^~~~~~~~~~~
money.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf(" %d", &a);
      |         ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...