Advertisement
erfanul007

UVa 10789

Mar 16th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef unsigned long long int ull;
  5. typedef long long int ll;
  6. typedef vector<int> vi;
  7. typedef vector<ll> vll;
  8. typedef vector<vi> vvi;
  9. typedef pair<int,int > pii;
  10. typedef vector< pii > vpii;
  11. typedef set<int> sti;
  12.  
  13. #define sc scanf
  14. #define pf printf
  15. #define sci(n) scanf("%d",&n)
  16. #define scl(n) scanf("%lld",&n)
  17. #define scd(n) scanf("%lf",&n)
  18. #define scs(s) scanf("%s",s)
  19. #define pfi(n) printf("%d",n)
  20. #define pfl(n) printf("%lld",n)
  21. #define pff(n) cout<<n
  22. #define line printf("\n")
  23. #define spc printf(" ")
  24. #define loop(i,x,y) for(int i=int(x); i<=int(y); i++)
  25. #define rloop(i,y,x) for(int i=int(y); i>=int(x); i--)
  26. #define cspf(i) printf("Case %d: ", i)
  27. #define pb push_back
  28. #define mp make_pair
  29. #define ff first
  30. #define ss second
  31. #define all(v) v.begin(),v.end()
  32. #define rall(v) v.rbegin(),v.rend()
  33. #define clr(arr,val) memset(arr,val,sizeof arr);
  34. #define read() freopen("input.txt", "r", stdin)
  35. #define write() freopen("output.txt", "w", stdout)
  36. /// Constants
  37. #define eps 1e-9
  38. #define PI acos(-1.0) // 3.1415926535897932
  39. #define MAX 1000007
  40.  
  41. bool chk[2009];
  42. void seive()
  43. {
  44. clr(chk,0);
  45. chk[0]=1;
  46. chk[1]=1;
  47. for(int i=2;i<2005;i++){
  48. if(chk[i]) continue;
  49. for(int j=2;i*j<2005;j++){
  50. chk[i*j]=1;
  51. }
  52. }
  53. }
  54.  
  55. int main(){
  56. //read();
  57. // write();
  58. //ios_base::sync_with_stdio(false);
  59. //cin.tie(NULL);
  60. seive();
  61. int n;
  62. cin>>n;
  63. loop(i,1,n){
  64. //vector<char>ans;
  65. int a[200];
  66. clr(a,0);
  67. string s,q;
  68. cin>>s;
  69. cspf(i);
  70. for(int j=0;j<s.size();j++){
  71. a[s[j]-48]++;
  72. }
  73. for(int j=0;j<100;j++){
  74. if(!chk[a[j]]){
  75. q+=j+48;
  76. }
  77. }
  78. sort(all(q));
  79. if(!q.empty())
  80. cout<<q<<endl;
  81. else
  82. cout<<"empty\n";
  83. }
  84. return 0;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement