Submission #245706

#TimeUsernameProblemLanguageResultExecution timeMemory
245706yasseenkamelSelling RNA Strands (JOI16_selling_rna)C++14
0 / 100
1591 ms6260 KiB
#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; }

Compilation message (stderr)

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