【Codeforces 478C】Table Decorations】的更多相关文章

[链接] 我是链接,点我呀:) [题意] 给你r,g,b三种颜色的气球 每张桌子要放3个气球 但是3个气球的颜色不能全都一样 (允许两个一样,或者全都不一样) 问你最多能装饰多少张桌子 [题解] 先把每张桌子都装饰上 a,b,c三种不同颜色的气球 (显然这样的桌子最多为Math.min(r,g,b)张) 然后把气球的个数减掉 这种方法设置为ABC 然后 肯定只剩两种气球还可能有剩余 那么就用其中数量比较多的一种放2个,比较少的放1个(也是贪心,但不一定对) 这种方法定义为AAB 然后再减少A,B…
[题目链接]:http://codeforces.com/contest/765/problem/C [题意] 枚举游戏先拿到k分的人胜; 然后两个人一个人得了a分,一个人得了b分; 问你最多可能进行了多少场比赛; (要求恰好完成); [题解] 假设这些东西 t1 = a%k,t2 = b%k; w1 = a/k,w2 = b/k; 如果w1和w2都是正数,那么双方都有赢; 则可以把余数都在对方赢的那一场里面用掉; 即t1放在对方赢的某一场里面(全部); 当然; 如果都恰好整除了,即t1和t2都…
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=2000),问满足[数列长度是k && 数列中每一个元素arr[i]在1~n之间 && 数列中元素可以重复]的数列有多少个?结果对10^9+7取余 解题思路:dp[i][j]表示长度是j,最后一位是i的种数 if(kk%i==0) dp[kk][j+1]+=dp[i][j] #inc…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable. In total the table A…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the c…
[题目链接]:http://codeforces.com/contest/509/problem/A [题意] 给你一个递推式f[i][j] = f[i-1][j]+f[i][j-1]; 让你求f[i][j]的最大值; [题解] 傻逼题 [Number Of WA] 0 [完整代码] #include <bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|…
[题目链接] 点击打开链接 [算法] G中最大的数一定也是a中最大的数.          G中次大的数一定也是a中次大的数. 第三.第四可能是由最大和次大的gcd产生的 那么就不难想到下面的算法: 1. 令p为G中最大的数.在G中删除p,a中加入p.         2 . 对于a中的所有其他数(设为q),在G中删除2个gcd(p, q). 3. 若G为空则结束:否则回到(1). [代码] #include<bits/stdc++.h> using namespace std; #defin…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output People do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language, some try to become a…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequ…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output On the Literature lesson Sergei noticed an awful injustice, it seems that some students are asked more often than others. Seating in the class lo…