Submission #1333201

#TimeUsernameProblemLanguageResultExecution timeMemory
1333201model_codeTrain Or Bus (NOI25_trainorbus)C++20
100 / 100
0 ms344 KiB
#include <cstdio>
 
int a[10];
int b[10];
int main() {
    int n;
    scanf("%d", &n);
    for(int i=0; i<n; i++) {
        scanf("%d", a+i);
    }
    for(int i=0; i<n; i++) {
        scanf("%d", b+i);
    }
    int ans = 0;
    for(int i=0; i<n; i++) {
        if(a[i]<b[i]) {
            ans += a[i];
        } else {
            ans += b[i];
        }
    }
    printf("%d", ans);
}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
Main.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |         scanf("%d", a+i);
      |         ~~~~~^~~~~~~~~~~
Main.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d", b+i);
      |         ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...