题意: 在一个 n x n 的平面上,给定 m 个等腰直角三角形(各点均为整数),问该平面上被三角形覆盖奇数次的点有多少个. 思路: 由于 n 较大,不能模拟解决,故使用离散化思想. 考虑每一行有多少点被覆盖了奇数次,题目从二维转换成一维. 对于每一行,考虑每个三角形在此行覆盖的线段,记录下每条线段的左端点 l .右端点 r 保存在同一个数组中. 排序后则容易知道第一个到第二个数.第三到第四个数...的部分是覆盖奇数次,以此累加结果. 代码: #include<iostream> #inclu…
题目链接: http://acm.hust.edu.cn/vjudge/problem/87213 Strange Antennas Time Limit: 3000MS 题意 一个雷达能够辐射到的范围为等腰三角形,现在给你雷达的坐标,辐射范围和方向,问你求被奇数个雷达辐射到的网格有多少个. 题解 首先,雷达是建在交叉点上的,而考虑覆盖范围是在网格上的,所以需要坐标转换(题目样例第四行有错,应为1,5,4,0). 其次我们可以考虑每一行都做一遍,然后枚举每个雷达对这一行的影响,没个雷达对这一行的…
Strange Antennas Problem's Link: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=87213 Mean: 给你一个N*N的网格,有M个雷达,每个雷达的扫射区域是一个直角边长为P的等腰直角三角形,能够向以直角顶点为中心的四个象限扫射. 雷达之间存在信号屏蔽,只有被奇数个雷达扫射到的区域才能被信号覆盖.求被信号覆盖的区域是多少. analyse: 因为给的都是整数点,这样就不涉及到计算几何了. N…
A:Banks 代码: #include<bits/stdc++.h> using namespace std; #define Fopen freopen("_in.txt","r",stdin); freopen("_out.txt","w",stdout); #define LL long long #define ULL unsigned LL #define fi first #define se sec…
D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if…
题目来源:http://codeforces.com/problemset/problem/55/D Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue wit…
E. Hanoi Factory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Of course you have heard the famous task about Hanoi Towers, but did you know that there is a special factory producing the…
链接: https://vjudge.net/problem/CodeForces-55D 题意: Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with…
Description Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with this and just count the quantity of b…
Sona Time Limit:5000MS     Memory Limit:65535KB     64bit IO Format: Submit Status Practice NBUT 1457 Appoint description:  Description Sona, Maven of the Strings. Of cause, she can play the zither. Sona can't speak but she can make fancy music. Her…