Submission #69079100


Source Code Expand

#include<bits/stdc++.h>
#define N 200005
#define int long long
using namespace std;
int n,m,d[N];
signed main(){
	cin>>n>>m;
	for(int i=1;i<=m;++i){
		int u,v;cin>>u>>v;++d[u];++d[v];
	}
	int ans=0;
	for(int i=1;i<=n;++i)if(d[i]%2==n%2)++ans;
	cout<<n*(n-1)/2-ans/2;
	return 0;
}

Submission Info

Submission Time
Task B - Triangle Toggle
User Cute_yhb
Language C++ 20 (gcc 12.2)
Score 500
Code Size 295 Byte
Status AC
Exec Time 73 ms
Memory 5224 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3532 KiB
00_sample_01.txt AC 1 ms 3452 KiB
00_sample_02.txt AC 1 ms 3472 KiB
01_handmade_00.txt AC 1 ms 3532 KiB
01_handmade_01.txt AC 36 ms 5000 KiB
01_handmade_02.txt AC 36 ms 5028 KiB
01_handmade_03.txt AC 1 ms 3484 KiB
01_handmade_04.txt AC 1 ms 3528 KiB
01_handmade_05.txt AC 1 ms 3488 KiB
01_handmade_06.txt AC 1 ms 3488 KiB
01_handmade_07.txt AC 46 ms 3456 KiB
01_handmade_08.txt AC 46 ms 3488 KiB
02_random_00.txt AC 50 ms 3820 KiB
02_random_01.txt AC 61 ms 3836 KiB
02_random_02.txt AC 16 ms 4656 KiB
02_random_03.txt AC 62 ms 4080 KiB
02_random_04.txt AC 24 ms 3532 KiB
02_random_05.txt AC 73 ms 5008 KiB
02_random_06.txt AC 40 ms 5084 KiB
02_random_07.txt AC 71 ms 5156 KiB
02_random_08.txt AC 69 ms 5040 KiB
02_random_09.txt AC 71 ms 5224 KiB