当前位置:网站首页>[summer daily question] Luogu p6320 [coci2006-2007 4] sibice
[summer daily question] Luogu p6320 [coci2006-2007 4] sibice
2022-07-29 07:28:00 【AC_ Dragon】
Topic link :P6320 [COCI2006-2007#4] SIBICE - Luogu | New ecology of computer science education (luogu.com.cn)
Background
Beardless Mirko Throw matches everywhere . His mother wanted him to put the matches in the box .
Title Description
Mirko Now I want to place n A match , He has one w×h Rectangular box .
He now wants you to judge this n Whether each match can be put into this box .
We can think of the box as a plane , Just judge whether the match can be put down in this plane .
Input format
Enter the first three integers n,w,h.
Next n That's ok , Each row of a [1,1000] An integer in an interval , Indicates the length of a match .
Output format
The output, n That's ok , For each match , Output DA It means it can be put down , Otherwise output NE Can't put down .
Examples #1
The sample input #1
5 3 4
3
4
5
6
7Sample output #1
DA
DA
DA
NE
NEExamples #2
The sample input #2
2 12 17
21
20Sample output #2
NE
DATips
Data scale and agreement
about 100% The data of , Guarantee 1 <= n <= 50,1 <= w,h <= 100.
explain
The title is translated from COCI2006-2007 CONTEST #4 T1 SIBICE
AC code:
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
int n;
cin>>n;
int a,b;
cin>>a>>b;
double c; // Diagonal length
c=sqrt(a*a+b*b);
while(n--)
{
int x;
cin>>x;
if(x<=c)
cout<<"DA"<<endl;
else
cout<<"NE"<<endl;
}
return 0;
}边栏推荐
猜你喜欢

gcc/g++的使用

Using C language to skillfully realize the chess game -- Sanzi chess

STM32 operation w25q256 w25q16 SPI flash

SpingBoot整合Quartz框架实现动态定时任务(支持实时增删改查任务)

新生代公链再攻「不可能三角」

WPF simple login page completion case

Thinkphp6 realizes database backup

梳理市面上的2大NFT定价范式和4种解决方案
Scala higher order (IX): pattern matching in Scala

Round avatar of user list and follow small blocks
随机推荐
LevelFilter简介说明
国内数字藏品的乱象与未来
logback 中FileAppender具有什么功能呢?
WPF nested layout case
Practice of online problem feedback module (XVII): realize the online download function of excel template
mysql 单表最多能存多少数据?
How to establish EDI connection with Scania in Scania?
zip gzip tar压缩进阶版
Vue router route cache
What is the function of fileappender in logback?
BeanUtils.setProperty()
[summer daily question] Luogu p6336 [coci2007-2008 2] bijele
js第四天流程控制(if语句和switch语句)
Synchronous / asynchronous, blocking / non blocking and IO
零数科技深度参与信通院隐私计算金融场景标准制定
20-40k | mecarmand 3D vision algorithm / software / Product Manager Recruitment
log4qt内存泄露问题,heob内存检测工具的使用
STM32 operation w25q256 w25q16 SPI flash
Segger's hardware anomaly analysis
My personal website doesn't allow access to wechat, so I did this