QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54797#2971. Wordle with FriendsBeevo#WA 4ms3716kbC++231.5kb2022-10-10 14:39:352022-10-10 14:39:36

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-10 14:39:36]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:3716kb
  • [2022-10-10 14:39:35]
  • 提交

answer

#include <bits/stdc++.h>

#define el '\n'
#define ll long long
#define ld long double

#define Beevo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

void testCase() {
    int n, m;
    cin >> n >> m;

    string s, t;
    string sol(5, '-');
    vector<int> freq(26), mxFreq(26, 6);
    for (int i = 0; i < n; i++) {
        cin >> s >> t;

        vector<int> curFreq(26);
        for (int j = 0; j < 5; j++) {
            if (t[j] != '-')
                curFreq[s[j] - 'A']++;

            if (t[j] == 'G')
                sol[j] = s[j];
        }

        for (int j = 0; j < 5; j++) {
            if (t[j] == '-')
                mxFreq[s[j] - 'A'] = min(mxFreq[s[j] - 'A'], curFreq[s[j] - 'A']);
        }

        for (int j = 0; j < 26; j++)
            freq[j] = max(freq[j], curFreq[j]);
    }

    while (m--) {
        cin >> s;

        vector<int> curFreq(26);
        for (auto &i: s)
            curFreq[i - 'A']++;

        bool valid = 1;
        for (int i = 0; i < 26; i++) {
            if (freq[i] > curFreq[i] || curFreq[i] > mxFreq[i])
                valid = 0;
        }

        for (int i = 0; i < 5; i++) {
            if (sol[i] != '-' && sol[i] != s[i])
                valid = 0;
        }

        if (valid)
            cout << s << el;
    }
}

signed main() {
    Beevo

    int T = 1;
//    cin >> T;

    while (T--)
        testCase();

    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3612kb

input:

2 5
BERRY -G---
APPLE ---YY
MELON
BERRY
LEMON
LIMES
APPLE

output:

MELON
LEMON

result:

ok 2 lines

Test #2:

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

input:

3 5
BERRY -G---
APPLE ---YY
LIMES G-GY-
APPLE
BERRY
LEMON
LIMES
MELON

output:

LEMON

result:

ok single line: 'LEMON'

Test #3:

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

input:

3 5
BLANK --Y--
SIGHS ----G
STORM YGG-Y
ATOMS
BLANK
MOATS
SIGHS
STORM

output:

ATOMS

result:

ok single line: 'ATOMS'

Test #4:

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

input:

4 5
FRUIT -G--Y
NUTTY --Y--
ROOTS Y--YG
SEEDS -YG-G
FRUIT
NUTTY
ROOTS
SEEDS
TREES

output:

TREES

result:

ok single line: 'TREES'

Test #5:

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

input:

4 8916
ALPHA ----G
GAMMA Y--GG
DELTA ----G
OMEGA -Y-YG
AAHED
AALII
AARGH
ABACA
ABACI
ABACK
ABAFT
ABAKA
ABAMP
ABASE
ABASH
ABATE
ABAYA
ABBAS
ABBES
ABBEY
ABBOT
ABEAM
ABELE
ABETS
ABHOR
ABIDE
ABLED
ABLER
ABLES
ABMHO
ABODE
ABOHM
ABOIL
ABOMA
ABOON
ABORT
ABOUT
ABOVE
ABRIS
ABUSE
ABUTS
ABUZZ
ABYES
ABYSM
ABYSS...

output:

SIGMA

result:

ok single line: 'SIGMA'

Test #6:

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

input:

3 8916
SHARP G----
HEART -----
KNACK -G---
AAHED
AALII
AARGH
ABACA
ABACI
ABACK
ABAFT
ABAKA
ABAMP
ABASE
ABASH
ABATE
ABAYA
ABBAS
ABBES
ABBEY
ABBOT
ABEAM
ABELE
ABETS
ABHOR
ABIDE
ABLED
ABLER
ABLES
ABMHO
ABODE
ABOHM
ABOIL
ABOMA
ABOON
ABORT
ABOUT
ABOVE
ABRIS
ABUSE
ABUTS
ABUZZ
ABYES
ABYSM
ABYSS
ACARI
ACERB...

output:

SNIBS
SNIFF
SNOBS
SNOGS
SNOOD
SNOOL
SNOWS
SNOWY
SNUBS
SNUFF
SNUGS

result:

ok 11 lines

Test #7:

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

input:

3 8916
MOUNT -G---
AREAS -Y---
KICKS --GG-
AAHED
AALII
AARGH
ABACA
ABACI
ABACK
ABAFT
ABAKA
ABAMP
ABASE
ABASH
ABATE
ABAYA
ABBAS
ABBES
ABBEY
ABBOT
ABEAM
ABELE
ABETS
ABHOR
ABIDE
ABLED
ABLER
ABLES
ABMHO
ABODE
ABOHM
ABOIL
ABOMA
ABOON
ABORT
ABOUT
ABOVE
ABRIS
ABUSE
ABUTS
ABUZZ
ABYES
ABYSM
ABYSS
ACARI
ACERB...

output:

ROCKY

result:

ok single line: 'ROCKY'

Test #8:

score: -100
Wrong Answer
time: 4ms
memory: 3640kb

input:

3 8916
IRATE Y--G-
STAIR YY-Y-
RAISE --YY-
AAHED
AALII
AARGH
ABACA
ABACI
ABACK
ABAFT
ABAKA
ABAMP
ABASE
ABASH
ABATE
ABAYA
ABBAS
ABBES
ABBEY
ABBOT
ABEAM
ABELE
ABETS
ABHOR
ABIDE
ABLED
ABLER
ABLES
ABMHO
ABODE
ABOHM
ABOIL
ABOMA
ABOON
ABORT
ABOUT
ABOVE
ABRIS
ABUSE
ABUTS
ABUZZ
ABYES
ABYSM
ABYSS
ACARI
ACERB...

output:

BINTS
BITTS
CHITS
CISTS
DINTS
DOITS
DUITS
FISTS
FLITS
GIFTS
GILTS
GISTS
HILTS
HINTS
HISTS
JILTS
KILTS
KISTS
KNITS
LIFTS
LILTS
LINTS
LISTS
MILTS
MINTS
MISTS
MISTY
MITTS
OBITS
OMITS
PINTS
QUITS
SIFTS
SILTS
SILTY
SIXTH
SIXTY
SKITS
SLITS
SMITH
SNITS
SPITS
SPITZ
SUITS
SWITH
TILTS
TINTS
TOITS
TWITS
UNITS
...

result:

wrong answer 3rd lines differ - expected: 'CISTS', found: 'CHITS'