# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
245706 | yasseenkamel | Selling RNA Strands (JOI16_selling_rna) | C++14 | 1591 ms | 6260 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("-Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef int in;
#define int long long
const long double EPS=1e-9;
const int MOD=1e9+7;
const int N=1e6;
int n,m;
vector<string> s;
in main(){
cin >> n >> m;
string x;
for(int i = 0 ; i < n ; i ++){
cin >> x;
s.push_back(x);
}
while(m --){
string s1,s2;
cin >> s1 >> s2;
int ans = 0;
for(int i = 0 ; i < n ; i ++){
bool b = 1;
for(int j = 0 ; j < s1.size() && j < s[i].size() ; j ++){
if(s[i][j] != s1[j]){
b = 0;
break;
}
}
if(!b){
continue;
}
int idx = s2.size() - 1;
for(int j = s[i].size() - 1 ; j >= 0 && idx >= 0 ; j --){
if(s[i][j] != s2[idx]){
b = 0;
break;
}
idx --;
}
ans += b;
}
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... |