QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#120820 | #6660. 택시 여행 | youngsystem# | 0 | 1967ms | 26992kb | C++20 | 1.6kb | 2023-07-07 11:32:57 | 2024-07-04 00:25:30 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
long long a[200005],b[200005];
vector<int>v[200005];
vector<long long>bq[200005];
int pos[200005],cnt;
bool bi(int x,int y)
{
return b[x]>b[y];
}
long long dep[200005];
void dfs(int x,int f)
{
if(f==0)dep[x]=0;
for(int i=0;i<v[x].size();i++)
{
if(v[x][i]==f)continue;
dep[v[x][i]]=dep[x]+bq[x][i];
dfs(v[x][i],x);
}
}
long long dis[200005];
std::vector<long long> travel(std::vector<long long> A,
std::vector<int> B, std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
int n = A.size();
for(int i=1;i<=n;i++)a[i]=A[i-1],b[i]=B[i-1];
int sl=0;
for(int i=1;i<=n;i++)if(b[i]!=0)sl++;
for(int i=0;i<n-1;i++)
{
v[U[i]].push_back(V[i]);
v[V[i]].push_back(U[i]);
bq[U[i]].push_back(W[i]);
bq[V[i]].push_back(W[i]);
}
dis[1]=0;
for(int i=2;i<=n;i++)dis[i]=1000000000000000000LL;
if(sl<=2000)
{
for(int i=1;i<=n;i++)if(b[i]!=0)pos[++cnt]=i;
sort(pos+1,pos+cnt+1,bi);
for(int ii=1;ii<=cnt;ii++)
{
int i=pos[ii];
if(dis[i]==1000000000000000000LL)continue;
dfs(i,0);
for(int j=1;j<=n;j++)
{
dis[j]=min(dis[j],dis[i]+a[i]+b[i]*dep[j]);
}
}
long long minn=1000000000000000000LL;
for(int i=1;i<=n;i++)if(b[i]==0)minn=min(minn,dis[i]+a[i]);
for(int i=1;i<=n;i++)dis[i]=min(dis[i],minn);
vector<long long>qans;
for(int i=2;i<=n;i++)qans.push_back(dis[i]);
return qans;
}
vector<long long>v;
for(int i=2;i<=n;i++)v.push_back(0);
return v;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 7948kb
input:
2 684124582850 713748627948 74361 256955 0 1 661088
output:
secret: XBNN6R0Jnospxlfz11GWxd4ldkzb0I 684124582850 secret: XBNN6R0Jnospxlfz11GWxd4ldkzb0I
result:
wrong answer 2nd lines differ - expected: '733283747618', found: '684124582850'
Subtask #2:
score: 0
Wrong Answer
Test #31:
score: 0
Wrong Answer
time: 31ms
memory: 24808kb
input:
100000 746699125678 374834842799 250803643493 620187038832 454433387570 406226564003 897157438699 99473514061 734784419618 503968957100 363935477037 277126009840 52078020050 990757079812 847235285349 950784717285 271017141367 861087225700 996035427219 520682200664 282013988419 415183977876 882007771...
output:
secret: XBNN6R0Jnospxlfz11GWxd4ldkzb0I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
wrong answer 2nd lines differ - expected: '1148030742334', found: '0'
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Wrong Answer
Test #69:
score: 0
Wrong Answer
time: 42ms
memory: 26316kb
input:
100000 15175010 23519365 21177669 27079342 9089 16784452 29693960 23124925 17048604 10179491 12828214 24992902 8483134 2928073 23807522 7332137 17421520 28460746 1607282 13224363 11900728 11794692 11495061 4687109 23460275 7657982 27417256 16978162 7326803 23083826 24942987 16610314 12147303 2828271...
output:
secret: XBNN6R0Jnospxlfz11GWxd4ldkzb0I 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
wrong answer 2nd lines differ - expected: '16705757', found: '0'
Subtask #5:
score: 0
Wrong Answer
Test #94:
score: 0
Wrong Answer
time: 1967ms
memory: 26992kb
input:
99281 551670361798 568902251563 418071776626 697635341894 641578820039 117221079324 812766431051 425410617978 663769685693 282144284527 799662290178 749088952784 586626406385 122473825417 459510657357 871705247919 443707710712 735612808044 237919555727 829939639783 122127143240 616906466299 24431898...
output:
secret: XBNN6R0Jnospxlfz11GWxd4ldkzb0I 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 554202711173 5...
result:
wrong answer 2nd lines differ - expected: '598598746654', found: '554202711173'
Subtask #6:
score: 0
Skipped
Dependency #1:
0%