답안 #729041

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
729041 2023-04-23T12:23:56 Z Rafi22 Amusement Park (CEOI19_amusementpark) C++14
컴파일 오류
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 long
ll 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> 
      |                         ^
amusementpark.cpp:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> 
      |                         ^
amusementpark.cpp:2:21: error: extended character   is not valid in an identifier
    2 | using namespace std; 
      |                     ^
amusementpark.cpp:12:29: error: extended character   is not valid in an identifier
   12 | 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:12:46: error: extended character   is not valid in an identifier
   12 | 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:12:116: error: extended character   is not valid in an identifier
   12 | 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:2:21: error: '\U000000a0' does not name a type
    2 | using namespace std; 
      |                     ^
amusementpark.cpp:12:29: error: '\U000000a0const' does not name a type
   12 | 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:12:46: error: '\U000000a0unordered_map' does not name a type
   12 | 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:12:103: error: 'N' was not declared in this scope
   12 | 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:12:113: error: 'N' was not declared in this scope
   12 | 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:12:116: error: '\U000000a0int' does not name a type
   12 | 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;}
      |                                                                                                                  ^~~~