Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7509 - Массивт байгаа эсэх

Өгагдсөн нэг хэмжээст бүхэл тоон массивт өгөгдсөн тоо байвал YES үгүй бол NO гэж хэвлэ. Таарангуут давталтыг зогсоох.

Input

Эхний мөрөнд массивын элементийн тоо. n<=100.

Хоёр дахь мөрөнд массивын элементүүд зайгаар тусгаарлагдан өгөгдөнө. Int төрөл

Гурав дахь мөрөнд хайх бүхэл тоо.

Output

Байвал YES үгүй бол NO.

Example

Input:
5
1 2 3 4 5
2
Output: YES

Нэмсэн:Bataa
Огноо:2013-01-15
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2021-08-22 03:02:29
Chinzoon bnoo / Oilgoj huularai shuud copy, past hiichiv /
#include<iostream>
using namespace std;
int main () {
int b,i,c,d=0,z=0;
cin>>b;
int a[b];
while(c<b){
cin>>a[c];
c++;
}
cin>>i;
while(z<b){
if(i==a[z]){
cout<<"YES";
return 0;
}
z++;
}
cout<<"NO";
}
2019-11-24 07:50:35
#include <cstdio>
#include <cmath>

int main() {
int n, i, j;
int a[100];
int s = 0;
int t = 0;
scanf ("%d", &n);
for (i=1 ; i <= n ; i++){
scanf ("%d", &a[i]);
}
int c;
scanf("%d" , &c);
for (i=1 ;i<=n ; i++){
if(a[i] == c) s++;
}
if(s > 0){
printf("YES");
}
else{
printf("NO");
}
}
2019-11-24 07:38:17
I wonder what went wrong

Last edit: 2019-11-24 07:49:59
2019-10-27 07:33:36
#include<iostream>
using namespace std;
int main () {
int b,i,c,d=0,z=0;
cin>>b;
int a[b];
while(c<b){
cin>>a[c];
c++;
}
cin>>i;
while(z<b){
if(i==a[z]){
cout<<"YES";
return 0;
}
z++;
}
cout<<"NO";
}
2019-10-26 15:43:21
#include<stdio.h>
#include<stdlib.h>
int s,a[101],d,i;
int main()
{
scanf("%d",&s);
for(i=1; i<=s; i++)
scanf("%d",&a[i]);
d=a[1];
for(i=2; i<=s; i++)
if(a[i]<d) d=a[i];
printf("%d",d);
system("pause");
return 0;
}
2019-09-24 08:30:40
#include<iostream>
using namespace std;
int main () {
int b,i,c,d=0,z=0;
cin>>b;
int a[b];
while(c<b){
cin>>a[c];
c++;
}
cin>>i;
while(z<b){
if(i==a[z]){
cout<<"YES";
return 0;
}
z++;
}
cout<<"NO";
}
2019-03-19 09:02:58
#include<iostream>
using namespace std;
main(){
int a[10001]={0},n,i,max,count=0,k,s=0;
cin>>n;
for(i=1; i<=n;i++)
{
cin>>a[i];
}
cin>>k;
for (i=1; i<=n;i++)
{
if(k==a[i])
{
s=1;
break;
}
}
if(s==1)
{
cout<<"YES";
}
else
{
cout<<"NO";
}
}

a
2019-01-14 08:18:38
#include<bits/stdc++.h>

using namespace std;

int main(){
int p,b,n,i;

cin>>n;

int a[n+1];

for(i=1;i<=n;i++){
cin>>a[i];
}
p=0;
cin>>b;
for(i=1;i<=n;i++){
if(a[i]==b) cout<<"YES"<<endl,i=n+1;
else p++;
}
if(p==n) cout<<"NO"<<endl;

return 0;
}
2015-01-15 09:58:07 Temuulen
#include <iostream>
using namespace std;
int main ()
{
int n,a[100],i,j,m;
cin >> n;
for(i=0; i<n; i++)
cin >> a[i];
cin >> m;
if (m==0)
cout << "NO";
else
cout << "YES";



































































































system ("pause");
return 0;
}
2014-03-01 20:43:29 Майкэл
#include<stdio.h>
#include<conio.h>
main()
{
int b, i, d;
int a[101];

scanf("%d",&b);
for(i=1; i<=b; i++)
scanf("%d",&a[i]);
scanf("%d",&d);

if(a[i]%d==0) printf("YES");
else printf("NO");

getch();
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.