QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#345054 | #7953. Product Delivery | juancs# | WA | 0ms | 3424kb | C++20 | 1.1kb | 2024-03-06 01:38:22 | 2024-03-06 01:38:23 |
Judging History
answer
#include<bits/stdc++.h>
#define el '\n'
#define pb push_back
#define forn(i, n) for(int i = 0; i < (int)n; ++i)
#define for1(i, n) for(int i = 1; i <= (int)n; ++i)
#define fore(i,l,r ) for(int i = l; i<= r; ++i)
#define sz(a) (int) a.size()
#define fi first
#define se second
#define d(x) cerr << #x << ' ' << x << el
#define all(x) x.begin(), x.end()
using namespace std;
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<int> vi;
typedef __int128_t i128;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n, k, m, f;
vector<vi> cards(k, vi(m));
forn(i, k){
forn(j, m)cin >> cards[i][j];
}
forn(i, k)sort(all(cards[i]));
map<i128, int> mp;
for1(i, n){
i128 rep = 0;
forn(j, k){
if(binary_search(all(cards[j]), i))rep |= i128(1) << j;
}
if(mp.count(rep)){
mp[rep] = 0;
}else mp[rep] = i;
}
while(f--){
string s;
cin >> s;
i128 rep = 0;
forn(i, k){
if(s[i] == 'Y')rep |= i128(1) << i;
}
cout << mp[rep] << el;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3424kb
input:
4 13 15 5 8 6 14 3 7
output:
result:
wrong answer 1st lines differ - expected: '2', found: ''