/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 532.0 KiB
#2 Accepted 2ms 540.0 KiB
#3 Accepted 2ms 332.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 2ms 772.0 KiB
#6 Accepted 2ms 824.0 KiB
#7 Accepted 2ms 796.0 KiB
#8 Accepted 2ms 796.0 KiB

Code

#include <iostream>
using namespace std;

int main(){
	ios :: sync_with_stdio(false);
	cin.tie(0);
	
	int tc;
	cin>>tc;
	while(tc--){
		int n;
		cin>>n;
		string str;
		cin>>str;
		string ans ="";
		// SeriousOJ
		for(int i=0;i<n;i++){
			if(str[i] == 'S' && ans.size() == 0){
				ans += str[i];
			}
			else if(str[i] == 'e' && ans.size() == 1){
				ans += str[i];
			}
			else if(str[i] == 'r' && ans.size() == 2){
				ans += str[i];
			}
			else if(str[i] == 'i' && ans.size() == 3){
				ans += str[i];
			}
			else if(str[i] == 'o' && ans.size() == 4){
				ans += str[i];
			}
			else if(str[i] == 'u' && ans.size() == 5){
				ans += str[i];
			}
			else if(str[i] == 's' && ans.size() == 6){
				ans += str[i];
			}
			else if(str[i] == 'O' && ans.size() == 7){
				ans += str[i];
			}
			else if(str[i] == 'J' && ans.size() == 8){
				ans += str[i];
			}
		}
		if(ans == "SeriousOJ"){
			cout<<"YES\n";
		}
		else{
			cout<<"NO\n";
		}
	}
	return 0;
}

Information

Submit By
Type
Submission
Problem
P1147 SeriousOJ Challenge
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-10 19:49:38
Judged At
2024-12-10 19:49:38
Judged By
Score
100
Total Time
2ms
Peak Memory
824.0 KiB