/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 284.0 KiB
#2 Accepted 1ms 332.0 KiB
#3 Accepted 1ms 332.0 KiB
#4 Accepted 1ms 336.0 KiB
#5 Accepted 1ms 516.0 KiB
#6 Accepted 1ms 328.0 KiB
#7 Accepted 1ms 332.0 KiB
#8 Accepted 1ms 372.0 KiB

Code

#include <stdio.h>
#include <string.h>

#define TARGET "SeriousOJ"

int main() {
    int T;
    scanf("%d", &T);

    while (T--) {
        int N;
        scanf("%d", &N);
        char S[N+1];
        scanf("%s", S);

        int i = 0, j = 0;
        while (S[i] != '\0' && TARGET[j] != '\0') {
            if (S[i] == TARGET[j]) {
                j++;
            }
            i++;
        }

        if (TARGET[j] == '\0') {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1147 SeriousOJ Challenge
Contest
LU IUJPC : Sylhet Division 2024 Replay Contest
Language
C11 (GCC 13.2.0)
Submit At
2024-12-10 09:59:52
Judged At
2024-12-10 09:59:52
Judged By
Score
100
Total Time
1ms
Peak Memory
516.0 KiB