QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#714692#2941. LetterleBackToSquare1AC ✓0ms3860kbC++201.4kb2024-11-06 02:37:442024-11-06 02:37:44

Judging History

This is the latest submission verdict.

  • [2024-11-06 02:37:44]
  • Judged
  • Verdict: AC
  • Time: 0ms
  • Memory: 3860kb
  • [2024-11-06 02:37:44]
  • Submitted

answer

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
// using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
 
typedef pair<ll, ll> pl;
typedef pair<ld,ld> pd;
typedef vector<ll> vl;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
 
#define G(x) ll x; cin >> x;
#define F(i, l, r) for (ll i = l; i < (r); ++i)
#define all(a) begin(a), end(a)
#define K first
#define V second
#define OK(i,j) i >= 0 && i < n && j >= 0 && j < m
 
#define NN 2505
#define MM 5005
#define MOD 1000000007

void solve() {

    string s;
    cin >> s;
    set<char> present;

    for(ll i=0;i<5;i++) present.insert(s[i]);
    bool solved = 0;
    string t;
    ll ct = 0;
    while(ct < 7) {
        cin >> t;
        if(s == t) {
            cout << "WINNER\n";
            solved = 1;
            break;
        }
        string out = "";
        for(ll i=0;i<5;i++) {
            if(s[i] == t[i]) out += 'G';
            else if(present.count(t[i]) > 0) out += 'Y';
            else out += 'X';
        }
        if(ct < 6) cout << out << '\n';

        ct++;
    }

    if(!solved) cout << "LOSER\n";

}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cout << fixed << setprecision(10);

    solve();

    return 0;

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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

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

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

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

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

input:

AAAAA
AAAAA
ABCDE
ABCDA
ABABA
ABAAA
AABAA
BAAAB

output:

WINNER

result:

ok single line: 'WINNER'

Test #8:

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

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

input:

TRUMP
TRUMP
PMURT
TURPM
UPMRT
MPUTR
MUPRT
TURMP

output:

WINNER

result:

ok single line: 'WINNER'

Test #10:

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

input:

TRUMP
PMURT
TRUMP
TURPM
UPMRT
MPUTR
MUPRT
TURMP

output:

YYGYY
WINNER

result:

ok 2 lines

Test #11:

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

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

input:

TRUMP
PMURT
TURPM
UPMRT
PRUMT
MPUTR
MUPRT
TURMP

output:

YYGYY
GYYYY
YYYYY
YGGGY
YYGYY
YYYYY
LOSER

result:

ok 7 lines