답안 #548233

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
548233 2022-04-12T18:20:57 Z MilosMilutinovic 송금 (JOI19_remittance) C++14
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
const int N=1000050;
int n;
long long a[N],b[N];
int main(){
	scanf("%i",&n);
	for(int i=0;i<n;i++)scanf("%lld%lld",&a[i],&b[i]);
	for(int j=0;j<60;j++)for(int i=0;i<n;i++){
		if(a[i]>b[i]){
			long long x=(a[i]-b[i])/2;
			a[i]-=2*x,a[(i+1)%n]+=x;
		}
	}
	bool ok=true;
	for(int i=0;i<n;i++)ok&=(a[i]==b[i]);
	puts(ok?"Yes":"No");
}

Compilation message

remittance.cpp: In function 'int main()':
remittance.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  scanf("%i",&n);
      |  ~~~~~^~~~~~~~~
remittance.cpp:8:27: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  for(int i=0;i<n;i++)scanf("%lld%lld",&a[i],&b[i]);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -