102912024-03-30 10:33:48111Pletykálkodáscpp17Wrong answer 0/10054ms6444 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N,M;
	cin>>N>>M;
	vector<vector<int>>g(N+1);
	vector<pair<int,int>>e;
	for(int i=0;i<M;i++){
		int a,b;
		cin>>a>>b;
		g[a].push_back(b);
		g[b].push_back(a);
		e.emplace_back(a,b);
	}
	vector<tuple<int,int,int,int>>c;
	for(int i=1;i<=N;i++){
		vector<int>v(N+1);
		v[i]=-1;
		for(int j:g[i]){
			v[j]=-1;
		}
		for(int j:g[i]){
			for(int k:g[j]){
				if(v[k]<0){
					continue;
				}
				if(v[k]>0){
					c.emplace_back(i,k,j,v[k]);
					continue;
				}
				v[k]=j;
			}
		}
	}
	cout<<c.size()<<endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms2108 KiB
2Wrong answer3ms2236 KiB
3Wrong answer4ms2624 KiB
subtask20/9
4Wrong answer2ms2460 KiB
5Wrong answer2ms2456 KiB
6Wrong answer3ms2544 KiB
subtask30/13
7Wrong answer14ms3988 KiB
8Wrong answer17ms4064 KiB
9Wrong answer19ms3724 KiB
subtask40/16
10Wrong answer14ms4456 KiB
11Wrong answer14ms4868 KiB
12Wrong answer14ms4840 KiB
subtask50/25
13Wrong answer3ms3224 KiB
14Wrong answer3ms3360 KiB
15Wrong answer3ms3312 KiB
16Wrong answer3ms3320 KiB
17Wrong answer3ms3376 KiB
18Wrong answer3ms3500 KiB
19Wrong answer3ms3580 KiB
subtask60/13
20Wrong answer4ms3860 KiB
21Wrong answer4ms3864 KiB
22Wrong answer4ms3920 KiB
23Wrong answer8ms4524 KiB
24Wrong answer6ms4132 KiB
25Wrong answer4ms4144 KiB
26Wrong answer6ms4180 KiB
subtask70/24
27Wrong answer23ms6072 KiB
28Wrong answer21ms6444 KiB
29Wrong answer21ms6316 KiB
30Wrong answer32ms6132 KiB
31Wrong answer37ms5608 KiB
32Wrong answer41ms5300 KiB
33Wrong answer48ms5292 KiB
34Wrong answer54ms5148 KiB
35Wrong answer35ms5604 KiB
36Wrong answer39ms5304 KiB
37Wrong answer46ms5288 KiB