B. Berland Crossword \(直接去枚举四个角落,注意枚举的方法,本题如何写的简洁很关键.\) #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0 ...
分类:
其他好文 时间:
2021-03-05 13:15:01
阅读次数:
0
如果一个数组$[a_1,a_2,a_3,...,a_n]a_1=n-1$并且$a1>0$,这个数组就被叫为好数组,如果一个序列能正好分为多个好数组,ta就被叫为好序列,现在给定一个序列,求这个序列有多少好子序列,答案对$998244353$取模 ...
分类:
其他好文 时间:
2021-03-05 13:10:49
阅读次数:
0
水~。 注意右半部为$0$的情况。 int main() { int T; cin>>T; while(T--) { string s; cin>>s; string a=s.substr(0,s.size()/2),b=s.substr(s.size()/2); int ts=stoi(s),ta ...
分类:
其他好文 时间:
2021-03-04 13:05:25
阅读次数:
0
[P6154] 游走 - 期望 Description 给定一个有向无环图,求其中一条路径长度的期望。 Solution 一条路径长度的期望 = 所有路径长度和 / 所有路径条数 计算这两个东西用 dp,设 \(f[i]\) 为 i 出发的路径的长度和,\(c[i]\) 为 i 出发的路径的条数 转 ...
分类:
其他好文 时间:
2021-03-03 12:02:11
阅读次数:
0
{ //http://www.360doc.com/content/14/0413/16/15099545_368549362.shtml } GCC/Clang生成和链接静态库/动态库 { 1 2 3 4 5 //add.cpp int add(int a, int b) { return a + ...
分类:
编程语言 时间:
2021-03-01 14:16:36
阅读次数:
0
call plug#begin('~/.vim/plugged')""Plug 'itchyny/lightline.vim'"Plug 'Yggdroot/LeaderF', { 'dir': '~/LeaderF', 'do': './install --all' }" Plug 'junegu ...
分类:
系统相关 时间:
2021-03-01 13:04:40
阅读次数:
0
A - Circle #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int r; int main(){ cin >> r; cout << r * r << end ...
分类:
其他好文 时间:
2021-02-24 13:15:50
阅读次数:
0
https://codeforces.com/contest/1490/problem/G 二分循环几轮,再二分哪个位置刚好够。 1 #define IO std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); 2 #define bug(x) co ...
分类:
其他好文 时间:
2021-02-24 13:01:05
阅读次数:
0
状态表示: \(f[len][cnt]\):当前为len位,已经统计的$0$的个数为cnt,不计前导$0$。 注意点: 由于前导$0$标识符lead的存在,如果左边界为$0$需要作加一处理。 LL f[15][15]; int a[15]; LL dfs(int len,int cnt,bool l ...
分类:
其他好文 时间:
2021-02-22 12:28:38
阅读次数:
0
1import java.util.HashMap; 2import java.util.Map; 3 4/** 5 * 1. 两数之和 6 * 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 的那 两个 整数,并返回它们的数组下标。 7 * <p> 8 ...
分类:
其他好文 时间:
2021-02-22 11:54:49
阅读次数:
0