摘要:
嘟嘟嘟 因为数据只有5000,所以可以O(n2)暴力。 首先预处理二维前缀和,然后枚举正方形的左上角,将每一次的得到的总价值去最大,作为答案。 1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<cstri 阅读全文
posted @ 2018-08-18 16:52
mrclr
阅读(400)
评论(0)
推荐(0)
摘要:
嘟嘟嘟 裸的最小生成树。 1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<cstring> 5 #include<cmath> 6 #include<cstdlib> 7 #include<vector 阅读全文
posted @ 2018-08-18 10:31
mrclr
阅读(191)
评论(0)
推荐(0)
摘要:
嘟嘟嘟 一道博弈论经典题,nim游戏。 只不过要考虑有奇数个石子为1的堆的时候,为Brother赢。剩下就是nim游戏了。 极简代码 1 #include<cstdio> 2 using namespace std; 3 4 int T; 5 6 int main() 7 { 8 scanf("%d 阅读全文
posted @ 2018-08-18 09:51
mrclr
阅读(137)
评论(0)
推荐(0)