Submission #994089


Source Code Expand

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <queue>
#include <map>

typedef long long ll;
#define rep(i, b) for(int i = 0; i < b; i++)
#define repi(i, a, b) for(int i = a; i < b; i++)
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define MAX_V 1001
#define MAX_E 401
#define MOD 1000000007
#define EPS 1e-7
#define INF INT_MAX
#define PI  3.14159265358979323846264338327950288
inline ll toll(std::string s) { ll v; std::istringstream sin(s); sin >> v; return v; }
template<class T> inline std::string toString(T x) { std::ostringstream sout; sout << x; return sout.str(); }
using namespace std;
typedef pair<ll, ll> pll;

int ma[100002][100002];

int C_check[10002];

int main()
{
    int N,M;
    cin >> N >> M;
    vector<int> K(N);
    vector< vector<int> > T(N);
    rep(i,100002)
    {
        rep(j,100002)
        {
            ma[i][j] = 0;
        }
    }
    
    rep(i,N)
    {
        cin >> K[i];
        rep(j,K[i])
        {
            int L;
            cin >> L;
            ma[i][L - 1] = 1;
            T[i].push_back(L - 1);
        }
    }
    
    queue<int> que;
    que.push(0);
    C_check[0] = 1;
    while ( !que.empty() )
    {
        const ll cur = que.front();
        que.pop();
        
        rep(i,K[cur])
        {
            rep(j,N)
            {
                if(ma[j][T[cur][i]] == 1 && C_check[j] == 0)
                {
                    que.push(j);
                    C_check[j] = 1;
                }
            }
        }
    }
    
    rep(i,N)
    {
        if(C_check[i] == 0)
        {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Interpretation
User otofu
Language C++14 (Clang 3.8.0)
Score 0
Code Size 1962 Byte
Status CE

Compile Error

/tmp/Main-4ac55c.o: In function `main':
./Main.cpp:(.text+0x1c8): relocation truncated to fit: R_X86_64_PC32 against symbol `C_check' defined in .bss section in /tmp/Main-4ac55c.o
./Main.cpp:(.text+0x28f): relocation truncated to fit: R_X86_64_32S against symbol `C_check' defined in .bss section in /tmp/Main-4ac55c.o
./Main.cpp:(.text+0x2fc): relocation truncated to fit: R_X86_64_32S against symbol `C_check' defined in .bss section in /tmp/Main-4ac55c.o
./Main.cpp:(.text+0x363): relocation truncated to fit: R_X86_64_32S against symbol `C_check' defined in .bss section in /tmp/Main-4ac55c.o
clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)