| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 41819 | 朱宸瑜 | 字符串替换 | C++ | Accepted | 100 | 0 MS | 252 KB | 340 | 2022-06-18 15:11:40 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,s,xi[200]={0},yi[200]={0},ans=0; cin>>n>>s; for(int i=1;i<=n;i++) s=(s*345)%19997,xi[97+s%26]++; for(int i=1;i<=n;i++) s=(s*345)%19997,yi[97+s%26]++; for(int i=0;i<=199;i++){ ans+=(yi[i]-xi[i]>0?yi[i]-xi[i]:0); } cout<<ans<<endl; return 0; }