2019杭電多校第八場

2021-09-26 04:45:04 字數 2709 閱讀 3380

感覺慢慢陷入了疲態……

依舊是努力簽到的一天

1009:calabash and landlord

各種分類討論,交上去,wa,造資料,找到bug,改一改,交上去,wa,造資料,改一改,wa,改一改,wa…迴圈多次後ac,然後自己也不知道自己寫的是個啥了。。

後來聽群裡老哥們說只要離散化到5*5的格仔裡然後dfs就好了,明天補補看吧orz

#include

#define ll long long

using namespace std;

intf

(ll x1, ll y1, ll x2, ll y2, ll x, ll y)

//1:in 2:out 3:on

intmain()

if(x1 > x3 ||

(x1 == x3 &&

((y4 < y2 || y3 > y1)))

)if(x4 <= x2 &&

((y4 >= y2 && y3 <= y1)))

else

else

if(y1 == y3 || y2 == y4)

else

printf

("5\n");

continue;}

}else

if(x1 == x3)

else

if(y1 == y3 || y2 == y4)

else

printf

("5\n");

continue;}

else

if(y1 == y3 && y2 == y4)

//x都不相等

else

if(y1 == y3 || y2 == y4)

else

}int in =

0, out =0;

int t1 =

f(x1,y1,x2,y2,x3,y3)

;int t2 =

f(x1,y1,x2,y2,x3,y4)

;int t3 =

f(x1,y1,x2,y2,x4,y3)

;int t4 =

f(x1,y1,x2,y2,x4,y4);if

(t1 ==

1||t2==

1||t3==

1||t4==

1) in =1;

if(t1 ==

2||t2==

2||t3==

2||t4==

2) out =1;

if(in && out)

in =

0, out =0;

t1 =

f(x3, y3, x4, y4, x1, y1)

; t2 =

f(x3, y3, x4, y4, x1, y2)

; t3 =

f(x3, y3, x4, y4, x2, y1)

; t4 =

f(x3, y3, x4, y4, x2, y2);if

(t1 ==

1||t2==

1||t3==

1||t4==

1) in =1;

if(t1 ==

2||t2==

2||t3==

2||t4==

2) out =1;

if(in && out)

if(x1 == x3 && x2 == x4)

else

if(y1 == y3 && y2 == y4)

else

printf

("3\n");

}}

1010: quailty and ccpc

按題意模擬即可。如果用結構體排序的話,不要把名字也存在結構體裡面,只要存乙個編號就可以了,不然會t。

#include

#include

using namespace std;

const

int maxn=

1e5+5;

struct team

tea[maxn]

;string name[maxn]

;bool cmp

(team t1,team t2)

intmain()

int ans=n*d;

if(ans%

10!=

5)cout<<

"quailty is very great\n"

;else

}}

1011: roundgod and milk tea

對於每個班級求一下有多少牛奶一定送不出去,這樣得到了可以送出去的牛奶數量,和總人數求乙個min就是答案。

#include

#define ll long long

using namespace std;

const

int maxn =

1e6+50;

ll a[maxn]

, b[maxn]

;int

main()

for(

int i =

0; i < n;

++i)

printf

("%lld\n"

,min

(sum - res, p));

}}

杭電多校第八場

1003 題目鏈結 clockwise or counterclockwise 水題,經歷過牛客應該知道叉積可以判斷順逆時針。叉積參考 叉積 參考 include include include include include include include include include incl...

杭電多校2020第八場

isomorphic strings 題意 兩個字串s,t互為cyclical isomorphic,當且僅當s將前x個字元移到末尾後,s與t想等,例如s abcde,t deabc,那麼s和t互為cyclical isomorphic。給定乙個s串,長度為n,k為n的因子,現在將s分成k個等長的字...

2019 杭電多校第八場 hdu 6660 構造

題意 給你乙個 和乙個 讓你放置n m個陷阱,現在讓你構造出一條路徑,使得每個點只走一次,然後本次的位置與上一次的位置的 euclidean distance 要嚴格大於 小於 這裡 euclidean distance 的計算就是sqrt x1 x2 2 y1 y2 2 題解 我們經過手推幾組發現...