|
|
back to boardCould you tell me, where am I wrong? WA test #10 Posted by Alex007 20 Mar 2009 18:14 #include <iostream> using namespace std; int main() { int m; int n; bool q=false; short int a[50000], b[50000]; cin >> m; for (int i=1; i<=m; i++) cin >> a[i]; cin >> n; for (int j=1; j<=n; j++) { cin >> b[j]; if (!q) for (int i=1; i<=m; i++) { if ((a[i]+b[j])==10000) { q=true; break; } if ((a[i]+b[j])>10000) break; } } if (q) cout << "YES"; else cout << "NO"; return 0; } Where is the error? Re: Could you tell me, where am I wrong? WA test #10 Posted by OpenGL 22 Mar 2009 14:01 Re: Could you tell me, where am I wrong? WA test #10 Posted by Alex007 22 Mar 2009 15:59 Thanks very much! Accepted for me! |
|
|