/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 540.0 KiB
#2 Runtime Error 12ms 580.0 KiB

Code

#include <stdio.h>
#include <stdlib.h>

#define MAXN 10005

int main() {
    int N, M;
    scanf("%d", &N);
    int main_scores[MAXN];
    for (int i = 0; i < N; i++) {
        scanf("%d", &main_scores[i]);
    }

    scanf("%d", &M);
    int reply_scores[MAXN];
    for (int i = 0; i < M; i++) {
        scanf("%d", &reply_scores[i]);
    }

    int combined_scores[MAXN + MAXN];
    int idx = 0;
    for (int i = 0; i < N; i++) {
        combined_scores[idx++] = main_scores[i];
    }
    for (int i = 0; i < M; i++) {
        combined_scores[idx++] = reply_scores[i];
    }

    int rank[MAXN + MAXN];
    for (int i = 0; i < idx; i++) {
        rank[i] = 1;
        for (int j = 0; j < idx; j++) {
            if (i!= j && combined_scores[i] < combined_scores[j]) {
                rank[i]++;
            }
        }
    }

    for (int i = N; i < idx; i++) {
        printf("%d ", rank[i]);
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1049 Combined scoreboard
Contest
Brain Booster #3
Language
C++17 (G++ 13.2.0)
Submit At
2024-05-06 15:59:51
Judged At
2024-11-11 03:33:34
Judged By
Score
0
Total Time
12ms
Peak Memory
580.0 KiB