Submission #420643

#TimeUsernameProblemLanguageResultExecution timeMemory
420643schseFinancial Report (JOI21_financial)C++17
0 / 100
4088 ms3788 KiB
#include <bits/stdc++.h> #define INF INT32_MAX using namespace std; int main() { vector<int> arr; int N, D; cin >> N >> D; vector<int> biggest(N + 2, INF); vector<int> lastindex(N + 2, -1); arr.resize(N); for (int &i : arr) cin >> i; for (int index = 0; index < N; index++) { int val = arr[index]; for (int i = 1; i < lastindex.size(); i++) // nicht mehr aktuelles löschen if (lastindex[i] < index - D) biggest[i] = INF; for (int i = 0; i < biggest.size() - 1; i++) // neue längenoption if (biggest[i] < val && val < biggest[i + 1]) biggest[i + 1] = val; for (int e = 0; e < biggest.size(); e++) // ablaufsdatum updaten if (biggest[e] >= val) lastindex[e] = index; } int t = biggest.size() - 1; while (biggest[t] == INF) t--; cout << t; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:19:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         for (int i = 1; i < lastindex.size(); i++) // nicht mehr aktuelles löschen
      |                         ~~^~~~~~~~~~~~~~~~~~
Main.cpp:23:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         for (int i = 0; i < biggest.size() - 1; i++) // neue längenoption
      |                         ~~^~~~~~~~~~~~~~~~~~~~
Main.cpp:27:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |         for (int e = 0; e < biggest.size(); e++) // ablaufsdatum updaten
      |                         ~~^~~~~~~~~~~~~~~~
#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...