Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
482 B
2
Indexable
Never
#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;
}
Leave a Comment