当前位置:网站首页>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;
}边栏推荐
- . Net ADO splicing SQL statement with parameters
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- Ppt image processing
- Can you draw with turtle?
- Go error collection | talk about the difference between the value type and pointer type of the method receiver
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- How to prevent malicious crawling of information by one-to-one live broadcast source server
- 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!
- Unsafe and CAS principle
- 4 environment construction -standalone ha
猜你喜欢

Format cluster and start cluster

Unity shader visualizer shader graph

Fluent learning (4) listview

Leetcode week 4: maximum sum of arrays (shape pressing DP bit operation)

The reason why the computer runs slowly and how to solve it

Harbor integrated LDAP authentication

Go Technology Daily (2022-02-13) - Summary of experience in database storage selection

How to connect a laptop to a projector

Schematic diagram of crystal oscillator clock and PCB Design Guide

4 environment construction -standalone ha
随机推荐
Format cluster and start cluster
Flutter internationalized Intl
How about agricultural futures?
Errors taken 1 Position1 argument but 2 were given in Mockingbird
Design of logic level conversion in high speed circuit
Exclusive download! Alibaba cloud native brings 10 + technical experts to bring "new possibilities of cloud native and cloud future"
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
2.14 summary
X Opencv feature point detection and matching
Pyqt5 sensitive word detection tool production, operator's Gospel
Fashion cloud interview questions series - JS high-frequency handwritten code questions
Hcip day 14 notes
How to connect a laptop to a projector
2022.02.14
Day30-t540-2022-02-14-don't answer by yourself
Yyds dry goods inventory Prometheus alarm Art
Qtoolbutton available signal
Recursive least square adjustment
Arc135 partial solution
finalize finalization finally final