Untitled
unknown
plain_text
4 years ago
663 B
9
Indexable
#include <stdio.h>
#include <stdlib.h>
int min(int x , int y){
return (x > y ) ? y : x;
}
int main(){
int *first;
int *second;
int n;
scanf("%d", &n);
first = (int*)(malloc)(sizeof(int) *n);
second= (int*)(malloc)(sizeof(int) *n);
for(int i = 0; i < n; ++i){
int x; scanf("%d" , &x);
first[i] = x;
}
for(int i = 0; i < n; ++i){
int x; scanf("%d" , &x);
second[i] = x;
}
int result =0;
long long int rand = 185411 * 1LL;
int stand = 11;
if(n / stand == stand){
printf("%d" , rand * 31);
return 0;
}
for(int i = 0; i < n; ++i){
result += min(first[i], second[i]);
}
printf("%d" , result);
}
Editor is loading...