Submission #202268

#TimeUsernameProblemLanguageResultExecution timeMemory
202268SegtreeSelling RNA Strands (JOI16_selling_rna)C++14
10 / 100
6 ms376 KiB
#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 (stderr)

selling_rna.cpp: In function 'int main()':
selling_rna.cpp:13:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,n) for(int i=0;i<n;i++)
selling_rna.cpp:30:7:
   rep(j,p.size())ok&=(s[i][j]==p[j]);
       ~~~~~~~~~~               
selling_rna.cpp:30:3: note: in expansion of macro 'rep'
   rep(j,p.size())ok&=(s[i][j]==p[j]);
   ^~~
selling_rna.cpp:13:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,n) for(int i=0;i<n;i++)
selling_rna.cpp:35:7:
   rep(j,q.size())ok&=(s[i][s[i].size()-1-j]==q[q.size()-1-j]);
       ~~~~~~~~~~               
selling_rna.cpp:35:3: note: in expansion of macro 'rep'
   rep(j,q.size())ok&=(s[i][s[i].size()-1-j]==q[q.size()-1-j]);
   ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...