39D - Cubical Planet - CodeForces Solution


math *1100

Please click on ads to support us..

Python Code:

a = list(input().split())
b = list(input().split())
a = [int(i) for i in a]
b = [int(i) for i in b]
sum = 0
for i in range(3):
    if a[i] == b[i]:
        sum += 1

if sum >= 1:
    print("YES")
else:
    print("NO")

C++ Code:

#include<bits/stdc++.h>
using namespace std;
int main()
{
int ar1[4];
int ar2[4];
for(int i=0;i<3;i++)cin>>ar1[i];
for(int i=0;i<3;i++)cin>>ar2[i];
int c=0;
for(int i=0;i<3;i++){
    if(ar1[i]==ar2[i])c++;
}
if(c>=1)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
}


Comments

Submit
0 Comments
More Questions

1189A - Keanu Reeves
678A - Johny Likes Numbers
1699C - The Third Problem
1697D - Guess The String
754B - Ilya and tic-tac-toe game
760A - Petr and a calendar
1573A - Countdown
166A - Rank List
1631B - Fun with Even Subarrays
727A - Transformation from A to B
822B - Crossword solving
1623A - Robot Cleaner
884B - Japanese Crosswords Strike Back
862B - Mahmoud and Ehab and the bipartiteness
429A - Xor-tree
1675C - Detective Task
950A - Left-handers Right-handers and Ambidexters
672B - Different is Good
1C - Ancient Berland Circus
721A - One-dimensional Japanese Crossword
1715B - Beautiful Array
60B - Serial Time
453A - Little Pony and Expected Maximum
1715A - Crossmarket
1715C - Monoblock
1512C - A-B Palindrome
1679B - Stone Age Problem
402A - Nuts
792A - New Bus Route
221A - Little Elephant and Function