Last active
May 6, 2019 19:33
-
-
Save Rockbet/04c43d9a7cc5fcb1c8181a320386596b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Noic - Ideia 4 | |
// Exercício 1 | |
// Complexidade: O(N^2) | |
// Por Leonardo Paes | |
#include <bits/stdc++.h> | |
using namespace std; | |
int v[1000100]; | |
int main(){ | |
int n, x; | |
cin >> n >> x; | |
for(int i=1; i<=n; i++){ | |
cin >> v[i]; | |
} | |
bool resposta=false; | |
for(int i=1; i<=n; i++){ | |
for(int j=1; j<=n; j++){ | |
if(v[i]+v[j]==x){ | |
resposta=true; | |
} | |
} | |
} | |
cout << resposta << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment