Submission #60293149


Source Code Expand

#include<bits/stdc++.h>
#include"atcoder/all"
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll inf=1ll<<61;
typedef modint1000000007 mi;

vector<int>G[100005];

int main(){
	int n,m;cin>>n>>m;
	rep(i,m){
		int a,b;cin>>a>>b;
		a--;b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	int ans=0;
	rep(i,n){
		int cnt=0;
		for(auto &e:G[i]){
			if(e<i)cnt++;
		}
		if(cnt==1)ans++;
	}
	cout<<ans<<endl;
}

Submission Info

Submission Time
Task 078 - Easy Graph Problem(★2)
User Rho17
Language C++ 20 (gcc 12.2)
Score 2
Code Size 604 Byte
Status AC
Exec Time 50 ms
Memory 9284 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 2 / 2
Status
AC × 3
AC × 28
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, 10_random_small_00.txt, 10_random_small_01.txt, 10_random_small_02.txt, 10_random_small_03.txt, 10_random_small_04.txt, 10_random_small_05.txt, 10_random_small_06.txt, 10_random_small_07.txt, 11_random_large_00.txt, 11_random_large_01.txt, 11_random_large_02.txt, 11_random_large_03.txt, 11_random_large_04.txt, 11_random_large_05.txt, 11_random_large_06.txt, 11_random_large_07.txt, 20_random_max_00.txt, 20_random_max_01.txt, 20_random_max_02.txt, 20_random_max_03.txt, 20_random_max_04.txt, 80_random_tree_00.txt, 80_random_tree_01.txt, 90_random_uni_00.txt, 90_random_uni_01.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3512 KiB
00_sample_01.txt AC 1 ms 3512 KiB
00_sample_02.txt AC 1 ms 3556 KiB
10_random_small_00.txt AC 1 ms 3612 KiB
10_random_small_01.txt AC 1 ms 3496 KiB
10_random_small_02.txt AC 1 ms 3436 KiB
10_random_small_03.txt AC 1 ms 3540 KiB
10_random_small_04.txt AC 1 ms 3548 KiB
10_random_small_05.txt AC 1 ms 3516 KiB
10_random_small_06.txt AC 1 ms 3464 KiB
10_random_small_07.txt AC 1 ms 3476 KiB
11_random_large_00.txt AC 5 ms 3756 KiB
11_random_large_01.txt AC 21 ms 4660 KiB
11_random_large_02.txt AC 14 ms 4192 KiB
11_random_large_03.txt AC 8 ms 3896 KiB
11_random_large_04.txt AC 5 ms 3756 KiB
11_random_large_05.txt AC 3 ms 3704 KiB
11_random_large_06.txt AC 10 ms 4176 KiB
11_random_large_07.txt AC 18 ms 4472 KiB
20_random_max_00.txt AC 50 ms 9192 KiB
20_random_max_01.txt AC 46 ms 9092 KiB
20_random_max_02.txt AC 46 ms 9084 KiB
20_random_max_03.txt AC 48 ms 9284 KiB
20_random_max_04.txt AC 46 ms 9092 KiB
80_random_tree_00.txt AC 44 ms 9084 KiB
80_random_tree_01.txt AC 46 ms 9016 KiB
90_random_uni_00.txt AC 44 ms 9148 KiB
90_random_uni_01.txt AC 43 ms 9024 KiB