Submission #463508

#TimeUsernameProblemLanguageResultExecution timeMemory
463508QuentolosseExam (eJOI20_exam)C++14
12 / 100
56 ms908 KiB
//sous-tache 2 #include <iostream> #include <vector> using namespace std; int main () { int nbCandidats, objectif, entree, total = 0, candidatDansIntervalle = 0, candidatsDansIntervalle = 0; vector<int> candidats; cin >> nbCandidats; for (int i = 0; i < nbCandidats; i++) { cin >> entree; candidats.push_back(entree); } cin >> objectif; for (int i = 0; i < nbCandidats; i++) { if (candidats[i] == objectif) { candidatDansIntervalle = 1; candidatsDansIntervalle ++; } else if (candidats[i] < objectif) { candidatsDansIntervalle ++; } else { total += candidatsDansIntervalle * candidatDansIntervalle; candidatsDansIntervalle = 0; candidatDansIntervalle = 0; } } total += candidatsDansIntervalle * candidatDansIntervalle; candidatsDansIntervalle = 0; candidatDansIntervalle = 0; cout << total; return 0; }
#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...