# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
876275 | Nurislam | Selling RNA Strands (JOI16_selling_rna) | C++14 | 1559 ms | 2772 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
/*
<<<<It's never too late for a new beginning in your life>>>>
Today is hard
tomorrow will worse
but the day after tomorrow will be the sunshine..
HARD WORK BEATS TALENT WHEN TALENT DOESN'T WORK HARD............
Never give up */
//The most CHALISHKANCHIK
#define int long long int
unordered_map<string, int> mp;
void solve(){
int n, m;
cin >> n >> m;
for(int i = 0; i < n; i++){
string s;
cin >> s;
mp[s]++;
}
for(int i = 0; i < m; i++){
string a, b;
cin >> a >> b;
int ans = 0;
for(auto k:mp){
if(k.first.size() < max(a.size(), b.size()))continue;
string res = k.first;
if(res.substr(0, a.size()) == a && res.substr(res.size() - b.size()) == b)ans+=k.second;
}
cout << ans << '\n';
}
}
main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int t = 1;
//~ cin >> t;
while(t--){
solve();
}
}
컴파일 시 표준 에러 (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... |