
思维
西伯利亚松鼠
退役ACMer,退役MOer
展开
-
Codeforces Round #720 (Div. 2) B. Nastia and a Good Array 思维
B. Nastia and a Good Arraysolution一开始想的是用质数将一半的点更改掉,WA3,然后用1e9+7开始不断增加来替代原序列结果WA2,最后想到直接找到最小值,向两边递增即可。code/*SiberianSquirrel*//*CuteKiloFish*/#include <bits/stdc++.h>using namespace std;using ll = long long;const ll MOD = ll(1e9 + 7);const原创 2021-05-08 11:04:37 · 811 阅读 · 1 评论 -
Codeforces Global Round 14 D. Phoenix and Socks 思维
D. Phoenix and Sockssolution除去相同颜色的已配对袜子,剩余袜子遍历颜色考虑:当前l总大于r总且a[i][0]>1,则只需一次把l变成r的费用当前l_总大于r_总且a[i][0]>1,则只需一次把l变成r的费用当前l总大于r总且a[i][0]>1,则只需一次把l变成r的费用当前r总大于l总且a[i][1]>1,则只需一次把r变成l的费用当前r_总大于l_总且a[i][1]>1,则只需一次把r变成l的费用当前r总大于l总且a[i][1原创 2021-05-03 18:53:57 · 890 阅读 · 0 评论 -
Codeforces Round #485 (Div. 1) B. Petr and Permutations 思维
B. Petr and Permutationsinput52 4 5 1 3outputPetrcode//Siberian Squirrel#include<bits/stdc++.h>#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)#define ACM_LOCALusing namespace std;typedef long long ll;const int INF = 0x3原创 2021-03-03 18:17:48 · 148 阅读 · 1 评论 -
Codeforces Round #481 (Div. 3) E. Bus Video System 思维
E. Bus Video Systeminput4 102 4 1 2output2code//Siberian Squirrel#include<bits/stdc++.h>#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)#define ACM_LOCALusing namespace std;typedef long long ll;const int INF = 0x3f3f3f3f原创 2021-03-03 16:23:22 · 719 阅读 · 1 评论 -
Codeforces Round #701 (Div. 2) B. Replace and Keep Sorted 思维
B. Replace and Keep Sortedinput6 5 102 4 6 7 8 91 41 23 51 65 5output89769code//Siberian Squirrel//#include<bits/stdc++.h>#include<unordered_map>#include<algorithm>#include<iostream>#include<cstring>#inc原创 2021-02-22 08:48:59 · 796 阅读 · 0 评论 -
吃糖果 HDU - 1205 思维
HOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。input234 1 155 4 3 2 1outputNoYescode//Siberian Squirrel//#include<bits/stdc++.h>//#include<unordered_m原创 2021-02-21 13:44:26 · 696 阅读 · 0 评论 -
Codeforces Round #703 (Div. 2) B. Eastern Exhibition 思维
Codeforces Round #703 (Div. 2) B. Eastern Exhibitioninput630 02 01 241 00 22 33 140 00 11 01 120 01 120 02 020 00 0output144431solution分别找x,y方向上的中位数分别找x,y方向上的中位数分别找x,y方向上的中位数code//Siberian Squirrel//#include<bits/st原创 2021-02-20 16:43:47 · 708 阅读 · 0 评论