题目链接:http://codeforces.com/problemset/problem/321/A 题意:在一个二维平面中,開始时在(0,0)点,目标点是(a.b),问能不能通过反复操作题目中的指令,从原点移动到目标点. 分析:如果一次完毕全部的命令后.移动到了(xx,yy),而且从(Xi.Yi)反复操作k次指令到达目标点.则能够列出方程 Xi + k * xx = a && Yi + k * yy = b.然后解出k.推断k是否大于等于0就可以. #include <cstdi…
唔...这题是数学题. 比赛时做出来,但题意理解错了,以为只要判断那点是不是在线上就行了,发现过不了样例就没提交. 思路:记录每一步的偏移,假设那点是在路径上的某步,然后回推出那一个周期的第一步,判断是不是在线上就行了. 本来用斜率做,没考虑斜率不存在的情况. 重新写了一遍,过了前十个样例.但是在追加的-1 -1 UR卡住了. 三鲜大神说: kx + b = y,判断整除就可以了.(orz) 于是想了一下,开始考虑整除,写了个判断的函数来判断就行了.(蒻菜只能写出又长又臭的判断) 代码: #in…
A. Ciel and Robot time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Fox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was repre…
C. Ciel and Robot time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Fox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was repre…
题目描述: Ciel the Commander time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Now Fox Ciel becomes a commander of Tree Land. Tree Land, like its name said, has n cities connected by n - 1 undire…
[题目链接]:click here~~ [题目大意]:一个robot 机器人 .能够依据给定的指令行动,给你四种指令,robot初始位置是(0,0).指令一出.robot会反复行动,推断是否能在无限行动的情况下经过点(n,m). [解题思路]事实上细致模拟一下,能够发现是有周期的.推断就可以,见代码吧~~ 代码: #include <iostream> #include <algorithm> #include <bits/stdc++.h> using namespa…
A. Robot Bicorn Attack Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/175/problem/A Description Vasya plays Robot Bicorn Attack. The game consists of three rounds. For each one a non-negative integer amount of points is gi…
Ciel the Commander Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 321C64-bit integer IO format: %I64d      Java class name: (Any) Now Fox Ciel becomes a commander of Tree Land. Tree Land, like its na…
传送门:http://codeforces.com/problemset/problem/321/E [题解] 首先有一个$O(n^2k)$的dp. # include <stdio.h> # include <string.h> # include <iostream> # include <algorithm> // # include <bits/stdc++.h> using namespace std; typedef long lon…
题目链接   Ciel and Flipboard 题意  给出一个$n*n$的正方形,每个格子里有一个数,每次可以将一个大小为$x*x$的子正方形翻转 翻转的意义为该区域里的数都变成原来的相反数. 求经过若干次操作之后整个正方形的所有数之和. 这题关键就是要知道这个结论. 假设$st[i][j]$为$a[i][j]$的翻转情况($st[i][j] = 0$ 不翻转  $st[i][j] = 1$ 翻转) 那么一定有 $st[i][j]$ xor $st[i][x]$ xor $st[i][j…