WA之codeforces之144B
来源:互联网 发布:php use和include区别 编辑:程序博客网 时间:2024/06/06 03:40
显性运行结果是对的,但一直RuntimeError。。。
题目
Problem B : Meeting
RE代码
#include <iostream>
#include <math.h>
using namespace std;
int a[3000][3000];
double dis(int x,int y,int x1,int y1)
{
double a,b;
a=x-x1;
b=y-y1;
a=a*a;
b=b*b;
return sqrt(a+b);
}
int main()
{
int x1,y1,x2,y2,t;
int x3,y3,r;
int i,j,k,i1;
int sum=0;
cin>>x1>>y1>>x2>>y2;
if(x1>x2)
{
t=x1;
x1=x2;
x2=t;
}
if(y1>y2)
{
t=y1;
y1=y2;
y2=t;
}
for(i=x1; i<=x2; i++)
{
for(j=y1; j<=y2; j++)
a[i][j]=1;
}
for(i=x1+1; i<=x2-1; i++)
{
for(j=y1+1; j<=y2-1; j++)
a[i][j]=0;
}
cin>>k;
for(i1=0; i1<k; i1++)
{
cin>>x3>>y3>>r;
for(i=x1; i<=x2; i++)
{
for(j=y1; j<=y2; j++)
{
if(a[i][j]!=0)
{
if(dis(i,j,x3,y3)<=r)
a[i][j]=0;
}
}
}
}
for(i=x1; i<=x2; i++)
{
for(j=y1; j<=y2; j++)
{
if(a[i][j]==1)
sum++;
}
}
cout<<sum;
return 0;
}
- WA之codeforces之144B
- WA恶之源
- DP 之 codeforces 416B
- codeforces 863B 之 Kayaking
- ACM之AC,WA,orPE?
- HDU 5192 [迷之WA!]
- SSD 之WA写入放大
- SSD 之WA写入放大
- 解题报告 之 CodeForces 91B Queue
- CodeForces 731B 之 Coupons and Discounts
- codeforces 749B (ACM出线之路)
- codeforces 864B 之 Polycarp and Letters
- HDU4150-字符串匹配-WA之路
- codeforces 748B(水) ACM出线之路
- Codeforces Round #392 (Div. 2) A、B之我是zz
- codeforces 839b 之 Game of the Rows
- codeforces 835b 之 The number on the board
- HDU 1002 之常见WA(C++描述)
- LeetCode之Binary Tree Level Order Traversal II
- 【513】 Find Bottom Left Tree Value
- Maximum Gap
- 【Eclipse】配置MySQL
- 测试
- WA之codeforces之144B
- JS中innerHTML与value、val的用法区别
- 总结套路:Ajax请求下载文件的问题
- 关于java线程池
- 创建和显示窗口
- 沃尔玛
- python-web开发1
- SQL Date 函数
- Ubuntu安装MySQL