Submission #19551407


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

int main() {
	long long n,i,cur1,cur2,res;
	cin >> n;
	vector<long long> a(n),b(n);
	for(i=0; i<n; i++){
		cin >> a[i];
	}
	for(i=0; i<n; i++){
		cin >> b[i];
	}
	
	cur1=0; cur2=0;
	for(i=0; i<n; i++){
		if(b[i]-a[i]>0){
			cur1+=(b[i]-a[i])/2;
		}else{
			cur2+=a[i]-b[i];
		}
	}
	if(cur2>cur1){
		cout << "No" << endl;
	}else{
		cout << "Yes" << endl;
	}
	
	return 0;
}

Submission Info

Submission Time
Task B - Two Arrays
User T_Stream
Language C++ (GCC 9.2.1)
Score 300
Code Size 447 Byte
Status AC
Exec Time 21 ms
Memory 3780 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:26: warning: unused variable ‘res’ [-Wunused-variable]
    5 |  long long n,i,cur1,cur2,res;
      |                          ^~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 28
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt
Case Name Status Exec Time Memory
0_000.txt AC 7 ms 3520 KB
0_001.txt AC 2 ms 3608 KB
0_002.txt AC 2 ms 3608 KB
1_003.txt AC 15 ms 3628 KB
1_004.txt AC 16 ms 3748 KB
1_005.txt AC 17 ms 3744 KB
1_006.txt AC 14 ms 3732 KB
1_007.txt AC 14 ms 3704 KB
1_008.txt AC 19 ms 3624 KB
1_009.txt AC 14 ms 3620 KB
1_010.txt AC 14 ms 3704 KB
1_011.txt AC 16 ms 3728 KB
1_012.txt AC 13 ms 3764 KB
1_013.txt AC 13 ms 3620 KB
1_014.txt AC 15 ms 3672 KB
1_015.txt AC 13 ms 3568 KB
1_016.txt AC 15 ms 3780 KB
1_017.txt AC 21 ms 3700 KB
1_018.txt AC 13 ms 3708 KB
1_019.txt AC 15 ms 3732 KB
1_020.txt AC 14 ms 3556 KB
1_021.txt AC 15 ms 3704 KB
1_022.txt AC 20 ms 3572 KB
1_023.txt AC 14 ms 3628 KB
1_024.txt AC 13 ms 3752 KB
1_025.txt AC 19 ms 3748 KB
1_026.txt AC 14 ms 3620 KB
1_027.txt AC 15 ms 3628 KB