Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - #include<bits/stdc++.h>
 - using namespace std;
 - typedef unsigned long long int ull;
 - typedef long long int ll;
 - typedef vector<int> vi;
 - typedef vector<ll> vll;
 - typedef vector<vi> vvi;
 - typedef pair<int,int > pii;
 - typedef vector< pii > vpii;
 - typedef set<int> sti;
 - #define sc scanf
 - #define pf printf
 - #define sci(n) scanf("%d",&n)
 - #define scl(n) scanf("%lld",&n)
 - #define scd(n) scanf("%lf",&n)
 - #define scs(s) scanf("%s",s)
 - #define pfi(n) printf("%d",n)
 - #define pfl(n) printf("%lld",n)
 - #define pff(n) cout<<n
 - #define line printf("\n")
 - #define spc printf(" ")
 - #define loop(i,x,y) for(int i=int(x); i<=int(y); i++)
 - #define rloop(i,y,x) for(int i=int(y); i>=int(x); i--)
 - #define cspf(i) printf("Case %d: ", i)
 - #define pb push_back
 - #define mp make_pair
 - #define ff first
 - #define ss second
 - #define all(v) v.begin(),v.end()
 - #define rall(v) v.rbegin(),v.rend()
 - #define clr(arr,val) memset(arr,val,sizeof arr);
 - #define read() freopen("input.txt", "r", stdin)
 - #define write() freopen("output.txt", "w", stdout)
 - /// Constants
 - #define eps 1e-9
 - #define PI acos(-1.0) // 3.1415926535897932
 - #define MAX 1000007
 - bool chk[2009];
 - void seive()
 - {
 - clr(chk,0);
 - chk[0]=1;
 - chk[1]=1;
 - for(int i=2;i<2005;i++){
 - if(chk[i]) continue;
 - for(int j=2;i*j<2005;j++){
 - chk[i*j]=1;
 - }
 - }
 - }
 - int main(){
 - //read();
 - // write();
 - //ios_base::sync_with_stdio(false);
 - //cin.tie(NULL);
 - seive();
 - int n;
 - cin>>n;
 - loop(i,1,n){
 - //vector<char>ans;
 - int a[200];
 - clr(a,0);
 - string s,q;
 - cin>>s;
 - cspf(i);
 - for(int j=0;j<s.size();j++){
 - a[s[j]-48]++;
 - }
 - for(int j=0;j<100;j++){
 - if(!chk[a[j]]){
 - q+=j+48;
 - }
 - }
 - sort(all(q));
 - if(!q.empty())
 - cout<<q<<endl;
 - else
 - cout<<"empty\n";
 - }
 - return 0;
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment