Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
663 B
3
Indexable
Never
#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);
}