Submission #420424

# Submission time Handle Problem Language Result Execution time Memory
420424 2021-06-08T11:03:53 Z victoriad Topovi (COCI15_topovi) C++14
6 / 120
40 ms 65540 KB
#include <cmath>
#include <cstdio>
#include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
 
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int k,n,p,r,c,x,y;
	cin>>n>>k>>p;
	vector<vector<int> >t(n);
	vector<int>a(n);
	for(int i=0;i<n;i++)t[i]=a;
	vector<int>co(n,0);
	vector<int>ro(n,0);
	for(int i=0;i<n;i++){
		cin>>r>>c>>x;
		r--;
		c--;
		t[r][c]=x;
		co[c]^=x;
		ro[r]^=x;
		//cout<<co[c]<<" "<<ro[r]<<"\n";
	}
	while(p--){
		cin>>r>>c>>x>>y;
		r--;
		x--;
		c--;
		y--;
		int h=t[r][c];
		t[r][c]=0;
		t[x][y]=h;
		co[c]^=h;
		ro[r]^=h;
		co[y]^=h;
		ro[x]^=h;
		int con=0;
		pair<int,int>ac=make_pair(r,c);
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if((co[i]^ro[j])>0)con++;
			}
		}
		cout<<con<<"\n";
	}
 
	return 0;
}

Compilation message

topovi.cpp: In function 'int main()':
topovi.cpp:45:16: warning: variable 'ac' set but not used [-Wunused-but-set-variable]
   45 |   pair<int,int>ac=make_pair(r,c);
      |                ^~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Correct 2 ms 332 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Incorrect 1 ms 332 KB Output isn't correct
6 Runtime error 39 ms 65540 KB Execution killed with signal 9
7 Runtime error 37 ms 65540 KB Execution killed with signal 9
8 Runtime error 37 ms 65540 KB Execution killed with signal 9
9 Runtime error 38 ms 65540 KB Execution killed with signal 9
10 Runtime error 40 ms 65540 KB Execution killed with signal 9
11 Runtime error 3 ms 588 KB Execution killed with signal 6
12 Runtime error 3 ms 588 KB Execution killed with signal 6
13 Runtime error 3 ms 576 KB Execution killed with signal 6
14 Runtime error 3 ms 600 KB Execution killed with signal 6
15 Runtime error 3 ms 588 KB Execution killed with signal 6
16 Runtime error 3 ms 588 KB Execution killed with signal 6
17 Runtime error 3 ms 556 KB Execution killed with signal 6
18 Runtime error 3 ms 588 KB Execution killed with signal 6
19 Runtime error 3 ms 588 KB Execution killed with signal 6
20 Runtime error 3 ms 588 KB Execution killed with signal 6