2 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); char ch; int n,s=0; cin>>ch>>n; int c=ch-'a'; for(int i=1;i<=n;i++) { string a; int x; cin>>a>>x; x=-x; while(x<0)x+=26; for(int i=0;i<a.size();i++) { int now=(a[i]-'a'+x)%26; if(now==c)s++; } } cout<<s; return 0; }
Information
- ID
- 32
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- (None)
- # Submissions
- 231
- Accepted
- 65
- Uploaded By