Advertisement
thesonpb

Đấu hậu

Mar 30th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.     bool found=false;
  5.     int n;
  6.     cin >> n;
  7.     int x[10000], y[10000];
  8.     for(int i=0; i<n ;i++){
  9.         cin >> x[i]>> y[i];
  10.     }
  11.     for(int i=0; i<n-1; i++){
  12.         for(int j=i+1; j<n; j++){
  13.             if(x[i]==x[j]) {
  14.                 cout<<"yes";
  15.                 found=true;
  16.                 break;
  17.             }
  18.             if(y[i]==y[j]) {
  19.                 cout<<"yes";
  20.                 found=true;
  21.                 break;
  22.             }
  23.             if(x[i]-x[j]==y[i]-y[j]) {
  24.                 cout<<"yes";
  25.                 found=true;
  26.                 break;
  27.             }
  28.         }
  29.         if(found) break;
  30.     }
  31.     if(found==false) cout<<"no";
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement