| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 41816 | 老师 | 字符串替换 | C++ | Accepted | 100 | 0 MS | 248 KB | 337 | 2022-06-18 15:08:27 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,s,t1[200]={0},t2[200]={0},ans=0; cin>>n>>s; for(int i=1;i<=n;i++) s=(s*345)%19997,t1[97+s%26]++; for(int i=1;i<=n;i++) s=(s*345)%19997,t2[97+s%26]++; for(int i=1;i<=150;i++){ if(t2[i]!=0) ans+=t2[i]-t1[i]>0?t2[i]-t1[i]:0; } cout<<ans<<endl; return 0; }