Submission #729040

# Submission time Handle Problem Language Result Execution time Memory
729040 2023-04-23T12:22:06 Z Rafi22 Amusement Park (CEOI19_amusementpark) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h> using namespace std; #define endl '\n'#define st first#define nd second#define pb push_back#define sz(x) (int)(x).size()#define all(x) (x).begin(), (x).end()#define ll long longll mod=998244353;int inf=1000000007;ll infl=1000000000000000007; const int N=18; unordered_map<int,int>DP[(1<<N)];vector<int>inside[(1<<N)];int G[N]; int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,m,a,b;cin>>n>>m;for(int i=0;i<m;i++){cin>>a>>b;a--,b--;G[a]^=(1<<b);G[b]^=(1<<a);}for(int i=0;i<(1<<n);i++){for(int j=0;j<n;j++) if(i&(1<<j)) inside[i].pb(j);}DP[0][(1<<n)-1]=1;for(int a=0;a<(1<<n);a++){int d=(1<<n)-1-a;for(auto [b,x]:DP[a]){for(auto k:inside[b]){int A=a^(1<<k),B=(b&((1<<n)-(1<<(k+1))))|(G[k]&((1<<n)-1-a-(1<<k)));int y=DP[A][B];y+=x;if(y>=mod) y-=mod;DP[A][B]=y;}}}cout<<(ll)DP[(1<<n)-1][0]*(ll)m%mod*499122177%mod;return 0;}

Compilation message

amusementpark.cpp:1:25: error: extended character   is not valid in an identifier
    1 | #include <bits/stdc++.h> using namespace std; #define endl '\n'#define st first#define nd second#define pb push_back#define sz(x) (int)(x).size()#define all(x) (x).begin(), (x).end()#define ll long longll mod=998244353;int inf=1000000007;ll infl=1000000000000000007; const int N=18; unordered_map<int,int>DP[(1<<N)];vector<int>inside[(1<<N)];int G[N]; int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,m,a,b;cin>>n>>m;for(int i=0;i<m;i++){cin>>a>>b;a--,b--;G[a]^=(1<<b);G[b]^=(1<<a);}for(int i=0;i<(1<<n);i++){for(int j=0;j<n;j++) if(i&(1<<j)) inside[i].pb(j);}DP[0][(1<<n)-1]=1;for(int a=0;a<(1<<n);a++){int d=(1<<n)-1-a;for(auto [b,x]:DP[a]){for(auto k:inside[b]){int A=a^(1<<k),B=(b&((1<<n)-(1<<(k+1))))|(G[k]&((1<<n)-1-a-(1<<k)));int y=DP[A][B];y+=x;if(y>=mod) y-=mod;DP[A][B]=y;}}}cout<<(ll)DP[(1<<n)-1][0]*(ll)m%mod*499122177%mod;return 0;}
      |                         ^
amusementpark.cpp:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> using namespace std; #define endl '\n'#define st first#define nd second#define pb push_back#define sz(x) (int)(x).size()#define all(x) (x).begin(), (x).end()#define ll long longll mod=998244353;int inf=1000000007;ll infl=1000000000000000007; const int N=18; unordered_map<int,int>DP[(1<<N)];vector<int>inside[(1<<N)];int G[N]; int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,m,a,b;cin>>n>>m;for(int i=0;i<m;i++){cin>>a>>b;a--,b--;G[a]^=(1<<b);G[b]^=(1<<a);}for(int i=0;i<(1<<n);i++){for(int j=0;j<n;j++) if(i&(1<<j)) inside[i].pb(j);}DP[0][(1<<n)-1]=1;for(int a=0;a<(1<<n);a++){int d=(1<<n)-1-a;for(auto [b,x]:DP[a]){for(auto k:inside[b]){int A=a^(1<<k),B=(b&((1<<n)-(1<<(k+1))))|(G[k]&((1<<n)-1-a-(1<<k)));int y=DP[A][B];y+=x;if(y>=mod) y-=mod;DP[A][B]=y;}}}cout<<(ll)DP[(1<<n)-1][0]*(ll)m%mod*499122177%mod;return 0;}
      |                         ^~~~~~
