| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 19748 | cly | 字符串替换 | C++ | Accepted | 100 | 0 MS | 268 KB | 574 | 2021-05-22 13:40:04 |
#include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; int main() { int n,i,j,s; int a[10001],b[10001]; int sum,m; sum=0; scanf("%d %d",&n,&s); for(i=1; i<=n; i++) { s=(s*345)%19997; a[i]=97+s%26; } for(i=1; i<=n; i++) { s=(s*345)%19997; b[i]=97+s%26; } for(i=1; i<=n; i++) for(j=1; j<=n; j++) if(a[i]==b[j]) { sum++; b[j]=-1; break; } printf("%d\n",n-sum); return 0; }