/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 284.0 KiB
#2 Time Exceeded ≥2089ms ≥1.32 MiB
#3 Time Exceeded ≥2059ms ≥1.324 MiB

Code

#include <stdio.h>

int main(){

    int x = 0, t;

    scanf("%d", &t);

    while(x < t){
        int n;

        scanf("%d", &n);
        char p[n+10];
        scanf("%s", &p);
        int count = 0;


        if(n > 1){
            for(int i = 0; i < n/2; i++){
                for (int j = n-1; j > n/2-1; j--){
                    if(i != j){
                        if(p[i] == p[j]){
                            count++;
                        }
                    }
                }
            }
            printf("%d\n", count*2);
        }

        else{
            printf("0\n");
        }



        x++;
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1038 Do not touch my string
Contest
Brain Booster #3
Language
C11 (GCC 13.2.0)
Submit At
2024-05-06 17:09:21
Judged At
2024-11-11 03:32:32
Judged By
Score
10
Total Time
≥2089ms
Peak Memory
≥1.324 MiB