//A #include<bits/stdc++.h> using namespace std; bool vis[1000010]; void Get_Prime() { int n = 1000010; int m = sqrt(n+0.5); memset(vis,0,sizeof(vis)); for(int i=2; i<=m; i++) if(!vis[i]) for(int j=i*i; j<=n; j+=i) vis[j] = 1; return ; } int Find(int n) { for(int i=n+1; ; i++) if(!vis[i]) return i; } int main() { Get_Prime(); int t,n,x; long long sum; scanf("%d",&t); for(int i=1; i<=t; i++) { scanf("%d",&n); sum = 0; while(n--) { scanf("%d",&x); sum += Find(x); } printf("Case %d: %lld Xukha\n",i,sum); } return 0; }
来源:https://www.cnblogs.com/sdutzxr/p/12262985.html