Submission #34998

#TimeUsernameProblemLanguageResultExecution timeMemory
34998xooxooxooxoox스파이 (JOI13_spy)C++98
Compilation error
0 ms0 KiB
#include<iostream> #include<cstdio> #include<cmath> #include<deque> #include<queue> #include<stack> #include<set> #include<vector> #include<algorithm> #include<array> #include<iomanip> #include<bitset> #define ll int #define ld long double #define maxN 2001 #define oo 1000000000000000001 #define Mod 1000000007 #define pii pair<ll,ll> #define fi first #define se second #define piii pair<ll,pii> #define fifi first.first #define fise first.second #define sefi second.first #define sese second.second #define endl '\n' #define gc getchar #define pc putchar using namespace std; ll n,m; ll x,y; vector<ll> f[maxN]; vector<ll> g[maxN]; bitset<500001> p[maxN]; bitset<500001> q[maxN]; void DFS1(ll u) { for(int v:f[u]) { p[v]|=p[u]; DFS1(v); } } void DFS2(ll u) { for(int v:g[u]) { q[v]|=q[u]; DFS2(v); } } void Enter() { cin>>n>>m; //read(n); //read(m); for(int i=1;i<=n;++i) { cin>>x>>y; //read(x); //read(y); f[x].push_back(i); g[y].push_back(i); } for(int i=0;i<m;++i) { cin>>x>>y; //read(x); //read(y); p[x].set(i); q[y].set(i); } DFS1(0); DFS2(0); for(int i=1;i<=n;++i) { ll ans=(p[i]&q[i]).count(); //writeln(ans); cout<<ans<<endl; } } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); //freopen("SPY.inp","r",stdin); //freopen("SPY.out","w",stdout); Enter(); }

Compilation message (stderr)

In file included from /usr/include/c++/5/array:35:0,
                 from spy.cpp:10:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
spy.cpp: In function 'void DFS1(int)':
spy.cpp:42:15: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++11
     for(int v:f[u])
               ^
spy.cpp: In function 'void DFS2(int)':
spy.cpp:50:15: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++11
     for(int v:g[u])
               ^