P4273 [NOI2004] 降雨量

Aimee

把马路竖起来,横轴是时间

那么显然扫过的面积就是遮挡的水量

之后就是计算几何的事了

#include
#include
#include
#include
#include
using namespace std;
int n,k;
int xx[505],yy[505];
int x,y;
struct b{
    int f;
    int t;
    double l;
} ed[2500];
int fa[100001];
int bl[2500];
struct re{
    int lx,rx,uy,dy;
}rec[2500];
re tem;
re recc[5];
int find(int x){
    return fa[x]==x?x:fa[x]=find(fa[x]);
}
int f(int x){
    return x*x;
}
int di(int x,int y){
    return f(xx[x]-xx[y])+f(yy[x]-yy[y]);
}
bool cmp(b x,b y){
    return x.l=recc[i].lx&&recc[i].dy>=yy&&recc[i].uy<=yy);
}
bool che(int x,int xx,int yy){
    for(int i=1;i<=cnt;++i){
        if(i==x)
        continue;
        if(ch(x,recc[i].lx,recc[i].dy)||
        ch(x,recc[i].lx,recc[i].uy)||
        ch(x,recc[i].rx,recc[i].dy)||
        ch(x,recc[i].rx,recc[i].uy))
        return 0;
    }
    return 1;
}
void kr(int i,int s){
    if(s>znx){
        return ;
    }
    if(i==n+1){
        if(cnt==k) 
        znx=s;
        return ;
    }
    if(cnt

```
`那么显然扫过的面积就是遮挡的水量

之后就是计算几何的事了

#include
#include
#include
#include
#include
using namespace std;
int n,k;
int xx[505],yy[505];
int x,y;
struct b{
    int f;
    int t;
    double l;
} ed[2500];
int fa[100001];
int bl[2500];
struct re{
    int lx,rx,uy,dy;
}rec[2500];
re tem;
re recc[5];
int find(int x){
    return fa[x]==x?x:fa[x]=find(fa[x]);
}
int f(int x){
    return x*x;
}
int di(int x,int y){
    return f(xx[x]-xx[y])+f(yy[x]-yy[y]);
}
bool cmp(b x,b y){
    return x.l=recc[i].lx&&recc[i].dy>=yy&&recc[i].uy<=yy);
}
bool che(int x,int xx,int yy){
    for(int i=1;i<=cnt;++i){
        if(i==x)
        continue;
        if(ch(x,recc[i].lx,recc[i].dy)||
        ch(x,recc[i].lx,recc[i].uy)||
        ch(x,recc[i].rx,recc[i].dy)||
        ch(x,recc[i].rx,recc[i].uy))
        return 0;
    }
    return 1;
}
void kr(int i,int s){
    if(s>znx){
        return ;
    }
    if(i==n+1){
        if(cnt==k) 
        znx=s;
        return ;
    }
    if(cnt
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇
Theme Argon By solstice23