Submission #4409757


Source Code Expand

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
int n,m;
int ackn[13][13];

int flag[1000];
int res=0;

void calc()
{
  int cnt=0;
  for(int i=0;i<n;i++)
  {
    if(!flag[i])continue;
    cnt++;
    rep(j,n)
    {
      if(i==j)continue;
      if(flag[j])
      {
      if(ackn[i][j]);
      else return;
      }
    }

  }
  //cout<<cnt<<endl;
  res=max(res,cnt);
}

void dfs(int depth)
{
  if(depth==n)
  {
    calc();return;
  }
  flag[depth]=0;dfs(depth+1);
  flag[depth]=1;dfs(depth+1);
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin>>n>>m;
  memset(ackn,0,sizeof(ackn));
  rep(i,m)
  {
    int x,y;
    cin>>x>>y;
    ackn[x-1][y-1]=1;
    ackn[y-1][x-1]=1;
  }
  dfs(0);
  cout<<res<<endl;




  return 0;

}

Submission Info

Submission Time
Task D - 派閥
User plin
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1028 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:56:29: error: ‘memset’ was not declared in this scope
   memset(ackn,0,sizeof(ackn));
                             ^