Task: | Flights |
Sender: | >--) ) ) )*> |
Submission time: | 2015-10-07 18:34:59 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.69 s | details |
#2 | TIME LIMIT EXCEEDED | -- | details |
#3 | TIME LIMIT EXCEEDED | -- | details |
#4 | TIME LIMIT EXCEEDED | -- | details |
#5 | TIME LIMIT EXCEEDED | -- | details |
#6 | TIME LIMIT EXCEEDED | -- | details |
#7 | WRONG ANSWER | 0.77 s | details |
#8 | WRONG ANSWER | 0.37 s | details |
#9 | WRONG ANSWER | 1.27 s | details |
#10 | TIME LIMIT EXCEEDED | -- | details |
#11 | WRONG ANSWER | 0.74 s | details |
#12 | TIME LIMIT EXCEEDED | -- | details |
#13 | WRONG ANSWER | 0.52 s | details |
#14 | WRONG ANSWER | 1.16 s | details |
#15 | WRONG ANSWER | 0.66 s | details |
#16 | WRONG ANSWER | 0.10 s | details |
#17 | WRONG ANSWER | 0.85 s | details |
#18 | TIME LIMIT EXCEEDED | -- | details |
#19 | WRONG ANSWER | 0.73 s | details |
#20 | TIME LIMIT EXCEEDED | -- | details |
#21 | WRONG ANSWER | 0.73 s | details |
#22 | WRONG ANSWER | 0.64 s | details |
#23 | WRONG ANSWER | 0.64 s | details |
#24 | WRONG ANSWER | 0.53 s | details |
#25 | TIME LIMIT EXCEEDED | -- | details |
#26 | WRONG ANSWER | 0.91 s | details |
#27 | TIME LIMIT EXCEEDED | -- | details |
#28 | TIME LIMIT EXCEEDED | -- | details |
#29 | WRONG ANSWER | 0.63 s | details |
#30 | WRONG ANSWER | 0.90 s | details |
Code
#include <algorithm> #include <iostream> #include <iterator> #include <numeric> #include <sstream> #include <fstream> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <string> #include <cstdio> #include <vector> #include <bitset> #include <cmath> #include <queue> #include <deque> #include <stack> #include <list> #include <map> #include <set> using namespace std; #define ll long long #define ld long double #define ii pair<int,int> #define si pair<string,int> #define iii pair<int,ii> #define vi vector<int> #define vc vector<char> #define vs vector<string> #define msvs map<string,vs> #define msi map<string,int> #define mss map<string,int> #define us unordered_set #define um unordered_map #define pq priority_queue #define pb push_back #define mp make_pair #define forall(i,a,b) for (int i=a;i<b;i++) #define foreach(v,c) for( typeof( (c).begin()) v = (c).begin(); v != (c).end(); ++v) #define all(a) a.begin(), a.end() #define in(a,b) ( (b).find(a) != (b).end()) #define fill(a,v) memset(a, v, sizeof a) #define sz(a) ((int)(a.size())) #define N (1<<17) #define M 1000000007 int n,m; int main() { map<int, vector<pair<int,pair<int,int>>>> edges; map<int,pair<ll,int>> prices; cin.sync_with_stdio(false); cin >> n >> m; for (int i = 0; i < m; i++) { int a,b,p,d; cin >> a >> b >> p >> d; edges[a].push_back(make_pair(b,make_pair(p,d))); } deque<pair<int,pair<ll,int>>> q; q.push_back(make_pair(1,make_pair((ll)0,100))); while (!q.empty()) { pair<int,pair<ll,int>> current = q.front(); q.pop_front(); vector<pair<int,pair<int,int>>> kaaret = edges[current.first]; for (pair<int,pair<int,int>> cinfo : kaaret) { ll total = current.second.first + cinfo.second.first; int discount = min(current.second.second,cinfo.second.second); if (prices.find(cinfo.first) != prices.end()) { long double tot = (discount / (long double)100) * total; long double oldtot = (prices[cinfo.first].second / (long double)100) * prices[cinfo.first].first; if (tot < oldtot) { prices[cinfo.first] = make_pair(total,discount); q.push_back(make_pair(cinfo.first,make_pair(total,discount))); } } else { prices[cinfo.first] = make_pair(total,discount); q.push_back(make_pair(cinfo.first,make_pair(total,discount))); } } } cout << (prices[n].second / (long double)100) * prices[n].first; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
100000 200000
83440 84424 708810295 87 28725 29724 552336091 3 76873 79637 768853492 82 73157 75801 208773467 95 ... |
correct output |
---|
176693844.03 |
user output |
---|
1.81737e+08 |
Test 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
4158 76239
2106 2107 214369404 9 2615 2616 599912001 65 2736 2737 106730531 5 3122 3123 989740491 72 ... |
correct output |
---|
2980020476.98 |
user output |
---|
(empty) |
Test 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 200000
61333 61375 934791657 27 57230 57459 363488259 89 94862 95081 574564520 83 29350 29358 205892730 47 ... |
correct output |
---|
2063342137.46 |
user output |
---|
(empty) |
Test 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
55959 184823
48935 48939 66931740 65 55879 55910 682673953 74 23663 23698 990216382 44 42486 42505 972883623 27 ... |
correct output |
---|
4779099645.25 |
user output |
---|
(empty) |
Test 5
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 200000
79146 79332 484554310 35 52757 52824 784839804 4 63169 63197 671959358 77 38542 38830 850962666 26 ... |
correct output |
---|
1273046189.67 |
user output |
---|
(empty) |
Test 6
Verdict: TIME LIMIT EXCEEDED
input |
---|
15536 166330
14900 14902 921455515 89 9329 9332 365143744 14 13868 13871 328203159 78 7822 7824 990983220 54 ... |
correct output |
---|
6582993331.15 |
user output |
---|
(empty) |
Test 7
Verdict: WRONG ANSWER
input |
---|
100000 200000
89124 91195 199647214 2 58704 58990 98401141 40 56447 57157 120977342 98 65418 67693 530932650 5 ... |
correct output |
---|
234347497.33 |
user output |
---|
2.34347e+08 |
Test 8
Verdict: WRONG ANSWER
input |
---|
36932 93986
13379 23634 481615407 80 11370 22629 626275451 41 6043 11090 696835009 43 24878 31930 227873837 15 ... |
correct output |
---|
41484417.04 |
user output |
---|
4.25218e+07 |
Test 9
Verdict: WRONG ANSWER
input |
---|
100000 200000
81515 81926 207016347 20 93172 93603 517064812 89 27081 27270 942564502 93 65710 66430 161755057 23 ... |
correct output |
---|
663852899.14 |
user output |
---|
6.76102e+08 |
Test 10
Verdict: TIME LIMIT EXCEEDED
input |
---|
4286 186778
1008 1009 298863636 25 3735 3736 691053215 32 2583 2584 141648549 63 1362 1363 132628814 52 ... |
correct output |
---|
1265736627.37 |
user output |
---|
(empty) |
Test 11
Verdict: WRONG ANSWER
input |
---|
100000 200000
39274 41223 667509717 39 17668 18392 794560732 87 84624 85119 258645192 82 39687 40083 222180448 9 ... |
correct output |
---|
204801135.31 |
user output |
---|
2.04801e+08 |
Test 12
Verdict: TIME LIMIT EXCEEDED
input |
---|
156 196340
115 120 885358263 74 69 70 733840613 66 47 51 194519228 36 143 144 997357319 98 ... |
correct output |
---|
234518.53 |
user output |
---|
(empty) |
Test 13
Verdict: WRONG ANSWER
input |
---|
100000 200000
61800 98622 689416865 94 93496 96677 968883683 26 30065 73258 40047565 96 11930 20180 777906649 69 ... |
correct output |
---|
46500624.37 |
user output |
---|
4.65006e+07 |
Test 14
Verdict: WRONG ANSWER
input |
---|
58203 168742
20492 20819 512664683 45 35979 36073 406549228 72 22670 22884 958846926 50 3181 3366 812137674 64 ... |
correct output |
---|
192471624.40 |
user output |
---|
2.0079e+08 |
Test 15
Verdict: WRONG ANSWER
input |
---|
100000 200000
53792 75073 320931265 77 27716 53886 29596596 82 9946 19018 891154582 91 414 66597 2097895 61 ... |
correct output |
---|
52804878.55 |
user output |
---|
5.42328e+07 |
Test 16
Verdict: WRONG ANSWER
input |
---|
29790 51057
6914 7959 559807642 87 4772 6061 707689095 28 12502 14138 473393199 55 16425 16862 224827374 16 ... |
correct output |
---|
96426328.10 |
user output |
---|
9.64263e+07 |
Test 17
Verdict: WRONG ANSWER
input |
---|
100000 200000
49413 51160 127588771 32 34728 34779 643912757 70 14609 15317 638237969 84 72278 72351 726808755 98 ... |
correct output |
---|
231729444.89 |
user output |
---|
2.43452e+08 |
Test 18
Verdict: TIME LIMIT EXCEEDED
input |
---|
16757 154256
1874 1903 580982686 96 14236 14609 288982257 24 11085 11417 670713941 5 15130 15467 715203324 50 ... |
correct output |
---|
47919755.92 |
user output |
---|
(empty) |
Test 19
Verdict: WRONG ANSWER
input |
---|
100000 200000
81960 97123 353071177 60 77895 83362 530318855 51 88788 96462 763556172 10 71069 89886 859574737 51 ... |
correct output |
---|
46970338.23 |
user output |
---|
4.69703e+07 |
Test 20
Verdict: TIME LIMIT EXCEEDED
input |
---|
36582 167647
16230 16359 131627754 74 29007 29070 968621666 86 29854 30031 159358481 31 12010 12340 159218511 83 ... |
correct output |
---|
245097346.41 |
user output |
---|
(empty) |
Test 21
Verdict: WRONG ANSWER
input |
---|
100000 200000
24087 24412 947358065 23 43122 45521 695825811 46 41701 43009 282526216 22 54644 55241 663868618 22 ... |
correct output |
---|
182454553.20 |
user output |
---|
1.82455e+08 |
Test 22
Verdict: WRONG ANSWER
input |
---|
19505 82130
10844 11159 72114176 12 2598 2890 247996564 65 16334 16419 152514701 1 6449 6630 826660090 3 ... |
correct output |
---|
90750315.08 |
user output |
---|
9.54281e+07 |
Test 23
Verdict: WRONG ANSWER
input |
---|
100000 200000
18237 23377 495435695 99 64625 68562 165710300 17 92456 92551 809687286 63 69882 70839 463068629 94 ... |
correct output |
---|
107349070.08 |
user output |
---|
1.07349e+08 |
Test 24
Verdict: WRONG ANSWER
input |
---|
24334 122357
20514 20821 536592664 40 3254 4063 271689487 32 16094 17795 378738726 16 19192 21939 488115831 75 ... |
correct output |
---|
21531136.12 |
user output |
---|
2.23613e+07 |
Test 25
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 200000
52201 52304 516199490 3 44594 44790 845780568 84 99131 99307 50245171 79 32481 32509 152614952 8 ... |
correct output |
---|
2641004228.19 |
user output |
---|
(empty) |
Test 26
Verdict: WRONG ANSWER
input |
---|
26099 89426
8222 8817 421562264 91 21504 21939 928132818 10 13949 14159 774448630 76 19315 19751 984491893 32 ... |
correct output |
---|
133812727.09 |
user output |
---|
1.33813e+08 |
Test 27
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 200000
58145 58370 637242643 19 24491 24661 262541209 9 62570 62672 413680288 49 71890 72126 53363827 82 ... |
correct output |
---|
1253750128.48 |
user output |
---|
(empty) |
Test 28
Verdict: TIME LIMIT EXCEEDED
input |
---|
35877 163659
5428 5668 961665808 94 11515 11541 884764784 34 7511 7652 62813799 11 10211 10835 442538859 55 ... |
correct output |
---|
114218011.47 |
user output |
---|
(empty) |
Test 29
Verdict: WRONG ANSWER
input |
---|
100000 200000
32689 38720 604086442 75 17653 27003 200982141 20 5642 19524 176519335 85 44331 52918 623420216 30 ... |
correct output |
---|
42422753.58 |
user output |
---|
4.24228e+07 |
Test 30
Verdict: WRONG ANSWER
input |
---|
71343 146160
24454 24767 601993050 84 22024 22056 179622315 81 51552 52291 321098922 17 50645 50972 583641105 77 ... |
correct output |
---|
407548924.88 |
user output |
---|
4.16925e+08 |