# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
933065 | vjudge1 | Selling RNA Strands (JOI16_selling_rna) | C++17 | 1549 ms | 6488 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
string arr[100005];
int main() {
int n, m;
string a, b;
bool flag;
cin >> n >> m;
for(int i=0; i<n; i++) {
cin >> arr[i];
}
int res;
while(m--) {
cin >> a >> b;
res = 0;
for(int i=0; i<n; i++) {
flag = true;
if(arr[i].length() < a.length() || arr[i].length() < b.length()) {
continue;
}
for(int j=0; j<a.length(); j++) {
if(a[j] != arr[i][j]) {
flag = false;
break;
}
}
for(int j=0; j<b.length(); j++) {
if(b[j] != arr[i][arr[i].length()-b.length()+j]) {
flag = false;
break;
}
}
if(flag) res++;
}
cout << res << "\n";
}
}
컴파일 시 표준 에러 (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... |