amusementpark.cpp:1:47: error: extended character   is not valid in an identifier
    1 | #include <bits/stdc++.h> using namespace std; #define endl '\n'#define st first#define nd second#define pb push_back#define sz(x) (int)(x).size()#define all(x) (x).begin(), (x).end()#define ll long longll mod=998244353;int inf=1000000007;ll infl=1000000000000000007; const int N=18; unordered_map<int,int>DP[(1<<N)];vector<int>inside[(1<<N)];int G[N]; int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,m,a,b;cin>>n>>m;for(int i=0;i<m;i++){cin>>a>>b;a--,b--;G[a]^=(1<<b);G[b]^=(1<<a);}for(int i=0;i<(1<<n);i++){for(int j=0;j<n;j++) if(i&(1<<j)) inside[i].pb(j);}DP[0][(1<<n)-1]=1;for(int a=0;a<(1<<n);a++){int d=(1<<n)-1-a;for(auto [b,x]:DP[a]){for(auto k:inside[b]){int A=a^(1<<k),B=(b&((1<<n)-(1<<(k+1))))|(G[k]&((1<<n)-1-a-(1<<k)));int y=DP[A][B];y+=x;if(y>=mod) y-=mod;DP[A][B]=y;}}}cout<<(ll)DP[(1<<n)-1][0]*(ll)m%mod*499122177%mod;return 0;}
      |                                              ^
amusementpark.cpp:1:269: error: extended character   is not valid in an identifier
    1 | #include <bits/stdc++.h> using namespace std; #define endl '\n'#define st first#define nd second#define pb push_back#define sz(x) (int)(x).size()#define all(x) (x).begin(), (x).end()#define ll long longll mod=998244353;int inf=1000000007;ll infl=1000000000000000007; const int N=18; unordered_map<int,int>DP[(1<<N)];vector<int>inside[(1<<N)];int G[N]; int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,m,a,b;cin>>n>>m;for(int i=0;i<m;i++){cin>>a>>b;a--,b--;G[a]^=(1<<b);G[b]^=(1<<a);}for(int i=0;i<(1<<n);i++){for(int j=0;j<n;j++) if(i&(1<<j)) inside[i].pb(j);}DP[0][(1<<n)-1]=1;for(int a=0;a<(1<<n);a++){int d=(1<<n)-1-a;for(auto [b,x]:DP[a]){for(auto k:inside[b]){int A=a^(1<<k),B=(b&((1<<n)-(1<<(k+1))))|(G[k]&((1<<n)-1-a-(1<<k)));int y=DP[A][B];y+=x;if(y>=mod) y-=mod;DP[A][B]=y;}}}cout<<(ll)DP[(1<<n)-1][0]*(ll)m%mod*499122177%mod;return 0;}
      |                                                                                                                                                                                                                                                                           ^
amusementpark.cpp:1:286: error: extended character   is not valid in an identifier
    1 | #include <bits/stdc++.h> using namespace std; #define endl '\n'#define st first#define nd second#define pb push_back#define sz(x) (int)(x).size()#define all(x) (x).begin(), (x).end()#define ll long longll mod=998244353;int inf=1000000007;ll infl=1000000000000000007; const int N=18; unordered_map<int,int>DP[(1<<N)];vector<int>inside[(1<<N)];int G[N]; int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,m,a,b;cin>>n>>m;for(int i=0;i<m;i++){cin>>a>>b;a--,b--;G[a]^=(1<<b);G[b]^=(1<<a);}for(int i=0;i<(1<<n);i++){for(int j=0;j<n;j++) if(i&(1<<j)) inside[i].pb(j);}DP[0][(1<<n)-1]=1;for(int a=0;a<(1<<n);a++){int d=(1<<n)-1-a;for(auto [b,x]:DP[a]){for(auto k:inside[b]){int A=a^(1<<k),B=(b&((1<<n)-(1<<(k+1))))|(G[k]&((1<<n)-1-a-(1<<k)));int y=DP[A][B];y+=x;if(y>=mod) y-=mod;DP[A][B]=y;}}}cout<<(ll)DP[(1<<n)-1][0]*(ll)m%mod*499122177%mod;return 0;}
      |                                                                                                                                                                                                                                                                                           ^