QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#488767 | #8516. LED Matrix | ucup-team1600# | WA | 0ms | 3828kb | C++17 | 1.9kb | 2024-07-24 15:13:47 | 2024-07-24 15:13:47 |
Judging History
answer
//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4")
#include <bits/stdc++.h>
#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
template<typename T>
bool umin(T &a, T b) {
if (b < a) {
a = b;
return true;
}
return false;
}
template<typename T>
bool umax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
#ifdef KIVI
#define DEBUG for (bool _FLAG = true; _FLAG; _FLAG = false)
#define LOG(...) print(#__VA_ARGS__" ::", __VA_ARGS__) << endl
template<class ...Ts>
auto &print(Ts ...ts) { return ((cerr << ts << " "), ...); }
#else
#define DEBUG while (false)
#define LOG(...)
#endif
mt19937 rng(4242);
const int max_n = -1, inf = 1000111222;
void solve() {
int r, c, k;
cin >> r >> c >> k;
vector<vector<char> > a(r, vector<char>(c)), b(r, vector<char>(k));
vector<int> all_on_a(r, true), have_on_b(r);
for(int i = 0; i < r; i++)
for(int j = 0; j < c; j++) {
cin >> a[i][j];
all_on_a[i] &= (a[i][j] == '*');
}
for(int i = 0; i < r; i++)
for(int j = 0; j < k; j++) {
cin >> b[i][j];
have_on_b[i] |= (b[i][j] == '*');
}
bool ans = true;
for(int i = 0; i < r; i++)
if(have_on_b[i])
ans &= all_on_a[i];
cout << (ans ? "Y\n" : "N\n");
}
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
// cin >> t;
while (t--) solve();
}
/*
KIVI
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
input:
6 6 6 ****** --*--- ****** -**--- ****** ****** ****** ****** ****** -**--- *****- --*---
output:
N
result:
ok "N"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
2 4 6 **** ------ ***- *-----
output:
N
result:
ok "N"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
2 6 4 ****** **** *-**-* ----
output:
Y
result:
ok "Y"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
1 1 1 * *
output:
Y
result:
ok "Y"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
1 1 1 * -
output:
Y
result:
ok "Y"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
1 1 1 - *
output:
N
result:
ok "N"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
1 1 1 - -
output:
Y
result:
ok "Y"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
28 120 84 *-***********-***********-***********-***********-***********-***********-***********-***********-***********-********** *------**----**------**----**------**----**------**----**------**----**------**----* ******-***********-***********-***********-***********-***********-***********-*****...
output:
N
result:
ok "N"
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
input:
40 154 168 ********************************************************************************************************************************************************** *----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**----**-...
output:
N
result:
wrong answer 1st words differ - expected: 'Y', found: 'N'