|
@@ -0,0 +1,55 @@
|
|
|
+#include <iostream>
|
|
|
+#include <vector>
|
|
|
+
|
|
|
+using namespace std;
|
|
|
+
|
|
|
+struct Grade {
|
|
|
+ string Id;
|
|
|
+ int Score;
|
|
|
+};
|
|
|
+
|
|
|
+int main() {
|
|
|
+ int N = 0, M = 0, G = 0;
|
|
|
+ int *questions;
|
|
|
+
|
|
|
+ while (cin >> N && N) {
|
|
|
+ cin >> M >> G;
|
|
|
+
|
|
|
+ questions = new int[M];
|
|
|
+ vector<Grade> grade;
|
|
|
+
|
|
|
+ // input question scoreIndex
|
|
|
+ for (int i = 0; i < M; i++) {
|
|
|
+ cin >> questions[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ int answer;
|
|
|
+ int total, scoreIndex;
|
|
|
+ string id;
|
|
|
+ for (int i = 0; i < N; i++) {
|
|
|
+ answer = 0;
|
|
|
+ total = 0, scoreIndex = 0;
|
|
|
+ cin >> id;
|
|
|
+ cin >> answer;
|
|
|
+ answer = answer > M ? M : answer;
|
|
|
+ for (int j = 0; j < answer; j++) {
|
|
|
+ cin >> scoreIndex;
|
|
|
+ total += questions[scoreIndex];
|
|
|
+ }
|
|
|
+ if (total < G) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Grade tempGrade = {id, total};
|
|
|
+ grade.push_back(tempGrade);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < (grade.size()); i++) {
|
|
|
+ cout << "id: " << grade.at(i).Id << "; scoreIndex: " << grade.at(i).Score << endl;
|
|
|
+ }
|
|
|
+
|
|
|
+ // free
|
|
|
+ free(questions);
|
|
|
+ grade.clear();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|