当前位置:网站首页>D25:sequence search (sequence search, translation + problem solving)
D25:sequence search (sequence search, translation + problem solving)
2022-07-03 23:14:00 【Aggressive Wenwen】
The original title is :OpenJudge - 25:Sequence Search
translate :
describe : Given a by N A sequence of numbers . Find the smallest subscript id, send S[id] be equal to K;
Input : first line : Two positive integers N and K(N<=100,K<=100000);
The second line :N No more than one. 100000 The positive integer ;
Output : An integer id.
Code :
#include<iostream>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int ans,a,f=1;
for(int i=1;i<=n;i++){
cin>>a;
if(a==k&&f){
cout<<i;
f=0;
}
}
return 0;
}
边栏推荐
- 4 environment construction -standalone ha
- Sow of PMP
- In 2022, 6G development has indeed warmed up
- Druids connect to mysql8.0.11
- File copy method
- How to understand the gain bandwidth product operational amplifier gain
- Hcip day 12 notes
- JarPath
- What are the common computer problems and solutions
- SDMU OJ#P19. Stock trading
猜你喜欢
In VS_ In 2019, scanf and other functions are used to prompt the error of unsafe functions
[note] IPC traditional interprocess communication and binder interprocess communication principle
Selenium check box
Quick one click batch adding video text watermark and modifying video size simple tutorial
The 2022 global software R & D technology conference was released, and world-class masters such as Turing prize winners attended
Design of logic level conversion in high speed circuit
2022.02.13
Qtoolbutton available signal
How to prevent malicious crawling of information by one-to-one live broadcast source server
Creation of the template of the password management software keepassdx
随机推荐
"Learning notes" recursive & recursive
Selenium check box
Fashion cloud interview questions series - JS high-frequency handwritten code questions
To rotate 90 degrees clockwise and modify the video format
MLX90614 driver, function introduction and PEC verification
Go error collection | talk about the difference between the value type and pointer type of the method receiver
User login function: simple but difficult
How to solve the problem of computer networking but showing no Internet connection
Maxwell equation and Euler formula - link
Opengauss database log management guide
Les sociétés de valeurs mobilières dont la Commission d'ouverture d'un compte d'actions est la plus faible ont ce que tout le monde recommande.
The difference between SRAM and DRAM
The overseas listing of Shangmei group received feedback, and brands such as Han Shu and Yiye have been notified for many times and received attention
Summary of fluent systemchrome
How to write a good title of 10w+?
Day30-t540-2022-02-14-don't answer by yourself
股票开户佣金最低的券商有哪些大家推荐一下,手机上开户安全吗
Pat grade A - 1164 good in C (20 points)
炒股开户佣金优惠怎么才能获得,网上开户安全吗
JarPath