/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 324.0 KiB
#2 Time Exceeded ≥2087ms ≥1.27 MiB
#3 Time Exceeded ≥2088ms ≥1.312 MiB
#4 Time Exceeded ≥2079ms ≥324.0 KiB
#5 Time Exceeded ≥2084ms ≥284.0 KiB
#6 Time Exceeded ≥2069ms ≥428.0 KiB
#7 Accepted 1494ms 428.0 KiB
#8 Accepted 179ms 428.0 KiB
#9 Accepted 67ms 456.0 KiB

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){
            count = 0;
            goto print;
        }
        else{
            for(int i = 0; i < n; i++){
                for (int j = 0; j < n; j++){
                    if(i != j){
                        if(p[i] == p[j]){
                            count++;
                        }
                    }
                }
            }
        }
        print:
        printf("%d\n", count);
        x++;
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1038 Do not touch my string
Contest
Brain Booster #3
Language
C99 (GCC 13.2.0)
Submit At
2024-05-06 16:53:49
Judged At
2024-10-03 13:49:23
Judged By
Score
50
Total Time
≥2088ms
Peak Memory
≥1.312 MiB