# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
677738 | 2023-01-04T09:12:45 Z | benedict0724 | Remittance (JOI19_remittance) | C++17 | 0 ms | 0 KB |
#include <iostream> #include <stack> #include <string> #include <queue> #include <vector> #include <set> #include <map> #include <algorithm> #include <cassert> using namespace std; typedef long long ll; ll A[22], B[22], C[22]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int N; cin >> N; for(int i=0;i<N;i++) cin >> A[i] >> B[i]; for(int i=0;i<N;i++) cin >> C[i]; ll X = (1<<N) - 1; bool flag = true; for(int i=0;i<N;i++) { ll tmp = 0; for(int j=0;j<=;j++) { tmp += (1<<j) * C[(i+j+1)%N]; } if(tmp%X != 0) flag = false; } if(flag) cout << "YES\n"; else cout << "NO\n"; }