QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#227771#2941. LetterleThallium54#AC ✓0ms3800kbC++20923b2023-10-27 22:57:232023-10-27 22:57:24

Judging History

This is the latest submission verdict.

  • [2023-10-27 22:57:24]
  • Judged
  • Verdict: AC
  • Time: 0ms
  • Memory: 3800kb
  • [2023-10-27 22:57:23]
  • Submitted

answer

#include<bits/stdc++.h>

using namespace std;
 
typedef long long int ll;
typedef long double ld;
#define f first
#define s second
#define pb push_back
#define pii pair<int, int>

 
const int N = 2e5 + 100;
const int inf = 1e9;
const ll mod =  998244353;


bool mark[10];

int main()
{
	string s, t = "";
	cin >> s;
	
	for(int i = 0; i < 5; i++)
		mark[(s[i]-'A')] = 1;
	//cout << mark[0] << endl;	
	int cnt = 0;
	while(1)
	{
		string ans = "";
		cin >> t;
		cnt++;
		if(t == s)
		{
			cout << "WINNER" << endl;
			return 0;
		}
		else if(cnt == 7)
		{
			cout << "LOSER" << endl;
			return 0;
		}
		for(int i = 0; i < 5; i++)
		{
			//cout << i << ' ' << << ' ' << mark[(s[i]-'A')] << endl;
			if(s[i] == t[i])
				ans += 'G';
			else if(mark[(t[i]-'A')])
				ans += 'Y';
			else
				ans += 'X';		
		}
		cout << ans << endl;
	}
	
					 
	
	
    return 0;
}



詳細信息

Test #1:

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

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: 0ms
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: 0ms
memory: 3732kb

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: 0ms
memory: 3548kb

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: 0ms
memory: 3512kb

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: 0ms
memory: 3728kb

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: 0ms
memory: 3580kb

input:

AAAAA
AAAAA
ABCDE
ABCDA
ABABA
ABAAA
AABAA
BAAAB

output:

WINNER

result:

ok single line: 'WINNER'

Test #8:

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

input:

TRUMP
PMURT
TURPM
UPMRT
TRUMP
MPUTR
MUPRT
TURMP

output:

YYGYY
GYYYY
YYYYY
WINNER

result:

ok 4 lines

Test #9:

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

input:

TRUMP
TRUMP
PMURT
TURPM
UPMRT
MPUTR
MUPRT
TURMP

output:

WINNER

result:

ok single line: 'WINNER'

Test #10:

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

input:

TRUMP
PMURT
TRUMP
TURPM
UPMRT
MPUTR
MUPRT
TURMP

output:

YYGYY
WINNER

result:

ok 2 lines

Test #11:

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

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: 3800kb

input:

TRUMP
PMURT
TURPM
UPMRT
PRUMT
MPUTR
MUPRT
TURMP

output:

YYGYY
GYYYY
YYYYY
YGGGY
YYGYY
YYYYY
LOSER

result:

ok 7 lines