제출 #237911

#제출 시각아이디문제언어결과실행 시간메모리
237911tc_abdSelling RNA Strands (JOI16_selling_rna)C++14
10 / 100
1575 ms1048580 KiB
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) #define It it=se.begin();it!=se.end();it++ #define mem(dp,i) memset(dp,i,sizeof(dp)) #define all(x) begin(x),end(x) #define unmap unordered_map #define pii pair<int,int> #include <bits/stdc++.h> #define pll pair<ll,ll> #define vll vector<ll> #define vi vector<int> #define ld long double #define ll long long #define pb push_back #define sh short int #define mid (l+r)/2 #define S second #define F first #define sqr 447 using namespace std; const int inf = 1e9+9; const int mod = 1e9+7; const ld pai=acos(-1); int n,m; string s[5009]; string p[5009]; string q[5009]; map < string , bool > pre[5009]; map < string , bool > suf[5009]; int main(){ fast,cin>>n>>m; for(int i=0;i<n;i++){ cin>>s[i]; string s1 = ""; for(int j=0;j<s[i].size();j++){ s1 += s[i][j]; pre[i][s1] = 1; } string s2 = ""; for(int j=s[i].size()-1;j>=0;j--){ s2 += s[i][j]; suf[i][s2] = 1; } } for(int i=0;i<m;i++){ int ans = 0; cin>>p[i]>>q[i]; reverse(all(q[i])); for(int j=0;j<n;j++){ ans += (pre[j][p[i]] && suf[j][q[i]]); } cout<<ans<<endl; } }

컴파일 시 표준 에러 (stderr) 메시지

selling_rna.cpp: In function 'int main()':
selling_rna.cpp:34:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<s[i].size();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...