UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#205503#3657. 二分图tkswls100473ms1520kbC++11454b2024-07-07 12:26:172024-07-07 13:20:37

answer

#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int n, m, k, a[100005], b[100005], ans, aans;
signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m >> k;
	int p, q;
	for (int i = 1; i <= k; i++) {
		cin >> p >> q;
		a[p]++, b[q]++;
	}
	for (int i = 1; i <= max(n, m); i++) {
		ans += a[i] & 1, aans += b[i] & 1;
	}
	cout << max(ans, aans);
}
//瞪眼无敌了
//不知道有啥道理

Details

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1256kb

input:

3 3 6
3 1
1 2
2 2
3 3
3 2
1 1

output:

2

result:

ok single line: '2'

Test #2:

score: 10
Accepted
time: 1ms
memory: 1252kb

input:

3 3 6
2 3
1 3
1 1
3 1
2 2
1 2

output:

2

result:

ok single line: '2'

Test #3:

score: 10
Accepted
time: 0ms
memory: 1256kb

input:

5 5 10
2 2
3 5
2 1
5 1
4 3
5 5
4 1
2 5
4 4
1 3

output:

4

result:

ok single line: '4'

Test #4:

score: 10
Accepted
time: 0ms
memory: 1252kb

input:

5 5 10
1 3
2 2
4 1
1 5
3 3
2 5
5 3
5 5
1 4
3 2

output:

4

result:

ok single line: '4'

Test #5:

score: 10
Accepted
time: 14ms
memory: 1260kb

input:

114 515 58710
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
...

output:

114

result:

ok single line: '114'

Test #6:

score: 10
Accepted
time: 13ms
memory: 1260kb

input:

115 515 59225
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
...

output:

515

result:

ok single line: '515'

Test #7:

score: 10
Accepted
time: 128ms
memory: 1516kb

input:

68944 65538 457334
28574 3442
25145 16846
3908 4208
1458 23374
6977 13895
15623 10242
5458 32462
147...

output:

16390

result:

ok single line: '16390'

Test #8:

score: 10
Accepted
time: 129ms
memory: 1516kb

input:

80715 54106 456937
6635 12392
6993 23015
16612 416
1154 31247
30337 8910
20012 15283
25326 8635
3175...

output:

16501

result:

ok single line: '16501'

Test #9:

score: 10
Accepted
time: 127ms
memory: 1520kb

input:

54914 55025 464166
7197 327
19912 4344
14147 30464
22874 24904
16761 27174
16591 1399
28037 9082
180...

output:

16416

result:

ok single line: '16416'

Test #10:

score: 10
Accepted
time: 61ms
memory: 1516kb

input:

80584 52252 456351
32761 6996
21358 22163
11514 9134
17800 13069
629 22725
8945 19723
9490 2413
2233...

output:

16395

result:

ok single line: '16395'

Extra Test:

score: 0
Extra Test Passed