当前位置:网站首页>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;
}
边栏推荐
- Flutter BottomNavigationBar带有页面切换示例
- 空间导电盘式滑环材料的选择
- Jump to open a new window
- Sophon CE community edition goes online, and free get is a lightweight, easy-to-use, efficient and intelligent data analysis tool
- shell 实现Memcache缓存命中率监控脚本
- PostgreSQL weekly news - June 22
- STM32 minimum system construction (schematic diagram)
- [advanced ROS] Lecture 3 ROS file system and distributed communication
- 【摸鱼神器】UI库秒变低代码工具——表单篇(一)设计
- LSF bsub command
猜你喜欢
Star ring technology data security management platform defender heavy release
PostgreSQL每周新闻—6月22日
Digital password lock Verilog design + simulation + on board verification
Win10 add SSH public key
Final review [microcomputer principle]
Implementation and Simulation of ads131a04 ADC Verilog
分析影响导电滑环传输信号的因素
知识蒸馏(Knowledge Distilling)学习笔记
leetcode:724. 寻找数组的中心下标
Recruit | DBA Data Engineer every week with an annual salary of 35+. Dream of Kyushu and bright stars!
随机推荐
CORDIC based Signal Processor desgn
Analysis on the true topic of "cost management" by Guangdong second-class cost engineer
[fishing artifact] code tool for lowering the seconds of UI Library -- form part (I) design
LSF bsub command
Verilog realizes serial communication and sends it to the nixie tube
Vipshop Keyword Search API interface (item_search- search vipshop commodity API interface by keyword), vipshop API interface
路由汇总带来的三层环路-解决实验
一颗新的北极星已经升起!
PostgreSQL每周新聞—6月22日
Shell implementation of Memcache cache cache hit rate monitoring script
Flutter technology and Practice (2)
HAproxy + Keepalive实现LDAP代理服务
Gstreamer应用开发实战指南(五)
Navigation experiment [microcomputer principle] [experiment]
leetcode:238. 除自身以外数组的乘积
一次 Keepalived 高可用的事故,让我重学了一遍它!
PostgreSQL每周新闻—6月22日
MES系统究竟有何独特之处?
Goahead webserver migration
阿里巴巴商品详情API接口(item_get-获得商品详情接口),阿里巴巴API接口