首页 > TAG信息列表 > Vanya

CF492D 【Vanya and Computer Game】题解--zhengjun

竟然又没有人做这题了 一道二分题 其实就是要找什么时候这个怪兽被打了 \(a_i\) 次,可以知道,这是有单调性的,我们就可以二分。 因为 \(Vanya\) 一秒打 \(x\) 次,那么每 \(\frac{1}{x}\) 他就打一次,所以我们直接把 \(mid\div x+mid\div y\) 就知道这个怪兽在 \(mid\) 秒时被打了几次。

CF492E Vanya and Field

题目大意: 一天,Vanya 来到了一片滑稽树林中,准备采摘滑稽果。滑稽树林可看作一个 n×n 的正方形,其中 m 个点上有滑稽果,某些点没有。(注意一个点上可能有多个滑稽果) Vanya会沿向量 (dx,dy)(dx,dy) 方向移动。也就是说,如果Vanya在 (x,y) 处,她将移动到 ((x+dx) mod n,(y+dy) mo

[CF552C] Vanya and Scales - 贪心

[CF552C] Vanya and Scales - 贪心 Description 能否通过 w 的幂次(不重复)的加减得到 m Solution 考虑 w>2 的情况,当前最低幂次,我们能取的无非是 +1,0,-1,且取完后剩余的一定得被 w 整除,那么我们只要根据这个条件贪心调整就可以了 #include <bits/stdc++.h> using namespace std; s

A. Vanya and Cubes(水题)

题意:给Vanya  n个方块,用来堆塔,塔的第i层有1+2+3+......+i个,问给出的方块最多能堆几层,输出层数。 题解:时间没有限制,所以用简单的for循环求和就可以解决。主要是bug改了几次。。。 ACcode:   int main() { int n; cin >> n; int sum = 0, hei = 0, total = 0; for (int i = 1;

Vanya and Scales CodeForces - 552C (思维)

大意: $101$个砝码, 重$w^0,w^1,...,w^100$, 求能否称出重量$m$.   w<=3时显然可以称出所有重量, 否则可以暴力双端搜索. #include <iostream>#include <sstream>#include <algorithm>#include <cstdio>#include <math.h>#include <set>#include <map>#include &l

Codeforces 677 - A/B/C/D/E - (Undone)

链接: A - Vanya and Fence - [水] AC代码: #include<bits/stdc++.h>using namespace std;const int maxn=1e3+5;int n,h;int main(){ cin>>n>>h; int ans=0; for(int i=1,a;i<=n;i++) { cin>>a; if(a<=h) ans++;