CF1100D Dasha and Chess】的更多相关文章

题目地址:CF1100D Dasha and Chess 这是我的第一道交互题 思路不难,主要讲讲这条语句: fflush(stdout); stdout是标准输出的意思.因为有时候,我们输出到stdout的内容不能及时输出,使因为stdout的缓冲区没有满或者其他原因,fflush(stdout)就是强迫把stdout内容输出并清空stdout. 代码: #include <bits/stdc++.h> #define pii pair<int, int> #define x f…
题目链接:http://codeforces.com/contest/1100/problem/D 题目大意:给你一个999*999的图,然后有666个黑色旗子,一个白色棋子,每一次白色棋子只能在它附近的八个方位行进一步,而黑色棋子可以像象棋里面的车一样行走,然后首先输入白色棋子的方位,然后再给你666个黑色棋子的方位,你先走,然后黑色棋子再走,你走的每一步黑色棋子都能看见,然后问你怎么样才能胜利?胜利的条件是黑色棋子和白色棋子再同一行或者同一列. 具体思路:借鉴了别人的思路,我们可以首先让这个…
链接:https://codeforces.com/contest/1100 A - Roman and Browser - [暴力枚举] 题意:浏览器有 $n$ 个网页,编号 $1 \sim n$,选择一个整数 $b$,则关掉所有编号为 $b + i \cdot k$ 的网页,其中 $k$ 为给定的整数,$i$ 为任意整数.然后,留下的网页有两种类型,计算两种类型的网页数目差,要求你给出这个差最大可以是多少. 题解:$n$ 的范围很小,可以直接纯暴力做即可. AC代码: #include<bi…
以后不放水题了 C.NN and the Optical Illusion 复习一下高中数学即可 $\frac{ans}{ans+r}=\sin \frac{\pi}{n}$ 解方程 #include<cmath> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ); int n,d; double a; int main() { scanf("…
A. Roman and Browser 签到. #include <bits/stdc++.h> using namespace std; ]; int get(int b) { ]; memset(vis, , sizeof vis); int c = b; while (c <= n) { vis[c] = ; c += k; } c = b - k; ) { vis[c] = ; c -= k; } , r = ; ; i <= n; ++i) if (!vis[i]) {…
Codeforces Round #532 (Div. 2) 题目总链接:https://codeforces.com/contest/1100 A. Roman and Browser 题意: 给出由-1和1组成的n个数,现在任意选定一个起点,从起点开始向左向右k个k个地拿走.最后问abs(cnt(-1)-cnt(1))最大是多少. 题解: 由于n和k最多只有100,所以枚举起点直接暴力就好了. 代码如下: #include <bits/stdc++.h> using namespace s…
Aeroplane chess Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1597    Accepted Submission(s): 1088 Problem Description Hzz loves aeroplane chess very much. The chess map contains N+1 grids lab…
Chess Problem Description   Alice and Bob are playing a special chess game on an n × 20 chessboard. There are several chesses on the chessboard. They can move one chess in one turn. If there are no other chesses on the right adjacent block of the mov…
A Chess Game Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 3917   Accepted: 1596 Description Let's design a new chess game. There are N positions to hold M chesses in this game. Multiple chesses can be located in the same position. The…
Chess Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24    Accepted Submission(s): 10 Problem Description 小度和小良最近又迷上了下棋.棋盘一共有N行M列,我们可以把左上角的格子定为(1,1),右下角的格子定为(N,M).在他们的规则中,“王”在棋盘上的走法遵循十字路线.也就是说,…