/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 576.0 KiB
#2 Runtime Error 7ms 580.0 KiB
#3 Runtime Error 7ms 652.0 KiB
#4 Runtime Error 7ms 648.0 KiB
#5 Runtime Error 7ms 576.0 KiB
#6 Runtime Error 7ms 652.0 KiB
#7 Runtime Error 6ms 648.0 KiB
#8 Runtime Error 6ms 652.0 KiB
#9 Runtime Error 6ms 580.0 KiB
#10 Runtime Error 5ms 652.0 KiB
#11 Runtime Error 6ms 656.0 KiB
#12 Time Exceeded ≥2075ms ≥652.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-10-03 13:50:58
Judged By
Score
0
Total Time
2075ms
Peak Memory
656.0 KiB