Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game on 8 to 8 board to too simple, he uses an infinite one instead. The first task he faced is to check…
题目链接: http://codeforces.com/contest/734/problem/D D. Anton and Chess time limit per test4 secondsmemory limit per test256 megabytes 问题描述 Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that pla…
http://codeforces.com/contest/734/problem/D 一开始的时候看不懂题目,以为象是中国象棋那样走,然后看不懂样例. 原来是走对角线的,长知识了. 所以我们就知道,王有八个方向,所以每个方向选一个来做代表就行了. 那么选谁呢?可以排序,按照他们离王的距离从小到大排,这样就能选出最近的那个(不用被棋挡住) 然后注意下方向的表达,在王的右上角,还要和王在同一对角线才行~不能简单地判x和y的大小关系 #include <cstdio> #include <c…
D. Anton and Chess 题目连接: http://codeforces.com/contest/734/problem/D Description Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game on 8 to 8 board to…
题目链接:http://codeforces.com/contest/734/problem/D D. Anton and Chess time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Anton likes to play chess. Also, he likes to do programming. That is why…
Anton and Chess time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. H…
CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <set> #include <map> #include <queue>…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the…
http://codeforces.com/group/1EzrFFyOc0/contest/734/problem/D 题意:就是给你一个很大的棋盘,给你一个白棋的位置还有n个黑棋的位置,问你黑棋能否一步就吃掉白棋 给你如下规则 1.‘B‘只能对角线移动,而且不能越过其他黑棋. 2.’R‘只能上下左右移动,而且不能越过其他黑棋. 3.‘Q’既能对角线移动又能左右移动,但是不能越过其他黑棋. 这是看了别人的代码,很长,但只是粘贴复制,再改一下一下就行了: #include<iostream>…
http://codeforces.com/problemset/problem/747/C 题意:有n台机器,q个操作.每次操作从ti时间开始,需要ki台机器,花费di的时间.每次选择机器从小到大开始,如果可以完成任务,那么输出id总和,否则输出-1. 思路:简单的模拟,注意如果不能完成任务,那么ser数组是不能更新的. #include <cstdio> #include <algorithm> #include <iostream> #include <cs…