ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1877. Bicycle Codes

My code is accepted.
Posted by mars 6 Apr 2020 01:10
#include<iostream>
using namespace std;
int main(){
int a,b, thief[10000],i=0;
cin>>a;
cin>>b;
int count = 0;
for (int i = 0;i<10000;i++){
thief[i] = i;
//    cout<<thief[i]<<" ";

}
for(i=0;i<10000;i++){
//cout<<"first"<<i<<endl;
if(a==thief[i]||b==thief[i+1]){
count++;

}
//    cout<<"thief["<<i<<"]"<<thief[i]<<"\t"<<"thief["<<i+1<<"]"<<thief[i+1]<<endl;
i=i+1;
//cout<<"thief"<<i<<endl;

}
if(count>0)
cout<<"yes";
else
cout<<"no";
}
Re: My code is accepted.
Posted by vivekreddy 1 Mar 2024 21:15
This code is not very efficient.

#include <iostream>
using namespace std;

int main(){
int key1;cin>>key1;
int key2;cin>>key2;
if((key1%2==0) || key2%2!=0){
cout<<"yes"<<endl;
}
else{
cout<<"no"<<endl;
}

return 0;
}

Edited by author 01.03.2024 21:16

Edited by author 01.03.2024 21:16