QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#59522#2941. LetterleHoliLSAC ✓3ms3584kbC++14701b2022-10-30 03:40:512022-10-30 03:40:53

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-30 03:40:53]
  • Judged
  • Verdict: AC
  • Time: 3ms
  • Memory: 3584kb
  • [2022-10-30 03:40:51]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
string s, aux, salida;
int g = 0, stop = 0;
set<char> pos;
bool good = false;
int main() {
	cin >> s;
	for(int i = 0; i < s.length(); i++){
		pos.insert(s[i]);
	}
	while(!good && cin >> aux && stop < 7){
		for(int i = 0; i < aux.length(); i++){
			if(s[i] == aux[i]){
				salida += "G";
				g++;
			}else if(pos.count(aux[i])){
				salida += "Y";
			}else{
				salida += "X";
			}
		}
		if(g == 5){
			good = true;
		}else{
			if(stop != 6){
				cout << salida << endl;
			}
			stop++;
			salida = "";
			g = 0; 

		}
	}
	if(good){
		cout << "WINNER" << endl;
	}else{
		cout << "LOSER" << endl;
	}
	

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3428kb

input:

LIMIT
ABCDE
FGHIJ
KLMNO
PQRST
LIMIT
LEMET
LAMET

output:

XXXXX
XXXGX
XYGXX
XXXXG
WINNER

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3584kb

input:

LIMIT
ABCDE
FGHIJ
KLMNO
PQRST
LAMIT
LEMIT
LOMIT

output:

XXXXX
XXXGX
XYGXX
XXXXG
GXGGG
GXGGG
LOSER

result:

ok 7 lines

Test #3:

score: 0
Accepted
time: 2ms
memory: 3540kb

input:

AAAAA
ABCDE
ABCDA
ABABA
ABAAA
AAAAA
AAAAA
AAAAA

output:

GXXXX
GXXXG
GXGXG
GXGGG
WINNER

result:

ok 5 lines

Test #4:

score: 0
Accepted
time: 1ms
memory: 3496kb

input:

AAAAA
ABCDE
ABCDA
ABABA
ABAAA
AAAAA
AABAA
BAAAB

output:

GXXXX
GXXXG
GXGXG
GXGGG
WINNER

result:

ok 5 lines

Test #5:

score: 0
Accepted
time: 2ms
memory: 3384kb

input:

AAAAA
ABCDE
ABCDA
ABABA
ABAAA
AABAA
AAAAA
BAAAB

output:

GXXXX
GXXXG
GXGXG
GXGGG
GGXGG
WINNER

result:

ok 6 lines

Test #6:

score: 0
Accepted
time: 2ms
memory: 3584kb

input:

AAAAA
ABCDE
ABCDA
ABABA
ABAAA
AABAA
BAAAB
AAAAA

output:

GXXXX
GXXXG
GXGXG
GXGGG
GGXGG
XGGGX
WINNER

result:

ok 7 lines

Test #7:

score: 0
Accepted
time: 2ms
memory: 3472kb

input:

AAAAA
AAAAA
ABCDE
ABCDA
ABABA
ABAAA
AABAA
BAAAB

output:

WINNER

result:

ok single line: 'WINNER'

Test #8:

score: 0
Accepted
time: 3ms
memory: 3560kb

input:

TRUMP
PMURT
TURPM
UPMRT
TRUMP
MPUTR
MUPRT
TURMP

output:

YYGYY
GYYYY
YYYYY
WINNER

result:

ok 4 lines

Test #9:

score: 0
Accepted
time: 3ms
memory: 3556kb

input:

TRUMP
TRUMP
PMURT
TURPM
UPMRT
MPUTR
MUPRT
TURMP

output:

WINNER

result:

ok single line: 'WINNER'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3444kb

input:

TRUMP
PMURT
TRUMP
TURPM
UPMRT
MPUTR
MUPRT
TURMP

output:

YYGYY
WINNER

result:

ok 2 lines

Test #11:

score: 0
Accepted
time: 3ms
memory: 3496kb

input:

TRUMP
PMURT
TURPM
UPMRT
MPUTR
MUPRT
TURMP
TRUMP

output:

YYGYY
GYYYY
YYYYY
YYGYY
YYYYY
GYYGG
WINNER

result:

ok 7 lines

Test #12:

score: 0
Accepted
time: 0ms
memory: 3492kb

input:

TRUMP
PMURT
TURPM
UPMRT
PRUMT
MPUTR
MUPRT
TURMP

output:

YYGYY
GYYYY
YYYYY
YGGGY
YYGYY
YYYYY
LOSER

result:

ok 7 lines