| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 448676 | IvnF | Topovi (COCI15_topovi) | C++17 | 1 ms | 460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ull unsigned long long
#define fi first
#define se second
#define ld long double
ll n, k, p, arr[105][105];
ll baris[105], kolom[105];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> k >> p;
for(int i=1;i<=k;++i){
ll r, c; cin >> r >> c >> arr[r][c];
baris[r]^=arr[r][c];
kolom[c]^=arr[r][c];
}
for(int i=1;i<=p;++i){
ll r1, r2, c1, c2;
cin >> r1 >> c1 >> r2 >> c2;
baris[r1]^=arr[r1][c1];
kolom[c1]^=arr[r1][c1];
baris[r2]^=arr[r1][c1];
kolom[c2]^=arr[r1][c1];
swap(arr[r1][c1], arr[r2][c2]);
ll tmp=0;
for(int j=1;j<=n;++j){
for(int k=1;k<=n;++k){
int cur=(baris[j]^arr[j][k]);
cur^=(kolom[k]^arr[j][k]);
if(cur > 0){
tmp++;
}
}
}
cout << tmp << '\n';
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
