Gravatar
Chenyao2333
积分:770
提交:122 / 365
回复 @cstdio :
咦,好像就是呀,那正常的平面图对偶图求最短路怎么也可以过?>_<我被对偶图的性质和边的方向弄晕了........

Gravatar
OI永别
积分:568
提交:240 / 406
VIP是不是要有spj啊????为毛最短路不行,只能最长路

题目 535 工程规划 AAAAAAAAA
2014-04-24 17:24:08
Gravatar
OI永别
积分:568
提交:240 / 406
VIP上面的2b不要再刷了,2不2啊

Gravatar
LuciFer_T-J
积分:118
提交:81 / 123
#include<cstring>
#include<iostream>
#include<cstdio>
using namespace std;
#define __________________ 10005
#define ___________________ 50005
struct node{
int __________, ___________;
}________________[___________________];
int _________________[__________________],____[___________________];
int _[__________________],______[__________________],_____[__________________],___[__________________],__[__________________];
bool ____________________[__________________];
int ______________;
char _______________;
int n,m,s,_______,___s,________,_________;
void _____________(int __________,int ___________){
________________[++s].__________=__________;
________________[s].___________=___________;
____[s]=_________________[__________];
_________________[__________]=s;
}
void ____________(int x){
int i;
_______++;
_[x]=______[x]=_______;
_____[++________]=x;
____________________[x]=1;
for (i=_________________[x];i;i=____[i]){
if (!_[________________[i].___________]){
____________(________________[i].___________);
______[x]=min(______[x],______[________________[i].___________]);
}
else{
if (____________________[x]){
______[x]=min(______[x],_[________________[i].___________]);
}
}
}
if (______[x]==_[x]){
___s++;
while (_____[________+1]!=x){
___[_____[________]]=___s;
__[___s]++;
____________________[_____[________]]=0;
________--;
}
}
}
void _____________________(){
int i;
memset(____________________,1,sizeof(____________________));
for (i=1;i<=m;i++){
if (___[________________[i].__________]==___[________________[i].___________]) continue;
____________________[___[________________[i].__________]]=0;
}
}
int ______________________(){
while ((_______________=getchar()) && (_______________>'9' || _______________<'0'));
______________=_______________-'0';
while ((_______________=getchar()) && (_______________<='9' && _______________>='0')){
______________=______________*10+_______________-'0';
}
return ______________;
}
int main(){
freopen("cow.in","r",stdin);
freopen("cow.out","w",stdout);
int i,__________,___________;
n=______________________();
m=______________________();
s=0;
for (i=1;i<=m;i++){
__________=______________________();
___________=______________________();
_____________(__________,___________);
}
_______=0;
________=0;
___s=0;
for (i=1;i<=n;i++){
if (_[i]) continue;
____________(i);
}
_____________________();
_________=0;
for (i=1;i<=___s;i++){
if (____________________[i]){
if (_________) {
cout<<0<<endl;
return 0;
}
_________=__[i];
}
}
cout<<_________<<endl;
return 0;
}

Gravatar
(ˇˍˇ) ~耶稣
积分:216
提交:110 / 186
回复 @LuciFer_T-J :
~~~装逼遭雷劈!!!~~~

Gravatar
◆半城烟沙灬為你打天下
积分:132
提交:42 / 66
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
struct sky
{
int ff,tt,next;
};
sky c[50005];
int _[10005],__[10005],___[10005],____[10005],_____[10005];
int ______[50005];
bool v[50005];
int n,m,top,now,colors,ans,tot,ret;
char ch;
inline void add(int x,int y)
{
tot++;
c[tot].ff=x;
c[tot].tt=y;
c[tot].next=______[x];
______[x]=tot;
}
inline int read()
{
while (!isdigit(ch = getchar()));
ret = ch-48;
while (isdigit(ch = getchar())) (ret *= 10) += ch-48;
return ret;
}
void tarjan(int x)
{
now++;
_[x]=__[x]=now;
___[++top]=x;
v[x]=1;
for (int i=______[x];i;i=c[i].next)
{
if (!_[c[i].tt])
{
tarjan(c[i].tt);
__[x]=min(__[x],__[c[i].tt]);
}
else
{
if (v[x])
{
__[x]=min(__[x],_[c[i].tt]);
}
}
}
if (__[x]==_[x])
{
colors++;
while (___[top+1]!=x)
{
____[___[top]]=colors;
_____[colors]++;
v[___[top]]=0;
top--;
}
}
}
int main()
{
freopen("cow.in","r",stdin);
freopen("cow.out","w",stdout);
n = read(); m = read();
memset(______,0,sizeof(______));
tot=0;
for (int i=1;i<=m;i++)
{
int x,y;
x=read();y=read();
add(x,y);
}
now=top=colors=0;
memset(_____,0,sizeof(_____));
memset(_,0,sizeof(_));
memset(v,0,sizeof(v));
for (int i=1;i<=n;i++)
{
if (_[i]) continue;
tarjan(i);
}
memset(v,1,sizeof(v));
for (int i=1;i<=tot;i++)
{
if (____[c[i].ff]==____[c[i].tt]) continue;
v[____[c[i].ff]]=0;
}
ans=0;
for (int i=1;i<=colors;i++)
{
if (v[i])
{
if (ans)
{
printf("0");
return 0;
}
ans=_____[i];
}
}
printf("%d",ans);
}

Gravatar
FF_Sky||幻
积分:182
提交:98 / 189
这成了机房里的竞速题了- -

Gravatar
OI永别
积分:568
提交:240 / 406
VIP额,用BST秒过

Gravatar
麦田之上
积分:101
提交:63 / 191
解方程组....忘了变元.....逗比地调了仨小时...

Gravatar
麦田之上
积分:101
提交:63 / 191
细节哟~

Gravatar
OIdiot
积分:595
提交:210 / 388
设f[i][j]表示前i个人抄前j本书的最小时间,S[i]表示前i本书所花费的最小时间。
那么初始状态就是f[1][i]=S[i] f[i][i]=max(f[i-1][i-1],S[i]-S[i-1])
转移方程:f[i][j]=min(f[i-1][k],S[j]-S[k]) k∈[1,j)
最终状态:f[K][N]
由于只要输出一种解,将得到的f[K][N]贪心求出每个人的抄写时间。

题目 1204 书的复制 AAAAAAAAAA
2014-04-23 22:25:10
Gravatar
cstdio
积分:4748
提交:1198 / 2108
这个卡时间过……

Gravatar
雪狼
积分:662
提交:204 / 354
再次被读入\n给坑了

Gravatar
King
积分:130
提交:40 / 75
练一练pollard_rho

Gravatar
麦田之上
积分:101
提交:63 / 191
排前头的竟然是Pascal,是C++中数组下标只能从0开始的原因?

Gravatar
,
积分:425
提交:128 / 305
回复 @Chenyao2333 :
我才是逗比。。。

题目 751 螺旋方阵
2014-04-23 19:57:35
Gravatar
麦田之上
积分:101
提交:63 / 191

Gravatar
digital-T
积分:2213
提交:586 / 1311
回复 @Chenyao2333 :
B套餐还是要按照天数算的,你举的例子的话如果用B套餐必须按那一整天算的
混用是可以的,只不过白白花了一些钱罢了,但可能比其他更优

Gravatar
cstdio
积分:4748
提交:1198 / 2108
回复 @Chenyao2333 :
看样例的流……

Gravatar
(ˇˍˇ) ~耶稣
积分:216
提交:110 / 186
回复 @dxc4598 :
f_shit冯秋屌