Sunday, August 14, 2016

Timus : 1014 (Product of Digits)

#include<bits/stdc++.h>
#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define pi acos(-1.0)
#define N 1000000
#define LL long long

#define For(i, a, b) for( int i = (a); i < (b); i++ )
#define Fors(i, sz) for( size_t i = 0; i < sz.size (); i++ )
#define Fore(it, x) for(typeof (x.begin()) it = x.begin(); it != x.end (); it++)
#define Set(a, s) memset(a, s, sizeof (a))
#define Read(r) freopen(r, "r", stdin)
#define Write(w) freopen(w, "w", stdout)

using namespace std;
vector<int>v;
void recur(LL n)
{
    if(n<10)
    {
        v.push_back(n);
        return;

    }

    for(int i=9; i>2; i--)
    {
        if(n%i==0)
        {
            v.push_back(i);
            recur(n/i);
            break;
        }
    }

}

int main()
{
    LL n;

    while(cin>>n)

    {
        if(n==0)
        {
            printf("10\n");
            continue;
        }
        v.clear();
        recur(n);
        sort(v.begin(),v.end());
        LL product=1;
        Fors(i,v) product*=v[i];
        if(product==n)
        {
            Fors(i,v) printf("%d",v[i]);
            printf("\n");
        }
        else printf("-1\n");

    }
    return 0;
}

Monday, July 25, 2016

Solution to Timus 1264 in C

#include<stdio.h>
int main()
{
    int n,m;
    scanf("%d",&n);
    scanf("%d",&m);
    printf("%d\n",n*(m+1));
    return 0;
}

Saturday, March 14, 2015

UVA Solution 10082 - WERTYU

#include<stdio.h>
#include<string.h>
int main()
{
    long int l,i;
    char s[100000];
    while(gets(s))
    {
        l=strlen(s);
        for(i=0; i<l; i++)
        {
            switch(s[i])
            {
            case 'W':
                printf("Q");
                break;
            case 'E':
                printf("W");
                break;
            case 'R':
                printf("E");
                break;
            case 'T':
                printf("R");
                break;
            case 'Y':
                printf("T");
                break;
            case 'U':
                printf("Y");
                break;
            case 'I':
                printf("U");
                break;
            case 'O':
                printf("I");
                break;
            case 'P':
                printf("O");
                break;
            case 'S':
                printf("A");
                break;
            case 'D':
                printf("S");
                break;
            case 'F':
                printf("D");
                break;
            case 'G':
                printf("F");
                break;
            case 'H':
                printf("G");
                break;
            case 'J':
                printf("H");
                break;
            case 'K':
                printf("J");
                break;
            case 'L':
                printf("K");
                break;
            case 'X':
                printf("Z");
                break;
            case 'C':
                printf("X");
                break;
            case 'V':
                printf("C");
                break;
            case 'B':
                printf("V");
                break;
            case 'N':
                printf("B");
                break;
            case 'M':
                printf("N");
                break;
            case '2':
                printf("1");
                break;
            case '3':
                printf("2");
                break;
            case '4':
                printf("3");
                break;
            case '5':
                printf("4");
                break;
            case '6':
                printf("5");
                break;
            case '7':
                printf("6");
                break;
            case '8':
                printf("7");
                break;
            case '9':
                printf("8");
                break;
            case '0':
                printf("9");
                break;
            case '-':
                printf("0");
                break;
            case '=':
                printf("-");
                break;
            case '[':
                printf("P");
                break;
            case ']':
                printf("[");
                break;
            case '\\':
                printf("]");
                break;
            case ';':
                printf("L");
                break;
            case '1':
                printf("`");
                break;
            case ',':
                printf("M");
                break;
            case '.':
                printf(",");
                break;
            case '/':
                printf(".");
                break;
            case ' ':
                printf(" ");
                break;
            default:
                printf(";");
                break;
            }

        }
        printf("\n");
    }
    return 0;
}







Problem Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1023

UVa Solution 11192 - Group Reverse

#include<stdio.h>
#include<string.h>
int main()
{
    int p,i,j,top,G;
    char s1[105],s2[105];
    scanf("%d",&G);
    while(G)
    {
        scanf("%s",s1);
        int len=strlen(s1);
        p=len/G;
        top=0;
        for(i=p-1; i<len; i+=p)
        {
            for(j=i; j>i-p; j--)
                s2[top++]=s1[j];
        }
        s2[top++]=0;
        puts(s2);
        scanf("%d",&G);
    }
    return 0;
}
problem link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2133

