Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
gzshawnliang committed Jul 10, 2019
1 parent 71aba47 commit c23f506
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 7 deletions.
2 changes: 1 addition & 1 deletion myCpps/highestPaidToll_UVA12047.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int main()
{
edge nowEdge = edges[i];

if (dS[nowEdge.u] + a[nowEdge.u][nowEdge.v] + dE[nowEdge.v] <= pMax)
if (dS[nowEdge.u] + a[nowEdge.u][nowEdge.v] + dE[nowEdge.v] <= pMax && dS[nowEdge.u] < inf && dE[nowEdge.v] < inf)
{
ans = max(ans, a[nowEdge.u][nowEdge.v]);
}
Expand Down
16 changes: 12 additions & 4 deletions myCpps/highestPaidToll_UVA12047.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
1
2 3 1 2 14
1 2 4
1 2 1
2 1 5
9 10 1 6 15
5 7 39840
7 4 21005
3 7 68491
8 7 75121
3 5 51809
3 2 2392
1 4 90589
8 2 3372
8 1 29184
7 4 67316

2 changes: 1 addition & 1 deletion myCpps/highestPaidToll_UVA12047.out
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
-1
2 changes: 1 addition & 1 deletion myCpps/highestPaidToll_UVA12047OJ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int main()
{
edge nowEdge = edges[i];

if (dS[nowEdge.u] + a[nowEdge.u][nowEdge.v] + dE[nowEdge.v] <= pMax)
if (dS[nowEdge.u] + a[nowEdge.u][nowEdge.v] + dE[nowEdge.v] <= pMax && dS[nowEdge.u] < inf && dE[nowEdge.v] < inf)
{
ans = max(ans, a[nowEdge.u][nowEdge.v]);
}
Expand Down
48 changes: 48 additions & 0 deletions other/thomas/highestPaidToll_UVA12047/genData.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <bits/stdc++.h> //includes everything, supported in CF, usaco, not POJ
#include "MyRandom.h"

using namespace std;

int main()
{
const int FileCount = 10; //note:文件数量
ofstream fout; //note:文件流
random rdNum; //note:随机数

for (int fileId = 1; fileId <= FileCount; ++fileId)
{
fout.open(to_string(fileId) + ".in");

//***************************
//在此处写入测试数据
//***************************
int T = rdNum.GetRand(1, 50);
fout << T << "\n";
while (T--)
{
int N=rdNum.GetRand(2, 10);
int M=rdNum.GetRand(1, 30);
int s=rdNum.GetRand(1, N);
int t=rdNum.GetRand(1, N);
int p=rdNum.GetRand(1, 50);
fout << N << " " << M << " " << s << " " << t << " " << p << "\n";
while (M--)
{
int u=rdNum.GetRand(1, N);
int v=rdNum.GetRand(1, N);
while (u==v)
{
v=rdNum.GetRand(1, N);
}
int c=rdNum.GetRand(0, 100000);
fout << u << " " << v << " " << c << "\n";
}

}


fout.close();
}

return 0;
}

0 comments on commit c23f506

Please sign in to comment.