QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#424621 | #2971. Wordle with Friends | TheSleepyDevil# | WA | 1ms | 3812kb | C++20 | 2.6kb | 2024-05-29 14:27:20 | 2024-05-29 14:27:24 |
Judging History
answer
/*
Hell, 'til I reach Hell, I ain't scared
Mama checkin' in my bedroom, I ain't there
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define Major ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define TxtIO freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define read(a,n) for(int i = 0 ; i<n ; i++) cin>>a[i];
#define write(a) for(auto x : a) cout<<x<<" ";
#define int long long
#define pb push_back
#define all(a) a.begin(),a.end()
#define el "\n"
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int inf=4e18;
int dx[]={1,0,-1,0,1,1,-1,-1};
int dy[]={0,1,0,-1,1,-1,1,-1};
const int mod=1e9+7;
const int MAX =1e6+7;
// ---------------------------Function----------------------------------//
void TestCake(){
int n,m;
cin>>n>>m;
map<char,int>mwgod,m4mwgod;
vector<char>last(5,'0');
for(int i=0;i<n;i++){
string f,s;cin>>f>>s;
for(int j=0;j<5;j++){
if(s[j]=='G'){
last[j]=f[j];
}
else if(s[j]=='Y'){
mwgod[s[j]]++;
}
else{
m4mwgod[s[j]]++;
}
}
}
for(int i=0;i<m;i++){
string s;cin>>s;
int ok=0;
for(int j=0;j<s.size();j++){
if(s[j]==last[j])continue;
else{
if(last[j]!='0')ok=1;
else{
int cnt=m4mwgod[s[j]];
int cntasln=0;for(auto x : s)if(x==s[j])cntasln++;
int lazm=mwgod[s[j]];
int yes=1;
if(cntasln>=lazm&&yes){
}
else{
ok=1;
}
}
}
}
if(!ok){
cout<<s<<el;
}
}
}
//------------------------------Main---------------------------//
signed main(){
Major
int T = 1;
// cin >> T;
while(T--){
TestCake();
// cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
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: 0ms
memory: 3812kb
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: 0ms
memory: 3584kb
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: 0ms
memory: 3772kb
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: -100
Wrong Answer
time: 1ms
memory: 3616kb
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:
ABOMA AGAMA ANIMA AROMA COMMA DERMA DOGMA DOLMA DOUMA DRAMA EDEMA ENEMA GAMMA GEMMA GRAMA GUMMA HALMA HERMA KARMA KORMA LEMMA LLAMA LOUMA MAGMA MAMMA MOMMA PRIMA REGMA SIGMA STOMA SUMMA ULAMA ULEMA
result:
wrong answer 1st lines differ - expected: 'SIGMA', found: 'ABOMA'