Untitled
unknown
c_cpp
2 years ago
482 B
5
Indexable
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cout << "varNum: ";
cin >> n;
cout << "clauseNum: ";
cin >> m;
cout << "answer: ";
vector<int> a(n+1);
for(int i = 1; i <= n; i++){
cin >> a[i];
}
cout << "input clases: " <<endl;
while(m--){
int x;
bool good = 0;
while(cin >> x && x!=0){
if(x*a[abs(x)]>0)
good = 1;
}
if(!good){
cout << "WA" << endl;
return 0;
}
}
cout << "correct!" << endl;
}Editor is loading...
Leave a Comment