QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#420071 | #8593. Coin | Faisal-Saqib# | Compile Error | / | / | C++17 | 1.4kb | 2024-05-24 14:27:57 | 2024-05-24 14:27:59 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N=200000+1;
vector<int> ma[N];
vector<int> ma_[N];
int deg[N];
bitset<N> L[N];
bitset<N> G[N];
signed main()
{
int n,m;
cin>>n>>m;
for(int j=0;j<m;j++)
{
int x,y;
cin>>x>>y;
ma[x].push_back(y);
ma_[y].push_back(x);
deg[y]++;
}
queue<int> q;
for(int j=1;j<=n;j++)
{
if(deg[j]==0)
{
q.push(j);
}
}
vector<int> level;
while(q.size())
{
int f=q.front();
level.push_back(f);
q.pop();
for(auto nx:ma[f])
{
L[nx]|=L[f];
L[nx].set(f);
deg[nx]--;
if(deg[nx]==0)
{
q.push(nx);
}
}
}
while(level.size())
{
int f=level.back();
level.pop_back();
for(auto nx:ma_[f])
{
G[nx]|=G[f];
G[nx].set(f);
}
}
// for(int j=1;j<=n;j++)
// {
// cout<<"Less than "<<j<<" are: ";
// for(int k=1;k<=n;k++)
// {
// if(L[j][k])
// {
// cout<<k<<' ';
// }
// }
// cout<<endl;
// }
// for(int j=1;j<=n;j++)
// {
// cout<<"Greater than "<<j<<" are: ";
// for(int k=1;k<=n;k++)
// {
// if(G[j][k])
// {
// cout<<k<<' ';
// }
// }
// cout<<endl;
// }
for(int v=1;v<=n;v++)
{
bitset<N> cur=(G[v]|L[v]);
if(cur.count()==(n-1))
{
cout<<1<<' ';
}
else{
cout<<-1<<' ';
}
}
cout<<endl;
return 0;
}
Details
/tmp/ccTJbYPj.o: in function `__tcf_1': answer.code:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `ma_' defined in .bss section in /tmp/ccTJbYPj.o /tmp/ccTJbYPj.o: in function `__tcf_0': answer.code:(.text+0x59): relocation truncated to fit: R_X86_64_PC32 against symbol `ma' defined in .bss section in /tmp/ccTJbYPj.o /tmp/ccTJbYPj.o: in function `main': answer.code:(.text.startup+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `ma_' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0x84): relocation truncated to fit: R_X86_64_PC32 against symbol `deg' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0xf6): relocation truncated to fit: R_X86_64_PC32 against symbol `ma' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0x1a3): relocation truncated to fit: R_X86_64_PC32 against symbol `deg' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0x241): relocation truncated to fit: R_X86_64_PC32 against symbol `deg' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0x2cf): relocation truncated to fit: R_X86_64_PC32 against symbol `ma' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0x310): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0x327): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccTJbYPj.o answer.code:(.text.startup+0x3fa): additional relocation overflows omitted from the output collect2: error: ld returned 1 exit status