?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
144734815 |
Practice: hydra_cody |
1097B - 32 | C++14 (GCC 6-32) | Accepted | 15 ms | 12 KB | 2022-01-31 18:59:47 | 2022-01-31 18:59:47 |
#include<bits/stdc++.h> using namespace std; #define endl "\n" #define ll long long int #define lld long double const int mod = 1000000007; //------------------------------------------------------------------------------- void solve() { ll n; cin>>n; ll arr[n]; for(ll i=0;i<n;i++){ cin>>arr[i]; } for(ll i=0;i<(1<<n);i++){ ll ans=0; for(ll j=0;j<n;j++){ if(i&(1<<j)){ ans=(ans+arr[j])%360; }else{ ans=(ans-arr[j])%360; } } if(ans==0){ cout<<"YES"<<endl; return; } } cout<<"NO"<<endl; } int32_t main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); srand(chrono::high_resolution_clock::now().time_since_epoch().count()); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif solve(); return 0; }
?
?
?
?