Created
December 4, 2019 09:01
-
-
Save hsuan1117/488eeced61c85c8e6cfcab5acc2b13c7 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
#include<bits/stdc++.h> | |
using namespace std; | |
bool can[10000000]; | |
int main() { | |
ios::sync_with_stdio(0); | |
cin.tie(0); | |
cout.tie(0); | |
memset(can,0,sizeof(can)); | |
int tt; | |
scanf("%i\n",&tt); | |
for(int mm=0; mm<tt; mm++) { | |
int studentNum; | |
scanf("%i\n",&studentNum); | |
int data[studentNum]; | |
for(int m=0; m<studentNum; m++) { | |
int ttftt; | |
scanf("%i",&ttftt); | |
data[m] = ttftt; | |
} | |
for(int i=0; i<studentNum; i++) { | |
for(int j=i+1; j<studentNum; j++) { | |
int temp=data[i]+data[j]; | |
if(can[temp]==0) { | |
can[temp]=1; | |
} | |
} | |
} | |
int ko; | |
scanf("%i\n",&ko); | |
for(int m=0; m<ko; m++) { | |
int f; | |
scanf("%i",&f); | |
if(can[f] == 1) { | |
cout << "Good!" << endl; | |
} else { | |
cout << "So Bad!" << endl; | |
} | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment