-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgrader.cpp
41 lines (39 loc) · 855 Bytes
/
grader.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>
#include "problem.h"
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL);
string s;
getline(cin, s); // ignore first line, boilerplate
int n, _, m;
cin >> n >> _ >> m;
vector<int> u, v;
vector<double> w;
for(int i = 0; i < m; i++) {
int a, b;
double c;
cin >> a >> b >> c;
u.push_back(a);
v.push_back(b);
w.push_back(c);
}
cin >> n >> m;
vector<double> b;
for(int i = 0; i < n; i++) {
double t;
cin >> t;
b.push_back(t);
}
vector<double> ret = FindVoltages(n, u, v, w, b);
if(ret.size() != n) {
return 1;
}
for(double out: ret) {
cout << fixed << setprecision(16) << out << "\n";
}
return 0;
}