Saturday, December 13, 2014

How to install java JDK 8 && NetBeans IDE 8.0.1(Linux sudo code )

#How to install java JDK 8
Step 1: Install Java SE Development Kit (JDK) 8
sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Step 2: Download NetBeans Installer
wget http://download.netbeans.org/netbeans/8.0/final/bundles/netbeans-8.0-php-linux.sh

#Install NetBeans IDE 8.0.1 on Ubuntu 14.04 & Ubuntu 14.10 && Kali linux

sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
wget http://dlc.sun.com.edgesuite.net/netbeans/8.0.1/final/bundles/netbeans-8.0.1-linux.sh
chmod +x netbeans-8.0.1-linux.sh
./netbeans-8.0.1-linux.sh

Sunday, November 16, 2014

Basic #Linux_Commands

1. Command: ls

The command “ls” stands for (List Directory Contents), List the contents of the folder, be it file or folder, from which it runs.












                                                      
 The command “ls -l” list the content of folder, in long listing fashion.
















Command “ls -a“, list the content of folder,including hidden files starting with ‘.’.]
















 Note: In Linux file name starting with ‘.‘ is hidden. In Linux every file/folder/device/command is a file. The output of ls -l is:
  1. d (stands for directory).
  2. rwxr-xr-x is the file permission of the file/folder for owner, group and world.
  3. The 1st ravisaive in the above example means that file is owned by user ravisaive.
  4. The 2nd ravisaive in the above example means file belongs to user group ravisaive.
  5. 4096 means file size is 4096 Bytes.
  6. May 8 01:06 is the date and time of last modification.
  7. And at the end is the name of the File/Folder

List Files with Human Readable Format with option -lh

With combination of -lh option, shows sizes in human readable format.















List Files and Directories with ‘/’ Character at the end
Using -F option with ls command, will add the ‘/’ Character at the end each directory.
&&

 List Files in Reverse Order

The following command with ls -r && -R option display files and directories in reverse order.












   

   
Reverse Output Order
With combination of -ltr will shows latest modification file or directory date as last.

 && Sort Files by File Size

With combination of -lS displays file size in order, will display big in size first.















Display Inode number of File or Directory
We can see some number printed before file / directory name. With -i options list file / directory with inode number.
 && Shows version of ls command
Check version of ls command.

 && Show Help Page

List help page of ls command with their option.
 &&

List Directory Information

With ls -l command list files under directory /tmp. Wherein with -ld parameters displays information of /tmp directory.
&&

Display UID and GID of Files

To display UID and GID of files and directories. use option -n with ls command.

&&  ls command and it’s Aliases

We have made alias for ls command, when we execute ls command it’ll take -l option by default and display long listing as mentioned earlier.
















To remove an alias previously defined, just use the unalias command.

Monday, November 10, 2014


Cyb3r Command0S  সর্বদাই নিজেদের কর্মদক্ষতা দিয়ে তাদের সাফল্য ধরে রাখছে ।
আপনাদের ভালোবাসা ও সহযোগিতায়  Cyb3r Command0S পরিবারের সামনে এগিয়ে
চলা।আশা করি সর্বদাই  Cyb3r Command0S এর পাশে থেকে আমাদের অনুপ্রেরণা দিবেন।
অফিসিয়াল ওয়েবসাইট: Cyb3r Command0S
-> https://www.facebook.com/groups/CCONROLL/

আজকে যে যে ওয়েবসাইটগুল হ্যাক করা হয়েছে -Cyb3r Command0S  টিম।
http://www.gdwulin.org/index.html
http://www.warwickshire-pcc.gov.uk
http://www.warwickworks.co.uk/
http://theloanpartnership.co.uk
http://louboutinplazajpn.com/
http://thomasokentearooms.co.uk/
http://www.thefraudlawyersassociation.org.uk/
http://www.warwickprinting.co.uk/
http://acsrenewables.co.uk/
http://www.bradleydoublelock.co.uk/
http://www.heschandshain.com/
http://familyservicesnw.org/
http://vps8919.inmotionhosting.com/~fsnworg/
http://greenwoodautobody.com/
http://www.amarorestaurant.com/
http://www.amentogroup.com/
http://bellevuedrycleaning.com/