Cod sursa(job #2561532)
Utilizator | Data | 28 februarie 2020 21:41:48 | |
---|---|---|---|
Problema | Triplete | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
using namespace std;
ifstream f ( "triplete.in" );
ofstream g ( "triplete.out" );
bool a[4100][4100];
int main()
{
int x1, y1, N, M, nrt = 0;
f >> N >> M;
for ( int i = 1; i <= M; i++ )
{
f >> x1 >> y1;
a[x1][y1] = a[y1][x1] = 1;
for ( int j = 1; j <= N; j++ )
if ( a[j][x1] == 1 && a[j][y1] == 1 )
nrt++;
}
g << nrt;
return 0;
}