首页 > TAG信息列表 > Dima
A. Dima and Friends【1000 / 思维】
https://codeforces.com/problemset/problem/272/A #include<bits/stdc++.h> using namespace std; int a[105],n,sum; int main(void) { cin>>n; for(int i=1;i<=n;i++) cin>>a[i],sum+=a[i]; int cnt=0; for(int i=1;i<=5;i++) { if((sum+iCodeforces Round #167 (Div. 1) E. Dima and Game
一个 $(l,r)$ 有两个后继,所以 sg 值最大只有 2,$r-l+1$ 相等的 pair 的 sg 值相同,那么就枚举 $d=r -l+1$,对于一个 $d$ 很容易求有多少对 $(l,r)$ 满足 $r-l+1=d$ 打表发现 $d$ 的 sg 值最多只有 100 段。 设 $g_i$ 表示有多少对 $(l,r)$ sg 值为 $i$,把表打出来之后就很容易求出Two Cakes
Sasha and Dima want to buy two n-tier cakes. Each cake should consist of n different tiers: from the size of 1 to the size of n. Tiers should go in order from the smallest to the biggest (from top to bottom). They live on the same street, there are 2⋅Codeforces 272D。Dima and Two Sequences,多重集的全排列
output standard output Little Dima has two sequences of points with integer coordinates: sequence (a1, 1), (a2, 2), ..., (an, n) and sequence (b1, 1), (b2, 2), ..., (bn, n). Now Dima wants to count the number of distinct sequences of points