/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 1.02 MiB
#2 Time Exceeded ≥2086ms ≥1.777 MiB
#3 Time Exceeded ≥2078ms ≥1.809 MiB
#4 Time Exceeded ≥2090ms ≥1.809 MiB
#5 Time Exceeded ≥2082ms ≥1.805 MiB
#6 Time Exceeded ≥2086ms ≥1.812 MiB
#7 Time Exceeded ≥2093ms ≥1.805 MiB
#8 Time Exceeded ≥2083ms ≥1.812 MiB
#9 Time Exceeded ≥2092ms ≥1.77 MiB
#10 Time Exceeded ≥2042ms ≥1.816 MiB
#11 Time Exceeded ≥2084ms ≥1.562 MiB
#12 Wrong Answer 1893ms 1.445 MiB

Code

#include <stdio.h>

int main(){

    int n, m;
    int t[100000], t2[100000];

    scanf("%d", &n);

    int n1[n+100];

    for(int i = 0;i < n; i++){
        scanf("%d", &n1[i]);
        t[i] = n1[i];
    }

    scanf("%d", &m);

    int k = n+m;

    int m2[m+100];

    for(int i = 0, j = n;i < m; i++, j++){
        scanf("%d", &m2[i]);
        t[j] = m2[i];
    }

    int max, max_ind;

    for(int i = 0; i < k; i++){
        max = t[i];
        for(int j = 0; j < k; j++){
            if(max <=  t[j]){
                max = t[j];
                max_ind = j;
            }
        }
        t2[i] = max;
        t[max_ind] = 0;
    }

    /*for(int i = 0; i < k; i++){
        printf("%d ", t2[i]);
    }

    printf("\n");
*/
    for(int i = 0; i < k; i++){
        for(int j = 0; j < k; j++){
            if (n1[i] == t2[j]){
                t2[j] = 1000000;
                n1[i] = 9999999;
            }
        }
    }


    /*for(int i = 0; i < k; i++){
        printf("%d ", t2[i]);
    }*/

    //printf("\n\n");
    for(int i = 0; i < k; i++){
        for(int j = 0; j < k; j++){
            /*if (n1[i] == t2[j]){
                t2[j] = 1000000;
            }*/
            if (m2[i] == t2[j] ){
                t2[j] = 1000000;
                m2[i] = 9999999;

                printf("%d ", j+1);
            }
        }
    }




    return 0;
}

Information

Submit By
Type
Submission
Problem
P1049 Combined scoreboard
Contest
Brain Booster #3
Language
C99 (GCC 13.2.0)
Submit At
2024-05-06 16:28:50
Judged At
2024-10-03 13:50:04
Judged By
Score
5
Total Time
≥2093ms
Peak Memory
≥1.816 MiB