diff options
author | Santo Cariotti <dcariotti24@gmail.com> | 2020-05-29 17:37:43 +0200 |
---|---|---|
committer | Santo Cariotti <dcariotti24@gmail.com> | 2020-05-29 17:37:43 +0200 |
commit | c1b13da17b2d20bdb9392f0e390df771772f0020 (patch) | |
tree | 20f266a590a4bb36738355f54fd48f4229b58b05 /I_anno/Programmazione_2/gita.cpp | |
parent | bc8b5b446a6a2d37bae82e7ad20e31e1439a2f0b (diff) |
chore: order in coding contest folder
Diffstat (limited to 'I_anno/Programmazione_2/gita.cpp')
-rw-r--r-- | I_anno/Programmazione_2/gita.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/I_anno/Programmazione_2/gita.cpp b/I_anno/Programmazione_2/gita.cpp deleted file mode 100644 index cbb4910..0000000 --- a/I_anno/Programmazione_2/gita.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include<iostream> -#include<fstream> -#include<vector> -#include<map> - -using namespace std; - -int main() { - ifstream in("input.txt"); - ofstream out("output.txt"); - - for(int c = 0; c < 100; ++c) { - int N, L; - in >> N >> L; - vector<pair<short, int>> students; - for(int i = 0; i < N; ++i) { - int num; - in >> num; - students.push_back({num, 0}); - } - - int index, val; - for(int i = 0; i < L; ++i) { - in >> index >> val; - students[index].second += val; - } - - vector<pair<short, int>> errors; - short _j{}; - for(auto const& i : students) { - if(i.second < i.first) { - errors.push_back({_j, i.first-i.second}); - } - _j++; - } - - out << errors.size() << ' '; - for(auto const& i : errors) { - out << i.first << ' ' << i.second << ' '; - } - out << endl; - } - out.close(); - in.close(); - return 0; -} |