F.A.Qs Home ProblemSet Status Ranklist Contest LoginRegister
大视野在线测评-欢迎您
[ New Thread ]
Problem 3575 >> 这题真的有靠谱做法吗
ISA @ 2017-09-01 20:44:09
[ Quote ] [ Edit ] [ Delete ] 1#
AC了的同学请试一下这组数据


#include <iostream>

using namespace std;

int main() {
int l=9999,n=3*l+2,m=l*5;
cout<<n<<" "<<m<<" "<<l<<endl;

for(int i=1;i<l;i++) {
cout<<i<<" "<<i+1<<" "<<1<<endl;
}
cout<<l<<" "<<n<<" "<<1<<endl;

for(int i=1;i<=l;i++) {
cout<<i<<" "<<l+i<<" "<<(l-i+1)<<endl;
cout<<l+i<<" "<<i<<" "<<(l-i+1)<<endl;
cout<<l+i<<" "<<n-1<<" "<<(l-i+1)<<endl;
cout<<n-1<<" "<<l+i<<" "<<(l-i+1)<<endl;
}

for(int i=1;i<=l;i++) cout<<i<<" ";
cout<<endl;
return 0;
}
nzhtl1477 @ 2017-09-02 01:00:36
[ Quote ] [ Edit ] [ Delete ] 2#
这个据说是动态spfa题
ISA @ 2017-09-02 07:06:09
[ Quote ] [ Edit ] [ Delete ] 3#
所有网上能找到的做法都过不了这组数据。而且范围并没有开满,可以把l开到30000,这样会出现长度大于10000的边,但应该不影响。
dsl2002 @ 2017-09-30 11:36:33
[ Quote ] [ Edit ] [ Delete ] 4#
卡spfa好吗
ISA @ 2017-10-01 17:48:40
[ Quote ] [ Edit ] [ Delete ] 5#
你写dij还是过不了啊。。
这跟卡spfa没关系吧
Cydiater @ 2017-10-02 16:48:06
[ Quote ] [ Edit ] [ Delete ] 6#
所以这题正解是啥啊
MLEAutoMaton @ 2019-02-21 08:30:12
[ Quote ] [ Edit ] [ Delete ] 7#
答案是不是这个?跑出来在1s以内.
<a href="https://paste.ubuntu.com/p/bV6KVJ29hf/">road.out<\a>
[Top] [Previous Page] [Next Page]

HOME Back