Educational Codeforces Round 24 CF 818 A-G 补题

6月快要结束了 期末也过去大半了 马上就是大三狗了

取消了小学期后20周的学期真心长, 看着各种北方的学校都放假嗨皮了,我们这个在北回归线的学校,还在忍受酷暑。

过年的时候下定决心要拿块ACM的牌子,一直坚持刷题,这一个学期刷了200道吧,感觉还是小有收获。特别是Ural和Codeforces上的题,质量很高。

然后4月的校赛,5月的省赛,发挥的也一般,不过也没有太失常。

希望暑假的选拔赛能碰到有趣的队友 蛤蛤。

这两天各种考试,实在是太忙,看了一下edu24的题目,不是很容易,做了一道水题,以后再回来补吧。

Diplomas and Certificates

 

#include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
const LL N=1,M=1,MOD=1;

int main()
{//freopen("t.txt","r",stdin);
 ios::sync_with_stdio(false);
 LL n,k;
 scanf("%I64d%I64d",&n,&k);
 k++;
 LL l=0,r=(n/2)/k,ret=0;
 while(l<=r)
 	{
 	 LL mid=(l+r)>>1;
 	 if(mid*k>(n/2))r=mid-1;
 	 	else ret=mid,l=mid+1;
	}
 printf("%I64d %I64d %I64d\n",ret,ret*(k-1),n-ret*k);
 return 0;
}

  

Permutation Game

Sofa Thief

Multicolored Cars

Card Game Again

Level Generation

Four Melodies

时间: 2024-12-20 04:43:32

Educational Codeforces Round 24 CF 818 A-G 补题的相关文章

Educational Codeforces Round 74 (Rated for Div. 2)补题

慢慢来. 题目册 题目 A B C D E F G 状态 √ √ √ √ × ? ? //√,×,? 想法 A. Prime Subtraction res tp A 题意:给定\(x,y(x>y)\),问能否将\(x-y\)拆成任意多个质数之和 1.任意大于\(1\)的整数\(k\)都可以用\(2\)与\(3\)的线性表示 证: 若\(k\)是偶数,显然: 若\(k\)是奇数,则\(k\)可以表示成\(k = 3 + 2*k'\),显然: 毕. #include<bits/stdc++.h&

Educational Codeforces Round 78 (Rated for Div. 2) --补题

链接 直接用数组记录每个字母的个数即可 #include<bits/stdc++.h> using namespace std; int a[26] = {0}; int b[26] = {0}; int judge() { //cout<<"111"<<endl; for (int i = 0; i < 26; ++i) { if (a[i]!=b[i]) { return 0; } } return 1; } int main() { //

Educational Codeforces Round 24 F. Level Generation(三分)

题目链接:Educational Codeforces Round 24 F. Level Generation 题意: 给你n个点,让你构造ans条边,使得这ans条边中至少有一半是桥. 让你求ans的最大值. 题解: 首先我们将每一个点按顺序连起来,那么可以构成n-1个桥. 然后我们可以把其中的x个点拿出来连边,这些边都不是桥. x个点最多能连x*(x-1)条边,然后剩下的n-x个点连的边将会构成桥. 然后就可以构造一个函数关系,详见check函数,然后三分一下就行了. 1 #include

Educational Codeforces Round 24 E

Vova again tries to play some computer card game. The rules of deck creation in this game are simple. Vova is given an existing deck of n cards and a magic number k. The order of the cards in the deck is fixed. Each card has a number written on it; n

Educational Codeforces Round 24

陷入了一种每场比赛打完都不想改题的虚无状态,不能这样,改题改题改题. 昨晚只写了三道题意即题解的题…感觉意识模糊,看了看是unrated就睡了 CF已经连续三场unrated了qwq,我一共就没打过几场 A. Diplomas and Certificates 题意:拿到certificate的人数将会是拿到diploma人数的k倍,但拿到他们的总人数不能超过n/2 把n/2向下取底分成k+1分 #include<iostream> #include<cstdio> #includ

Educational Codeforces Round 24 D

Alice and Bob got very bored during a long car trip so they decided to play a game. From the window they can see cars of different colors running past them. Cars are going one after another. The game rules are like this. Firstly Alice chooses some co

Educational Codeforces Round 24 A

There are n students who have taken part in an olympiad. Now it's time to award the students. Some of them will receive diplomas, some wiil get certificates, and others won't receive anything. Students with diplomas and certificates are called winner

Educational Codeforces Round 24 B

n children are standing in a circle and playing a game. Children's numbers in clockwise order form a permutation a1,?a2,?...,?an of length n. It is an integer sequence such that each integer from 1 to n appears exactly once in it. The game consists o

Educational Codeforces Round 5 E. Sum of Remainders (思维题)

题目链接:http://codeforces.com/problemset/problem/616/E 题意很简单就不说了. 因为n % x = n - n / x * x 所以答案就等于 n * m - (n/1*1 + n/2*2 ... n/m*m) 在根号n复杂度枚举x,注意一点当m>n时,后面一段加起来就等于0,就不用再枚举了. 中间一段x1 ~ x2 的n/x可能相等,所以相等的一段等差数列求和. 1 //#pragma comment(linker, "/STACK:1024