# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
933056 | vjudge1 | Selling RNA Strands (JOI16_selling_rna) | C++17 | 1552 ms | 6496 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// Problem: C - Selling RNA Strands
// Contest: Virtual Judge - Examen de Práctica PES 2024
// URL: https://vjudge.net/contest/612079#problem/C
// Memory Limit: 1024 MB
// Time Limit: 1500 ms
// Start: 24-02-2024 17:34:55
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;
#define gcd(x, y) __gcd(x, y)
#define mcm(x, y) abs((x) * (y)) / gcd(x, y)
#define all(x) begin(x), end(x)
#define pb(x) push_back(x)
#define endl '\n'
int main() {
#ifdef DEBUG
std::cout << std::unitbuf;
#endif
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
ll n, m;
cin >> n >> m;
vector<string> v(n);
for (string& i : v) cin >> i;
while (m--) {
string p, q;
cin >> p >> q;
ll ans = 0;
for (string& i : v) {
if (max(p.size(), q.size()) > i.size()) continue;
for (int j = 0; j < p.size(); j++)
if (p[j] != i[j]) goto NEXT;
for (int j = 1; j <= q.size(); j++)
if (q[q.size() - j] != i[i.size() - j]) goto NEXT;
ans++;
NEXT:
continue;
}
cout << ans << endl;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |