summaryrefslogtreecommitdiff
path: root/1_anno/Programmazione_2/coding_contest/gita.cpp
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-02-06 19:56:36 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-02-06 19:56:36 +0100
commitd2edbc38cac8da52f58c5cd3da6c0c625fa05736 (patch)
treea51e9a4e56fc9d4c7c9e37576dceedca3a0c72b4 /1_anno/Programmazione_2/coding_contest/gita.cpp
parent98f34040820dc3a964b7be59a698323e8cc6c8a3 (diff)
conf: rename
Diffstat (limited to '1_anno/Programmazione_2/coding_contest/gita.cpp')
-rw-r--r--1_anno/Programmazione_2/coding_contest/gita.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/1_anno/Programmazione_2/coding_contest/gita.cpp b/1_anno/Programmazione_2/coding_contest/gita.cpp
deleted file mode 100644
index cbb4910..0000000
--- a/1_anno/Programmazione_2/coding_contest/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;
-}