/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 1.066 MiB
#2 Time Exceeded ≥2088ms ≥1.898 MiB
#3 Time Exceeded ≥2066ms ≥1.805 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;
            }
            else if (m2[i] == t2[j] ){
                t2[j] = 1000000;
                m2[i] = 9999999;

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


    /*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:32:48
Judged At
2024-11-11 03:33:01
Judged By
Score
5
Total Time
≥2088ms
Peak Memory
≥1.898 MiB