当前位置:网站首页>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;
}边栏推荐
- Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
- 股票开户最低佣金炒股开户免费,网上开户安全吗
- How to solve the problem of computer networking but showing no Internet connection
- Go Technology Daily (2022-02-13) - Summary of experience in database storage selection
- Wisdom tooth technology announced that it had completed the round D financing of US $100million and had not obtained a valid patent yet
- Qtoolbutton available signal
- 3 environment construction -standalone
- Why should enterprises do more application activities?
- Druids connect to mysql8.0.11
- X Opencv feature point detection and matching
猜你喜欢

Unsafe and CAS principle

Scratch uses runner Py run or debug crawler

Shiftvit uses the precision of swing transformer to outperform the speed of RESNET, and discusses that the success of Vit does not lie in attention!

How to quickly build high availability of service discovery

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

2 spark environment setup local

Summary of fluent systemchrome

Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
![[network security] what is emergency response? What indicators should you pay attention to in emergency response?](/img/ff/c733ffbb922760910ab09af3ae2886.jpg)
[network security] what is emergency response? What indicators should you pay attention to in emergency response?

Opengauss database log management guide
随机推荐
[Android reverse] use the DB browser to view and modify the SQLite database (copy the database file from the Android application data directory | use the DB browser tool to view the data block file)
How can enterprises and developers take advantage of the explosion of cloud native landing?
1 Introduction to spark Foundation
2 spark environment setup local
C # basic knowledge (2)
In VS_ In 2019, scanf and other functions are used to prompt the error of unsafe functions
Es6~es12 knowledge sorting and summary
How can I get the Commission discount of stock trading account opening? Is it safe to open an account online
Hcip day 16 notes
2/14 (regular expression, sed streaming editor)
Xiangong intelligent obtained hundreds of millions of yuan of b-round financing to accelerate the process of building non-standard solutions with standardized products
"Learning notes" recursive & recursive
AST (Abstract Syntax Tree)
Esp-idf turns off serial port log output.
Teach you how to run two or more MySQL databases at the same time in one system
Go error collection | talk about the difference between the value type and pointer type of the method receiver
Is the controller a single instance or multiple instances? How to ensure the safety of concurrency
File copy method
How to solve the problem of computer networking but showing no Internet connection
Sort merge sort