当前位置:网站首页>A. Marathon
A. Marathon
2022-06-29 15:36:00 【Felven】
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
You are given four distinct integers aa, bb, cc, dd.
Timur and three other people are running a marathon. The value aa is the distance that Timur has run and bb, cc, dd correspond to the distances the other three participants ran.
Output the number of participants in front of Timur.
Input
The first line contains a single integer tt (1≤t≤1041≤t≤104) — the number of test cases.
The description of each test case consists of four distinct integers aa, bb, cc, dd (0≤a,b,c,d≤1040≤a,b,c,d≤104).
Output
For each test case, output a single integer — the number of participants in front of Timur.
Example
input
Copy
4 2 3 4 1 10000 0 1 2 500 600 400 300 0 9999 10000 9998
output
Copy
2 0 1 3
Note
For the first test case, there are 22 people in front of Timur, specifically the participants who ran distances of 33 and 44. The other participant is not in front of Timur because he ran a shorter distance than Timur.
For the second test case, no one is in front of Timur, since he ran a distance of 1000010000 while all others ran a distance of 00, 11, and 22 respectively.
For the third test case, only the second person is in front of Timur, who ran a total distance of 600600 while Timur ran a distance of 500500.
解题说明:水题,直接判断大小即可。
#include"stdio.h"
#include"math.h"
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
int a[4];
int i, e = 0;
for (i = 0; i<4; i++)
{
scanf("%d", a + i);
}
for (i = 1; i<4; i++)
{
if (a[i]>a[0])
{
e++;
}
}
printf("%d\n", e);
}
return 0;
}边栏推荐
猜你喜欢

12.udp protocol -bite

《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(五)

《网络是怎么样连接的》读书笔记 - 服务器端的局域网中(四)

14.ip protocol -bite

Business Intelligence BI and business management decision-making thinking No. 3: business quality analysis

C learning 2: heap and stack

墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG资料124篇)

#夏日挑战赛# HarmonyOS - 方舟开发框架ArkUI 流光按钮效果

Interviewer: tell me about the MySQL transaction isolation level?

GWD: rotating target detection based on Gaussian Wasserstein distance | ICML 2021
随机推荐
Autodesk Revit 2023软件安装包下载及安装教程
Motion capture system for apple picking robot
Mingdeyang xilinx-k7-325t/410t core board data manual
再也不用担心窗体变形了
瓜分1000+万奖金池,昇腾AI创新大赛2022实力赋能开发者
The way of enterprise transformation and upgrading: digital transformation, thinking first
C語言大作業——匹配系統
商业智能BI与业务管理决策思维之三:业务质量分析
DataKit 作为本地获取数据的 API 服务器
【云原生】Nacos-TaskManager 任务管理的使用
11.应用层数据传输格式/端口号-bite
11. application layer data transmission format / port number -bite
绑定证券账户到同花顺安全吗?哪家券商开户后可以绑定同花顺
The role of each layer in convolutional neural network
13.TCP-bite
Taro 小程序开启wxml代码压缩
Building SQL statements in Excel
Taro中添加小程序 “lazyCodeLoading“: “requiredComponents“,
CVPR 2022 | 大幅减少零样本学习所需的人工标注,马普所和北邮提出富含视觉信息的类别语义嵌入
从第三次技术革命看企业应用三大开发趋势