| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 255044 | davooddkareshki | 송금 (JOI19_remittance) | C++17 | 244 ms | 17144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define pii pair<int,int>
#define mpr make_pair
typedef long long ll;
const int maxn = 2e5+10;
const int mod = 1e9+7;
const ll inf = 1e18;
int n, m;
int a[maxn], b[maxn], pw2[maxn], c[maxn];
signed main()
{
int swa = 0, swb = 0;
pw2[0] = 1;
cin>> n;
for(int i = 1; i <= n; i++)
{
pw2[i] = pw2[i-1] * 2;
cin>> a[i] >> b[i];
if(a[i]) swa = 1;
if(b[i]) swb = 1;
c[i] = a[i] - b[i];
}
if(!swb)
{
if(swa) cout<<"No";
else cout<<"Yes";
return 0;
}
for(int i = 1; i <= n; i++)
{
int sum = 0;
int M = n;
int j = i, power = 0;
while(M--)
{
sum += c[j] * pw2[power];
j = j%n+1;
power++;
}
//cout<< sum <<"\n";
if(sum % (pw2[n]-1)) return cout<<"No", 0;
if(sum < 0) return cout<<"No", 0;
}
cout<<"Yes";
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
