CF991C】的更多相关文章

CF991C Candies 洛谷评测传送门 题目描述 After passing a test, Vasya got himself a box of nn candies. He decided to eat an equal amount of candies each morning until there are no more candies. However, Petya also noticed the box and decided to get some candies fo…
题解: 很显然不会有那么多种肯能 所以都列出来即可 代码: #include<bits/stdc++.h> using namespace std; int main() { ]; scanf(],&k[],&k[]); sort(k+,k+); puts(k[]==||k[]==&&(k[]==||k[]==&&k[]==) ||k[]==&&k[]==?"YES":"NO"); }…
Candies time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output After passing a test, Vasya got himself a box of nn candies. He decided to eat an equal amount of candies each morning until there ar…
题面传送门 解决思路 看到 \(10^{18}\) 的范围,我们可以想到二分答案.只要对于每一个二分出的答案进行 \(check\) ,如果可行就往比它小的半边找,不可行就往比它大的半边找. 以下是 \(check\) 的过程(以不可行返回 \(true\) 为例): bool check(long long x){ long long v=0,N=n; //v代表Vasya吃掉的,N代表总共剩余的 while(N){ if(N<=x){ //如果不够Vasya吃一次了 v+=N; //Vasy…
收录已发布的题解 按发布时间排序. 部分可能与我的其他文章有重复捏 qwq . AtCoder for Chinese: Link ZHOJ: Link 洛谷 \(1\sim 5\) : [题解]CF45I TCMCF+++ [题解]CF1013B And [题解]CF991C Candies [题解]CF356A Knight Tournament [题解]CF1715A Crossmarket \(6\sim 10\) : [题解]CF1215C Swap Letters [题解]CF172…