Skip to content

Instantly share code, notes, and snippets.

@Rockbet
Last active May 6, 2019 19:33
Show Gist options
  • Save Rockbet/04c43d9a7cc5fcb1c8181a320386596b to your computer and use it in GitHub Desktop.
Save Rockbet/04c43d9a7cc5fcb1c8181a320386596b to your computer and use it in GitHub Desktop.
// 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