Submission #116207

#TimeUsernameProblemLanguageResultExecution timeMemory
116207ArturgoStove (JOI18_stove)C++14
100 / 100
51 ms1920 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> decs; int main() { ios_base::sync_with_stdio(false); int nbInvites, nbTours; cin >> nbInvites >> nbTours; int derTemps = 0; for(int iInvite = 0;iInvite < nbInvites;iInvite++) { int temps; cin >> temps; if(iInvite != 0) decs.push_back(temps - derTemps - 1); derTemps = temps; } sort(decs.begin(), decs.end()); int sommeDecs = nbInvites; for(int iTour = 0;iTour < nbInvites - nbTours;iTour++) { sommeDecs += decs[iTour]; } cout << sommeDecs << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...