Task: | Graph |
Sender: | MojoLake |
Submission time: | 2023-04-20 17:50:29 +0300 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 5 |
#2 | ACCEPTED | 12 |
#3 | ACCEPTED | 17 |
#4 | ACCEPTED | 24 |
#5 | ACCEPTED | 42 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#2 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#3 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#4 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#5 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#6 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#7 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#8 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#9 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#10 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#11 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#12 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#13 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#14 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#15 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#16 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#17 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#18 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#19 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#20 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#21 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#22 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#23 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
#24 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#25 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#26 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#27 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#28 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#29 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#30 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#31 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#32 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#33 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#34 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#35 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#36 | ACCEPTED | 0.01 s | 2, 3, 4, 5 | details |
#37 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#38 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#39 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#40 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#41 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#42 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#43 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#44 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#45 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#46 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#47 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#48 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#49 | ACCEPTED | 0.02 s | 4, 5 | details |
#50 | ACCEPTED | 0.02 s | 4, 5 | details |
#51 | ACCEPTED | 0.02 s | 4, 5 | details |
#52 | ACCEPTED | 0.02 s | 4, 5 | details |
#53 | ACCEPTED | 0.01 s | 4, 5 | details |
#54 | ACCEPTED | 0.01 s | 4, 5 | details |
#55 | ACCEPTED | 0.01 s | 4, 5 | details |
#56 | ACCEPTED | 0.02 s | 4, 5 | details |
#57 | ACCEPTED | 0.02 s | 4, 5 | details |
#58 | ACCEPTED | 0.02 s | 4, 5 | details |
#59 | ACCEPTED | 0.02 s | 4, 5 | details |
#60 | ACCEPTED | 0.02 s | 4, 5 | details |
#61 | ACCEPTED | 0.01 s | 4, 5 | details |
#62 | ACCEPTED | 0.17 s | 4, 5 | details |
#63 | ACCEPTED | 0.17 s | 4, 5 | details |
#64 | ACCEPTED | 0.17 s | 4, 5 | details |
#65 | ACCEPTED | 0.17 s | 4, 5 | details |
#66 | ACCEPTED | 0.01 s | 4, 5 | details |
#67 | ACCEPTED | 0.16 s | 5 | details |
#68 | ACCEPTED | 0.14 s | 5 | details |
#69 | ACCEPTED | 0.14 s | 5 | details |
#70 | ACCEPTED | 0.24 s | 5 | details |
#71 | ACCEPTED | 0.14 s | 5 | details |
#72 | ACCEPTED | 0.17 s | 5 | details |
#73 | ACCEPTED | 0.16 s | 5 | details |
#74 | ACCEPTED | 0.11 s | 5 | details |
#75 | ACCEPTED | 0.08 s | 5 | details |
#76 | ACCEPTED | 0.02 s | 5 | details |
#77 | ACCEPTED | 0.04 s | 5 | details |
#78 | ACCEPTED | 0.07 s | 5 | details |
#79 | ACCEPTED | 0.14 s | 5 | details |
#80 | ACCEPTED | 0.12 s | 5 | details |
#81 | ACCEPTED | 0.12 s | 5 | details |
#82 | ACCEPTED | 0.18 s | 5 | details |
#83 | ACCEPTED | 0.20 s | 5 | details |
#84 | ACCEPTED | 0.20 s | 5 | details |
#85 | ACCEPTED | 0.16 s | 5 | details |
#86 | ACCEPTED | 0.15 s | 5 | details |
#87 | ACCEPTED | 0.14 s | 5 | details |
#88 | ACCEPTED | 0.20 s | 5 | details |
#89 | ACCEPTED | 0.16 s | 5 | details |
#90 | ACCEPTED | 0.16 s | 5 | details |
#91 | ACCEPTED | 0.17 s | 5 | details |
#92 | ACCEPTED | 0.08 s | 5 | details |
#93 | ACCEPTED | 0.08 s | 5 | details |
#94 | ACCEPTED | 0.15 s | 5 | details |
#95 | ACCEPTED | 0.13 s | 5 | details |
#96 | ACCEPTED | 0.30 s | 5 | details |
#97 | ACCEPTED | 0.11 s | 5 | details |
Code
#include <bits/stdc++.h> #define debug(x) cout << #x << ": " << "\n" #define all(x) x.begin(), x.end() using namespace std; const int N = 1e5 + 100; const int inf = 1e9; vector<pair<int, int>> g[N]; double ans[N]; int comp[N], siz[N]; vector<int> nodes[N]; int ss[N]; bool vis[N]; int value[N]; bool minuss[N]; void dfs(int cur, int cc, int pre){ comp[cur] = cc; nodes[cc].push_back(cur); vis[cur] = 1; ss[cur] = 1; for(auto [nex, c] : g[cur]){ if(vis[nex])continue; dfs(nex, cc, cur); ss[cur] += ss[nex]; } } void solve_component(int c){ if(nodes[c].empty())return; queue<int> q; q.push(*nodes[c].begin()); vis[*nodes[c].begin()] = 1; // assert((int)nodes[c].size() == siz[c]); bool forced = 0; double delta = 0; while(!q.empty()){ int cur = q.front(); q.pop(); for(auto [nex, col] : g[cur]){ if(!vis[nex]){ if(!minuss[cur])minuss[nex] = 1; value[nex] = col - value[cur]; q.push(nex); } if(vis[nex] && (minuss[cur] == minuss[nex])){ forced = 1; int mul = minuss[cur] ? -1 : 1; delta = mul * (col - (value[cur] + value[nex])) / 2; } vis[nex] = 1; } } if(!forced){ vector<int> find_med; for(int cur : nodes[c]){ int mul = minuss[cur] ? 1 : -1; find_med.push_back(mul * value[cur]); } sort(all(find_med)); delta = find_med[siz[c] / 2]; // should be optimal } for(int cur : nodes[c]){ int mul = minuss[cur] ? -1 : 1; ans[cur] = mul * delta + value[cur]; } for(int cur : nodes[c]){ for(auto [nex, col] : g[cur]){ // cout << cur << " " << nex << " " << col << "\n"; // cout << (double)ans[nex] + ans[cur] - (double)col << "\n"; if(ans[nex] + ans[cur] != col){ // cout << nex << " " << cur << "\n"; // cout << ans[nex] << " " << ans[cur] << " " << col << "\n"; cout << "NO\n"; exit(0); } } } } int main(){ int n, m; cin >> n >> m; for(int _ = 0; _ < m; ++_){ int a, b, c; cin >> a >> b >> c; g[a].push_back({b, 2 * c}); g[b].push_back({a, 2 * c}); } int cc = 1; for(int i = 1; i <= n; ++i){ if(!vis[i]){ dfs(i, cc, 0); siz[cc] = ss[i]; cc++; } } for(int i = 1; i <= n; ++i){ vis[i] = 0; } for(int i = 1; i < cc; ++i){ solve_component(i); } cout << "YES\n"; cout << fixed << setprecision(1); for(int i = 1; i <= n; ++i){ cout << 0.5 * ans[i] << " "; } cout << "\n"; }
Test details
Test 1
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
4 4 1 2 1 2 3 2 1 3 2 3 4 1 |
correct output |
---|
YES 0.5 0.5 1.5 -0.5 |
user output |
---|
YES 0.5 0.5 1.5 -0.5 |
Test 2
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
2 1 1 2 1 |
correct output |
---|
YES 1 0 |
user output |
---|
YES 1.0 0.0 |
Test 3
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
3 2 1 2 2 2 3 2 |
correct output |
---|
YES 0 2 0 |
user output |
---|
YES 0.0 2.0 0.0 |
Test 4
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
3 4 1 2 2 2 2 1 2 1 1 1 2 2 |
correct output |
---|
NO |
user output |
---|
NO |
Test 5
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
5 2 1 2 1 5 3 2 |
correct output |
---|
YES 1 0 2 0 0 |
user output |
---|
YES 1.0 0.0 2.0 0.0 0.0 |
Test 6
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
3 2 2 1 2 3 2 1 |
correct output |
---|
YES 1 1 0 |
user output |
---|
YES 1.0 1.0 0.0 |
Test 7
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
3 3 1 2 1 1 3 1 3 2 1 |
correct output |
---|
YES 0.5 0.5 0.5 |
user output |
---|
YES 0.5 0.5 0.5 |
Test 8
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
4 4 1 4 2 3 2 1 2 1 2 3 4 1 |
correct output |
---|
YES 2 0 1 0 |
user output |
---|
YES 2.0 0.0 1.0 0.0 |
Test 9
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
4 4 1 4 2 1 2 1 3 4 1 3 2 1 |
correct output |
---|
NO |
user output |
---|
NO |
Test 10
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
4 5 1 4 2 3 2 1 2 1 2 3 4 1 ... |
correct output |
---|
YES 1.5 0.5 0.5 0.5 |
user output |
---|
YES 1.5 0.5 0.5 0.5 |
Test 11
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
4 5 1 4 2 3 2 1 1 2 2 4 3 1 ... |
correct output |
---|
YES 1.5 0.5 0.5 0.5 |
user output |
---|
YES 1.5 0.5 0.5 0.5 |
Test 12
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
4 4 4 2 2 4 3 1 1 3 2 1 2 1 |
correct output |
---|
NO |
user output |
---|
NO |
Test 13
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
5 14 2 1 1 3 2 1 4 3 1 1 4 1 ... |
correct output |
---|
YES 0.5 0.5 0.5 0.5 1.5 |
user output |
---|
YES 0.5 0.5 0.5 0.5 1.5 |
Test 14
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
5 4 2 5 1 5 4 2 4 1 2 1 3 1 |
correct output |
---|
YES 1 0 0 1 1 |
user output |
---|
YES 1.0 0.0 0.0 1.0 1.0 |
Test 15
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
5 4 2 4 1 5 4 2 4 1 2 4 3 1 |
correct output |
---|
YES 1 0 0 1 1 |
user output |
---|
YES 1.0 0.0 0.0 1.0 1.0 |
Test 16
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
5 5 3 5 2 2 4 1 5 4 2 4 1 2 ... |
correct output |
---|
YES 1.5 0.5 0.5 0.5 1.5 |
user output |
---|
YES 1.5 0.5 0.5 0.5 1.5 |
Test 17
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
1 0 |
correct output |
---|
YES 0 |
user output |
---|
YES 0.0 |
Test 18
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
1 1 1 1 1 |
correct output |
---|
YES 0.5 |
user output |
---|
YES 0.5 |
Test 19
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
3 14 1 1 2 1 1 2 2 2 1 2 3 2 ... |
correct output |
---|
YES 1 0.5 1.5 |
user output |
---|
YES 1.0 0.5 1.5 |
Test 20
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
3 4 2 2 1 1 2 2 1 3 2 3 3 1 |
correct output |
---|
YES 1.5 0.5 0.5 |
user output |
---|
YES 1.5 0.5 0.5 |
Test 21
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
2 2 1 2 2 2 1 2 |
correct output |
---|
YES 2 0 |
user output |
---|
YES 2.0 0.0 |
Test 22
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
2 2 1 2 2 2 1 1 |
correct output |
---|
NO |
user output |
---|
NO |
Test 23
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
3 14 1 1 2 1 1 2 2 2 1 2 3 1 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 24
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
100 99 10 91 1 10 86 2 86 81 2 10 62 1 ... |
correct output |
---|
YES 0 2 1 1 2 0 1 0 0 1 -1 -1 1 1 ... |
user output |
---|
YES 0.0 2.0 1.0 1.0 2.0 0.0 1.0 0.... Truncated |
Test 25
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
50 49 31 8 2 31 7 2 31 34 1 7 49 1 ... |
correct output |
---|
YES 2 1 -1 2 -1 2 1 1 2 1 1 2 -1 0... |
user output |
---|
YES 2.0 1.0 -1.0 2.0 -1.0 2.0 1.0 ... Truncated |
Test 26
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
88 87 16 28 1 28 32 2 32 34 1 32 3 2 ... |
correct output |
---|
YES 3 1 1 -2 1 1 1 0 2 2 0 2 0 0 1... |
user output |
---|
YES 3.0 1.0 1.0 -2.0 1.0 1.0 1.0 0... Truncated |
Test 27
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
88 88 16 28 1 28 32 2 32 34 1 32 3 2 ... |
correct output |
---|
YES 2 2 0 -3 0 2 2 1 3 3 -1 3 -1 1... |
user output |
---|
YES 2.0 2.0 0.0 -3.0 0.0 2.0 2.0 1... Truncated |
Test 28
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
100 100 17 44 1 30 17 2 18 30 1 88 18 2 ... |
correct output |
---|
YES 2 0 0 2 0 0 2 1 1 3 0 2 -1 2 3... |
user output |
---|
YES 2.0 0.0 0.0 2.0 0.0 0.0 2.0 1.... Truncated |
Test 29
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
100 100 17 57 1 30 17 1 18 30 1 88 18 1 ... |
correct output |
---|
YES 3 1 0 2 1 1 2 0 0 2 1 2 0 1 2 ... |
user output |
---|
YES 3.0 1.0 0.0 2.0 1.0 1.0 2.0 0.... Truncated |
Test 30
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
100 100 17 57 1 30 17 2 18 30 1 88 18 2 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 31
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
77 77 33 31 2 68 66 1 10 8 2 24 22 2 ... |
correct output |
---|
YES 1.5 2 0.5 0 1.5 1 -0.5 1 2.5 1... |
user output |
---|
YES 1.5 2.0 0.5 0.0 1.5 1.0 -0.5 1... Truncated |
Test 32
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
77 77 77 77 1 76 76 1 75 75 1 74 2 2 ... |
correct output |
---|
YES 0.5 0.5 1 1.5 1 1 0.5 0.5 1.5 ... |
user output |
---|
YES 0.5 0.5 1.0 1.5 1.0 1.0 0.5 0.... Truncated |
Test 33
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
76 38 2 1 1 65 4 1 67 6 2 66 8 1 ... |
correct output |
---|
YES 1 0 2 1 1 2 2 1 1 1 0 2 2 2 2 ... |
user output |
---|
YES 1.0 0.0 2.0 1.0 1.0 2.0 2.0 1.... Truncated |
Test 34
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
100 113 82 73 1 65 22 1 58 24 1 4 52 1 ... |
correct output |
---|
YES 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.... |
user output |
---|
YES 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.... Truncated |
Test 35
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
77 77 33 31 2 68 66 1 10 8 2 24 22 1 ... |
correct output |
---|
YES 0.5 1 1.5 1 0.5 1 0.5 0 0.5 2 ... |
user output |
---|
YES 0.5 1.0 1.5 1.0 0.5 1.0 0.5 0.... Truncated |
Test 36
Group: 2, 3, 4, 5
Verdict: ACCEPTED
input |
---|
77 78 33 31 2 68 66 1 10 8 2 24 22 1 ... |
correct output |
---|
YES 1 0.5 1 1.5 1 0.5 0 0.5 1 1.5 ... |
user output |
---|
YES 1.0 0.5 1.0 1.5 1.0 0.5 0.0 0.... Truncated |
Test 37
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
211 210 129 163 1 129 193 1 129 65 1 163 142 2 ... |
correct output |
---|
YES 0 0 -1 1 -1 1 1 1 1 1 1 0 1 2 ... |
user output |
---|
YES 0.0 0.0 -1.0 1.0 -1.0 1.0 1.0 ... Truncated |
Test 38
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
211 211 129 163 1 129 193 1 129 65 1 163 142 2 ... |
correct output |
---|
YES -0.5 0.5 -0.5 0.5 -0.5 1.5 0.5... |
user output |
---|
YES -0.5 0.5 -0.5 0.5 -0.5 1.5 0.5... Truncated |
Test 39
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
547 546 15 139 2 139 397 1 15 327 1 15 510 1 ... |
correct output |
---|
YES 1 0 -1 2 1 1 1 0 2 0 1 1 2 1 1... |
user output |
---|
YES 1.0 0.0 -1.0 2.0 1.0 1.0 1.0 0... Truncated |
Test 40
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
935 935 923 195 1 388 923 1 439 388 2 101 439 1 ... |
correct output |
---|
YES 6 3 -1 -1 3 -2 -1 -4 1 2 -6 -6... |
user output |
---|
YES 6.0 3.0 -1.0 -1.0 3.0 -2.0 -1.... Truncated |
Test 41
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
935 935 621 758 2 758 394 1 24 758 1 543 24 1 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 42
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
935 935 923 195 1 388 923 1 439 388 2 101 439 1 ... |
correct output |
---|
YES 4 1 -4 3 6 -3 4 9 0 -2 -2 4 -3... |
user output |
---|
YES 4.0 1.0 -4.0 3.0 6.0 -3.0 4.0 ... Truncated |
Test 43
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
999 996 10 58 2 101 80 2 101 812 1 106 178 1 ... |
correct output |
---|
YES 1 2 1 1 2 2 -2 1 1 3 0 2 1 -1 ... |
user output |
---|
YES 1.0 2.0 1.0 1.0 2.0 2.0 -2.0 1... Truncated |
Test 44
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
994 987 769 256 2 906 812 1 453 603 1 556 451 2 ... |
correct output |
---|
YES 2 2 -4 3 -1 -4 0 -1 0 -1 -2 -1... |
user output |
---|
YES 2.0 2.0 -4.0 3.0 -1.0 -4.0 0.0... Truncated |
Test 45
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
994 994 769 256 2 906 812 1 453 603 1 556 451 2 ... |
correct output |
---|
YES 3.5 4.5 -3.5 0.5 -3 -6.5 -11 -... |
user output |
---|
YES 3.5 4.5 -3.5 0.5 -3.0 -6.5 -11... Truncated |
Test 46
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
500 491 87 78 2 78 434 1 434 26 1 26 98 1 ... |
correct output |
---|
YES 2 0 0 1 0 -1 0 1 0 0 0 0 0 1 2... |
user output |
---|
YES 2.0 0.0 0.0 1.0 0.0 -1.0 0.0 1... Truncated |
Test 47
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
994 994 769 256 2 906 812 1 453 603 1 556 451 2 ... |
correct output |
---|
YES 1.5 4.5 -3.5 0.5 -2.5 -6.5 -7.... |
user output |
---|
YES 1.5 4.5 -3.5 0.5 -2.5 -6.5 -7.... Truncated |
Test 48
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
994 994 769 256 2 906 812 1 453 603 1 556 451 2 ... |
correct output |
---|
YES -3.5 -0.5 -8.5 5.5 2.5 -1.5 -2... |
user output |
---|
YES -3.5 -0.5 -8.5 5.5 2.5 -1.5 -2... Truncated |
Test 49
Group: 4, 5
Verdict: ACCEPTED
input |
---|
10000 9999 5747 266 1 266 9872 1 5747 8144 1 9872 2774 2 ... |
correct output |
---|
YES 0 -1 1 0 1 1 3 0 2 3 3 3 -3 3 ... |
user output |
---|
YES 0.0 -1.0 1.0 0.0 1.0 1.0 3.0 0... Truncated |
Test 50
Group: 4, 5
Verdict: ACCEPTED
input |
---|
9973 9973 1477 3608 1 8395 1477 2 5665 8395 1 2668 5665 2 ... |
correct output |
---|
YES 8.5 22.5 -7.5 24.5 0.5 -8.5 -6... |
user output |
---|
YES 8.5 22.5 -7.5 24.5 0.5 -8.5 -6... Truncated |
Test 51
Group: 4, 5
Verdict: ACCEPTED
input |
---|
9973 9973 8395 1477 2 5665 8395 1 2668 5665 2 7601 2668 2 ... |
correct output |
---|
YES 5 7 1 9 8 9 16 1 16 -8 -13 -5 ... |
user output |
---|
YES 5.0 7.0 1.0 9.0 8.0 9.0 16.0 1... Truncated |
Test 52
Group: 4, 5
Verdict: ACCEPTED
input |
---|
9973 9973 3608 4715 2 4715 2860 1 803 3645 1 3645 1477 2 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 53
Group: 4, 5
Verdict: ACCEPTED
input |
---|
1023 1022 872 171 1 171 588 2 588 510 2 171 189 1 ... |
correct output |
---|
YES 0 2 1 0 2 0 1 2 -1 2 1 0 -1 3 ... |
user output |
---|
YES 0.0 2.0 1.0 0.0 2.0 0.0 1.0 2.... Truncated |
Test 54
Group: 4, 5
Verdict: ACCEPTED
input |
---|
2371 2370 1991 1896 1 1991 655 2 1991 722 1 655 130 2 ... |
correct output |
---|
YES 5 0 1 3 -1 1 4 0 1 0 2 4 3 0 -... |
user output |
---|
YES 5.0 0.0 1.0 3.0 -1.0 1.0 4.0 0... Truncated |
Test 55
Group: 4, 5
Verdict: ACCEPTED
input |
---|
4997 4996 4963 352 2 4963 1455 2 1455 2819 1 4963 4962 2 ... |
correct output |
---|
YES 2 2 2 2 0 2 1 1 -1 0 1 2 1 0 -... |
user output |
---|
YES 2.0 2.0 2.0 2.0 0.0 2.0 1.0 1.... Truncated |
Test 56
Group: 4, 5
Verdict: ACCEPTED
input |
---|
9778 9777 4271 8223 1 8223 7058 1 8223 7079 1 4271 3842 1 ... |
correct output |
---|
YES -1 1 -1 1 1 2 3 0 1 1 -1 1 -1 ... |
user output |
---|
YES -1.0 1.0 -1.0 1.0 1.0 2.0 3.0 ... Truncated |
Test 57
Group: 4, 5
Verdict: ACCEPTED
input |
---|
9997 9225 5985 4701 2 4701 2238 2 2238 8981 2 4701 639 1 ... |
correct output |
---|
YES 3 2 0 1 0 2 0 1 3 2 -1 0 -1 1 ... |
user output |
---|
YES 3.0 2.0 0.0 1.0 0.0 2.0 0.0 1.... Truncated |
Test 58
Group: 4, 5
Verdict: ACCEPTED
input |
---|
9000 8997 23 909 1 909 297 2 297 125 2 125 856 2 ... |
correct output |
---|
YES 2 1 2 0 0 1 2 0 -1 1 2 -1 1 -1... |
user output |
---|
YES 2.0 1.0 2.0 0.0 0.0 1.0 2.0 0.... Truncated |
Test 59
Group: 4, 5
Verdict: ACCEPTED
input |
---|
9000 9000 23 909 1 909 297 2 297 125 2 125 856 2 ... |
correct output |
---|
YES 3 2 3 1 1 2 3 1 0 0 1 -2 2 -2 ... |
user output |
---|
YES 3.0 2.0 3.0 1.0 1.0 2.0 3.0 1.... Truncated |
Test 60
Group: 4, 5
Verdict: ACCEPTED
input |
---|
10000 9993 5747 266 1 266 9872 1 5747 8144 1 9872 2774 2 ... |
correct output |
---|
YES 1 -2 0 1 0 1 2 -1 2 2 3 2 -4 3... |
user output |
---|
YES 1.0 -2.0 0.0 1.0 0.0 1.0 2.0 -... Truncated |
Test 61
Group: 4, 5
Verdict: ACCEPTED
input |
---|
5000 5000 1537 2983 1 2983 1590 2 1590 1547 1 1547 4457 1 ... |
correct output |
---|
YES 3 0 -3 5 0 4 0 -1 3 -1 5 2 2 0... |
user output |
---|
YES 3.0 0.0 -3.0 5.0 0.0 4.0 0.0 -... Truncated |
Test 62
Group: 4, 5
Verdict: ACCEPTED
input |
---|
7779 200000 5647 4480 1 3952 7125 2 4078 2641 1 4841 2183 1 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 63
Group: 4, 5
Verdict: ACCEPTED
input |
---|
7779 200000 5647 4480 2 3952 7125 2 4078 2641 2 4841 2183 2 ... |
correct output |
---|
YES 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
YES 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.... Truncated |
Test 64
Group: 4, 5
Verdict: ACCEPTED
input |
---|
7783 200000 5647 4480 2 3952 7125 2 4078 2641 2 4841 2183 2 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 65
Group: 4, 5
Verdict: ACCEPTED
input |
---|
7783 200000 5647 4480 2 3952 7125 2 4078 2641 2 4841 2183 2 ... |
correct output |
---|
YES 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
YES 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.... Truncated |
Test 66
Group: 4, 5
Verdict: ACCEPTED
input |
---|
2000 1998 1673 1643 1 1643 1877 1 1643 1622 2 1643 1533 1 ... |
correct output |
---|
YES 2 1 1 2 1 2 0 -1 0 -1 1 -1 0 2... |
user output |
---|
YES 2.0 1.0 1.0 2.0 1.0 2.0 0.0 -1... Truncated |
Test 67
Group: 5
Verdict: ACCEPTED
input |
---|
100000 99999 1 2 2 2 3 1 3 4 2 4 5 2 ... |
correct output |
---|
YES -27 29 -28 30 -28 29 -27 29 -2... |
user output |
---|
YES -27.0 29.0 -28.0 30.0 -28.0 29... Truncated |
Test 68
Group: 5
Verdict: ACCEPTED
input |
---|
100000 99999 1 2 1 2 3 1 3 4 1 4 5 1 ... |
correct output |
---|
YES 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ... |
user output |
---|
YES 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.... Truncated |
Test 69
Group: 5
Verdict: ACCEPTED
input |
---|
99999 99999 1 2 1 2 3 1 3 4 2 4 5 1 ... |
correct output |
---|
YES 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 ... |
user output |
---|
YES 1.0 0.0 1.0 1.0 0.0 1.0 1.0 0.... Truncated |
Test 70
Group: 5
Verdict: ACCEPTED
input |
---|
100000 200000 1 2 1 2 3 1 3 4 1 4 5 1 ... |
correct output |
---|
YES 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ... |
user output |
---|
YES 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.... Truncated |
Test 71
Group: 5
Verdict: ACCEPTED
input |
---|
99999 99999 1 2 2 2 3 1 3 4 2 4 5 1 ... |
correct output |
---|
YES 1.5 0.5 0.5 1.5 -0.5 1.5 0.5 0... |
user output |
---|
YES 1.5 0.5 0.5 1.5 -0.5 1.5 0.5 0... Truncated |
Test 72
Group: 5
Verdict: ACCEPTED
input |
---|
100000 99999 46010 73517 1 46010 71237 1 73517 84882 1 46010 88029 2 ... |
correct output |
---|
YES -4 0 -1 1 -1 -3 1 1 0 0 0 1 2 ... |
user output |
---|
YES -4.0 0.0 -1.0 1.0 -1.0 -3.0 1.... Truncated |
Test 73
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100000 99997 99996 2 46010 73517 1 46010 71237 1 73517 84882 1 ... |
correct output |
---|
YES -4 0 -1 1 -1 -3 1 1 0 0 0 1 2 ... |
user output |
---|
YES -4.0 0.0 -1.0 1.0 -1.0 -3.0 1.... Truncated |
Test 74
Group: 5
Verdict: ACCEPTED
input |
---|
65432 65432 53092 42562 2 61422 3056 1 22311 61422 1 48701 22311 1 ... |
correct output |
---|
YES -43 2 -40 73 83 -68 42 -32 -74... |
user output |
---|
YES -43.0 2.0 -40.0 73.0 83.0 -68.... Truncated |
Test 75
Group: 5
Verdict: ACCEPTED
input |
---|
65432 65432 53092 211 1 27132 53092 2 42562 27132 1 211 42562 2 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 76
Group: 5
Verdict: ACCEPTED
input |
---|
12003 12002 9377 4878 2 9377 3429 1 9377 7810 2 7810 5657 1 ... |
correct output |
---|
YES -2 0 2 -1 0 0 0 -1 0 3 2 1 0 -... |
user output |
---|
YES -2.0 0.0 2.0 -1.0 0.0 0.0 0.0 ... Truncated |
Test 77
Group: 5
Verdict: ACCEPTED
input |
---|
24578 24577 23603 4344 2 4344 19532 1 23603 3246 1 3246 1886 2 ... |
correct output |
---|
YES 4 2 4 2 -1 0 -2 0 0 0 0 2 -2 1... |
user output |
---|
YES 4.0 2.0 4.0 2.0 -1.0 0.0 -2.0 ... Truncated |
Test 78
Group: 5
Verdict: ACCEPTED
input |
---|
42875 42874 20761 12008 1 20761 1944 1 1944 39972 2 1944 22755 1 ... |
correct output |
---|
YES -1 2 2 -1 0 2 3 1 3 1 -1 -1 0 ... |
user output |
---|
YES -1.0 2.0 2.0 -1.0 0.0 2.0 3.0 ... Truncated |
Test 79
Group: 5
Verdict: ACCEPTED
input |
---|
85112 85111 46719 28242 2 46719 12064 1 46719 41742 2 12064 12832 1 ... |
correct output |
---|
YES 3 0 1 0 2 0 2 0 3 1 2 0 1 2 3 ... |
user output |
---|
YES 3.0 0.0 1.0 0.0 2.0 0.0 2.0 0.... Truncated |
Test 80
Group: 5
Verdict: ACCEPTED
input |
---|
65432 65432 53092 211 1 27132 53092 1 42562 27132 2 17771 211 2 ... |
correct output |
---|
YES -5 24 -91 23 -7 2 38 16 -11 -1... |
user output |
---|
YES -5.0 24.0 -91.0 23.0 -7.0 2.0 ... Truncated |
Test 81
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100002 56529 57156 2 57156 27549 1 27549 28230 1 28230 7926 1 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 82
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100002 56529 57156 1 57156 27549 2 27549 28230 1 28230 7926 1 ... |
correct output |
---|
YES 23.5 74.5 -28.5 18.5 35.5 17.5... |
user output |
---|
YES 23.5 74.5 -28.5 18.5 35.5 17.5... Truncated |
Test 83
Group: 5
Verdict: ACCEPTED
input |
---|
99999 99999 80080 1 1 87783 2 2 61570 3 1 63587 4 1 ... |
correct output |
---|
YES -11 120 -66 -119 82 -99 -112 -... |
user output |
---|
YES -11.0 120.0 -66.0 -119.0 82.0 ... Truncated |
Test 84
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100000 80080 1 1 87783 2 2 61570 3 1 63587 4 1 ... |
correct output |
---|
YES 82 27 27 -26 -11 -6 -19 -24 -1... |
user output |
---|
YES 82.0 27.0 27.0 -26.0 -11.0 -6.... Truncated |
Test 85
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100000 1 2 2 2 3 1 3 4 2 4 5 2 ... |
correct output |
---|
YES 5 -3 4 -2 4 -3 5 -3 4 -2 3 -2 ... |
user output |
---|
YES 5.0 -3.0 4.0 -2.0 4.0 -3.0 5.0... Truncated |
Test 86
Group: 5
Verdict: ACCEPTED
input |
---|
99999 99999 1 2 2 2 3 1 3 4 2 4 5 2 ... |
correct output |
---|
YES -8 10 -9 11 -9 10 -8 10 -9 11 ... |
user output |
---|
YES -8.0 10.0 -9.0 11.0 -9.0 10.0 ... Truncated |
Test 87
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100000 56529 22247 1 57156 76873 2 27549 74689 2 28230 20136 2 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 88
Group: 5
Verdict: ACCEPTED
input |
---|
100000 99993 56529 22247 1 57156 76873 2 27549 74689 2 28230 20136 2 ... |
correct output |
---|
YES 63.5 -37.5 -3 -50.5 -28.5 49.5... |
user output |
---|
YES 63.5 -37.5 -3.0 -50.5 -28.5 49... Truncated |
Test 89
Group: 5
Verdict: ACCEPTED
input |
---|
99995 99995 78058 31441 1 31441 51023 1 51023 74459 1 74459 23055 2 ... |
correct output |
---|
YES 1.5 0.5 0.5 1 0.5 0.5 1 1.5 -0... |
user output |
---|
YES 1.5 0.5 0.5 1.0 0.5 0.5 1.0 1.... Truncated |
Test 90
Group: 5
Verdict: ACCEPTED
input |
---|
99995 99993 78058 31441 1 31441 51023 1 51023 74459 1 23055 78058 1 ... |
correct output |
---|
YES 1 0 1 0.5 1 0.5 0.5 1 0.5 0.5 ... |
user output |
---|
YES 1.0 0.0 1.0 0.5 1.0 0.5 0.5 1.... Truncated |
Test 91
Group: 5
Verdict: ACCEPTED
input |
---|
99995 99991 1 20142 2 2 6002 2 3 82095 1 4 60745 2 ... |
correct output |
---|
YES 0.5 1 1.5 1 0 1.5 0.5 1 1 0.5 ... |
user output |
---|
YES 0.5 1.0 1.5 1.0 0.0 1.5 0.5 1.... Truncated |
Test 92
Group: 5
Verdict: ACCEPTED
input |
---|
50000 50000 24269 39765 1 24269 22722 2 24269 43371 2 24269 38058 2 ... |
correct output |
---|
YES -2.5 -0.5 0.5 0.5 2.5 0.5 0.5 ... |
user output |
---|
YES -2.5 -0.5 0.5 0.5 2.5 0.5 0.5 ... Truncated |
Test 93
Group: 5
Verdict: ACCEPTED
input |
---|
50000 50000 12607 45763 2 45763 7230 1 7230 4820 2 12607 46801 2 ... |
correct output |
---|
YES 1 1 1 2 4 0 2 0 -1 3 3 1 -1 1 ... |
user output |
---|
YES 1.0 1.0 1.0 2.0 4.0 0.0 2.0 0.... Truncated |
Test 94
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100000 80080 1 1 87783 2 2 61570 3 1 63587 4 1 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 95
Group: 5
Verdict: ACCEPTED
input |
---|
99995 99993 1 20142 2 2 6002 2 3 82095 1 4 60745 2 ... |
correct output |
---|
NO |
user output |
---|
NO |
Test 96
Group: 5
Verdict: ACCEPTED
input |
---|
99997 200000 13425 90048 1 81741 46019 1 35193 33756 1 4840 2182 1 ... |
correct output |
---|
YES 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.... |
user output |
---|
YES 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.... Truncated |
Test 97
Group: 5
Verdict: ACCEPTED
input |
---|
100000 100000 1 2 2 2 3 1 3 4 2 4 5 2 ... |
correct output |
---|
NO |
user output |
---|
NO |