/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 8ms 324.0 KiB
#3 Wrong Answer 8ms 540.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    string s = "SeriousOJ";
    while (t--)
    {
        int len;
        cin >> len;
        char l[len];
        for (int i = 0; i < len; i++)
        {
            cin >> l[i];
        }
        int fi(0), k(0);
        for (int i = 0; i < 9; i++)
        {
            char c = s[i];
            for (int j = i; j < len; j++)
            {
                if (l[j] == c && k < j)
                {

                    k = j;
                    fi++;
                    break;
                }
            }
        }
        if (fi == 9)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
}

Information

Submit By
Type
Submission
Problem
P1147 SeriousOJ Challenge
Contest
LU IUJPC : Sylhet Division 2024 Replay Contest
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-10 10:05:32
Judged At
2024-12-10 10:05:32
Judged By
Score
10
Total Time
8ms
Peak Memory
540.0 KiB