zafar_sust_bd's blog

By zafar_sust_bd, 6 years ago, In English,

It's a bit annoying fact, if you know the problem type before you can analyze it. In here(i.e: codeforces), I know problem tags are very useful. But instead of showing them directly with the problem statement, Codeforces should put an option like Show Problem Tags.

Read more »

 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it

By zafar_sust_bd, 9 years ago, In English,

     

“21st February” International Mother Language Day

AMAR VAIER ROKTE RANGGANO EKUSHE FEBRUARY…AMI KI VULITE PARI……….

The date represents the day in 1952 when students demonstrating for recognition of their language, Bangla, as one of the two national languages of the then Pakistan, were shot and killed by police in Dhaka, the capital of what is now Bangladesh.

On that day we ( i.e: all Bangladeshis) achieved “Freedom of speech”.

We all pay deep respect from our heart to those “VASHA SHAHID”.

Read more »

 
 
 
 
  • Vote: I like it
  • +2
  • Vote: I do not like it

By zafar_sust_bd, 9 years ago, In English,

In my compiler (Code::blocks 8.02) my code runs well & i got correct answer too for Test#79 but i got "RUNTIME_ERROR" when i had submitted.

Can anyone say whats the problem in my code ?

Please help.....

Test#79

100 2
aa
000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
Here is my code (what I had submitted).

  1. #include <iostream>
  2. #include <string>
  3. #include <cstdio>
  4. #include <stdlib.h>
  5. #include <string.h>
  6.  
  7. using namespace std;
  8.  
  9. #ifdef __GNUC__
  10. typedef long long ll;typedef unsigned long long ull;
  11. #else
  12. typedef __int64 ll;  typedef unsigned __int64 ull;
  13. #endif
  14.  
  15. #define REP(i,n)    for(i=0;i<n;i++)
  16. #define REV(i,n)    for(i=n;i>=0;i--)
  17. #define FOR(i,x,y)  for(i=(x);i<=(y);i++)
  18.  
  19. #define mem(x,with) memset(x,(with),sizeof(x))
  20. #define SZ(x)       (int)x.size()
  21.  
  22. int main()
  23. {
  24.     int i,j,k,n,l,cnt[200],q;
  25.     char x[200];
  26.     string str,bit,m,m1,s;
  27.     bool apple;
  28.  
  29.     while(cin>>n>>q)
  30.     {
  31.         apple=1;
  32.         cin>>str>>bit;
  33.         l=SZ(str);
  34.         mem(x,'0');
  35.         REP(i,SZ(bit))
  36.         {
  37.             if(bit[i]-'0')
  38.             {
  39.                 k=0;
  40.                 FOR(j,i,i+l-1)
  41.                 {
  42.                     x[j]=str[k];
  43.                     k++;
  44.                 }
  45.             }
  46.         }
  47.         REP(i,SZ(bit))
  48.         {
  49.             if(bit[i]-'0')
  50.             {
  51.                 k=i;
  52.                 s="";
  53.                 REP(j,l)
  54.                 {
  55.                     s+=x[k];
  56.                     k++;
  57.                 }
  58.                 if(s!=str)
  59.                     apple=0;
  60.             }
  61.         }
  62.         mem(cnt,0);
  63.         REP(i,l)
  64.         {
  65.             cnt[str[i]]++;
  66.         }
  67.         if(l==1)
  68.         {
  69.             REP(i,n)
  70.             if(x[i]=='0')
  71.                 FOR(j,97,(97+q-1))
  72.                     if(!cnt[j])
  73.                     {
  74.                         x[i]=j;
  75.                         break;
  76.                     }
  77.             goto zaf;
  78.  
  79.         }
  80.         m=str[0]+str[1];
  81.         REP(i,n)
  82.         {
  83.             if(i==0 && x[i]=='0')
  84.             {
  85.                 FOR(j,97,97+q-1)
  86.                     if(j!=str[j])
  87.                         x[i]=j;
  88.             }
  89.             else if(x[i]=='0')
  90.             {
  91.                 FOR(j,97,97+q-1)
  92.                 {
  93.                     m1=x[i-1]+j;
  94.                     if(m1!=m)
  95.                         x[i]=j;
  96.                 }
  97.             }
  98.         }
  99.         zaf:
  100.             ;
  101.         REP(i,SZ(bit))
  102.         {
  103.             if((bit[i]-'0')==0)
  104.             {
  105.                 k=i;
  106.                 s="";
  107.                 REP(j,l)
  108.                 {
  109.                     s+=x[k];
  110.                     k++;
  111.                 }
  112.                 if(s==str)
  113.                     apple=0;
  114.             }
  115.         }
  116.         REP(i,n)
  117.             if(x[i]=='0')
  118.                 apple=0;
  119.         if(!apple)
  120.             cout<<"No solution"<<endl;
  121.         else
  122.         {
  123.             REP(i,n)
  124.                 cout<<x[i];
  125.             cout<<endl;
  126.         }
  127.     }
  128.  
  129.  
  130.     return 0;
  131. }

Read more »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By zafar_sust_bd, 9 years ago, In English,

We who are Muslims at least pray Friday prayer (Salat al juma).

So if I pray Salat Al Juma then I have to miss Codeforces Beta Round #51.
And alternative way is not better for me.

So what should i do ?

Many Muslims like me have to miss either Salat Al Juma or Contest.
Now what should we do ? 

MikeMirzayanov Please pay attention to this Problem.

Read more »

 
 
 
 
  • Vote: I like it
  • -16
  • Vote: I do not like it