# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202268 | 2020-02-15T00:41:05 Z | Segtree | Selling RNA Strands (JOI16_selling_rna) | C++14 | 6 ms | 376 KB |
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include<set> #include<unordered_set> #include<unordered_map> using namespace std; typedef long long ll; #define chmax(a,b) a=max(a,b) #define chmin(a,b) a=min(a,b) #define all(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<n;i++) #define mod 1000000007 #define mad(a,b) a=(a+b)%mod string s[110]; int main(){ int n,m; cin>>n>>m; if(n>100)return 0; rep(i,n)cin>>s[i]; rep(i,m){ string p,q; cin>>p>>q; ll ans=0; rep(i,n){ ll ver=0; if(s[i].size()>=p.size()){ bool ok=1; rep(j,p.size())ok&=(s[i][j]==p[j]); ver+=ok; } if(s[i].size()>=q.size()){ bool ok=1; rep(j,q.size())ok&=(s[i][s[i].size()-1-j]==q[q.size()-1-j]); ver+=ok; } if(ver==2)ans++; } cout<<ans<<endl; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 248 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 6 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
5 | Correct | 5 ms | 128 KB | Output is correct |
6 | Correct | 5 ms | 376 KB | Output is correct |
7 | Correct | 5 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 248 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 6 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
5 | Correct | 5 ms | 128 KB | Output is correct |
6 | Correct | 5 ms | 376 KB | Output is correct |
7 | Correct | 5 ms | 256 KB | Output is correct |
8 | Incorrect | 5 ms | 256 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |