当前位置:网站首页>A. Marathon
A. Marathon
2022-06-29 21:35: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.
Problem solving instructions : Water problem , Just judge the size directly .
#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;
}边栏推荐
- How to judge the quality of conductive slip ring from its appearance
- 【ROS进阶篇】第三讲 ROS文件系统与分布式通信
- Getting started with completabilefuture
- leetcode:724. 寻找数组的中心下标
- 什么是 SYN 洪水攻击?如何防护?
- WPF measurement string display size
- 习近平在湖北武汉考察时强调 把科技的命脉牢牢掌握在自己手中 不断提升我国发展独立性自主性安全性
- TMUX settings
- 《强化学习周刊》第51期:PAC、ILQL、RRL&无模型强化学习集成于微电网络格控制:综述与启示
- 唯品会关键词搜索API接口(item_search-按关键字搜索唯品会商品API接口),唯品会API接口
猜你喜欢

About Effect Size

唯品会商品详情API接口(item_get-获得唯品会商品详情接口),唯品会详情API接口
【云原生实战】KubeSphere实战——多租户系统实战
![Navigation experiment [microcomputer principle] [experiment]](/img/79/8311a409113331e72f650a83351b46.png)
Navigation experiment [microcomputer principle] [experiment]

THREEJS基础入门

Application of VoIP push in overseas audio and video services

Layer 3 loop brought by route Summary - solution experiment

Sophon CE community edition goes online, and free get is a lightweight, easy-to-use, efficient and intelligent data analysis tool

VHDL电话计费系统设计

Yolov6 training your own data record +yolov5 comparison test
随机推荐
如何从外表判断导电滑环的质量
What is a SYN Flood attack? How to protect?
Top ten questions for senior Performance Test Engineer
LeetCode 1. Sum of two numbers
透过华为军团看科技之变(五):智慧园区
What are the mainstream brands of smart door locks? What characteristics should we pay attention to when purchasing door locks?
一颗新的北极星已经升起!
Goahead webserver migration
Layer 3 loop brought by route Summary - solution experiment
每周招聘|DBA数据工程师,年薪35+ ,梦起九州,星河灿烂!
Selection of materials for space conductive disc slip ring
Navigation experiment [microcomputer principle] [experiment]
STM32 minimum system construction (schematic diagram)
Win10 sets automatic dial-up networking task to realize automatic reconnection after startup and disconnection
Shutter bottomnavigationbar with page switching example
varnish 503 no backend connection – varnish健康检查
不同系统下的文件层级符号小结
Varnish 503 no backend connection – varnish health check
CORDIC based Signal Processor desgn