Submission #2124593
Source Code Expand
#include<stdio.h> #include<string.h> #include<algorithm> #include<math.h> using namespace std; #define N 10010 int a[N],b[N],c[N]; int main() { long long s1,s2; int i,j,k,n; s1=0; s2=0; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d",&a[i]); for(i=1;i<=n;i++) scanf("%d",&b[i]); for(i=1;i<=n;i++) c[i]=a[i]-b[i]; sort(c+1,c+n+1); for(i=1;i<=n;i++) { if(c[i]>0) break; s1=s1+c[i]/2; } for(;i<=n;i++) s2=s2+c[i]; s1=fabs(s1); if(s1<s2) printf("No\n"); else printf("Yes\n"); //printf("%lld %lld\n",s1,s2); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Two Arrays |
User | vjudge4 |
Language | Bash (GNU bash v4.3.11) |
Score | 0 |
Code Size | 659 Byte |
Status | RE |
Exec Time | 3 ms |
Memory | 576 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||
Status |
|
|
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 | RE | 3 ms | 568 KB |
0_001.txt | RE | 3 ms | 572 KB |
0_002.txt | RE | 3 ms | 568 KB |
1_003.txt | RE | 3 ms | 568 KB |
1_004.txt | RE | 3 ms | 572 KB |
1_005.txt | RE | 3 ms | 572 KB |
1_006.txt | RE | 3 ms | 572 KB |
1_007.txt | RE | 3 ms | 572 KB |
1_008.txt | RE | 3 ms | 572 KB |
1_009.txt | RE | 3 ms | 572 KB |
1_010.txt | RE | 3 ms | 568 KB |
1_011.txt | RE | 3 ms | 568 KB |
1_012.txt | RE | 3 ms | 576 KB |
1_013.txt | RE | 3 ms | 572 KB |
1_014.txt | RE | 3 ms | 568 KB |
1_015.txt | RE | 3 ms | 572 KB |
1_016.txt | RE | 3 ms | 568 KB |
1_017.txt | RE | 3 ms | 568 KB |
1_018.txt | RE | 3 ms | 572 KB |
1_019.txt | RE | 3 ms | 572 KB |
1_020.txt | RE | 3 ms | 572 KB |
1_021.txt | RE | 3 ms | 572 KB |
1_022.txt | RE | 3 ms | 572 KB |
1_023.txt | RE | 3 ms | 572 KB |
1_024.txt | RE | 3 ms | 568 KB |
1_025.txt | RE | 3 ms | 572 KB |
1_026.txt | RE | 3 ms | 572 KB |
1_027.txt | RE | 3 ms | 572 KB |