언제부터였을까..
2014-10-08 00:14:25

서버 시계가 10분 늦게 간 것은..

▼ more
Common Permutation(PC/UVa ID: 110303/10252)
2014-10-08 00:13:34

#include <stdio.h>

#include <string.h>

int ok =0 ;

short alphabet[26];

char a[1001];

char b[1001];

inline int mystrlen(const char* str){int n=0;for(n=0;str[n]!='\0';n++);return n;}

void cp(){

    int i=0;

        for(i=0;i<26;i++){

        alphabet[i]=0;

        }

    int n_a = mystrlen(a);

    for(i=0;i<n_a;i++){

        alphabet[a[i] - 'a']=1;

    }

    int n_b = mystrlen(b);

    for(i=0;i<n_b;i++){

        if(alphabet[b[i] - 'a']==1){

            alphabet[b[i] - 'a']=2;

        }

    }

    for(i=0;i<26;i++){

        if(alphabet[i]==2){

            printf("%c",i+'a');

        }

    }

    printf("

");

}

int main(){

    strcpy(a,"pretty");

    strcpy(b,"women");

    cp();

    strcpy(a,"walking");

    strcpy(b,"down");

    cp();

    strcpy(a,"the");

    strcpy(b,"street");

    cp();

}

▼ more
Where's Waldorf(110302/10010)
2014-10-07 23:53:04

//아무리 쉬운문제라도..

//실수하면 오래걸린다..

#include <stdio.h>

#include <string.h>

char grid[50][51];

char word[20][51];

inline int mystrlen(char* str){int n=0;for(;str[n]!='\0';n++);return n;}

char getLowerCase(char c){

    if(c>='A' && c<='Z'){

    return c + 32;

    }return c;

}

int main(){

    int m = 8;

    int n = 11;

    strcpy(grid[0],"abcDEFGhigg");

    strcpy(grid[1],"hEbkWalDork");

    strcpy(grid[2],"FtyAwaldOrm");

    strcpy(grid[3],"FtsimrLqsrc");

    strcpy(grid[4],"byoArBeDeyv");

    strcpy(grid[5],"Klcbqwikomk");

    strcpy(grid[6],"strEBGadhrb");

    strcpy(grid[7],"yUiqlxcnBjf");

    int k=4;

    strcpy(word[0],"Waldorf");

    strcpy(word[1],"Bambi");

    strcpy(word[2],"Betty");

    strcpy(word[3],"Dagbert");

    

    int word_i,word_j,grid_i,grid_j,word_n,i,j;

    char c;

    int find =0,row,col,find_first;

    for(word_i=0;word_i<k;word_i++){

        word_n = mystrlen(word[word_i]);

        c = getLowerCase(word[word_i][0]);

        find = 0;

        grid_i =0;

        grid_j =0;

        while(!find && grid_i < m && grid_j <= n){

            //find first character location

            find_first = false;

            if(grid_i==0 && grid_j==0){

                row = grid_i;

                col = grid_j;

            }

            else if(grid_j<n){

                row = grid_i;

                col = grid_j+1;

            }else{

                row = grid_i+1;

                col = 0;

            }

            for(grid_i = row;grid_i<m;grid_i++){

                for(grid_j = col;grid_j<=n;grid_j++){

                    if(c==getLowerCase(grid[grid_i][grid_j])){

      \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;                  find_first= true;

                        break;

                    }

                }

                col=0;

                if(find_first){break;}

            }

            //북

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;i--,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

                    find = 1;

                    break;

                }

          &nb\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0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\0\0\0\0\0\0\0\0\0sp; }

            //북동

            if(!find){

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;i--,j++,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

                    find = 1;

                    break;

                }

            }

            }

            //동

            if(!find){

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;j++,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

                    find = 1;

                    break;

                }

            }

            }

            //동남

            if(!find){

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;i++,j++,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

                    find = 1;

                    break;

                }

            }

            }

            //남

            if(!find){

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;i++,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

             &n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0bsp;      find = 1;

                    break;

                }

            }

            }

            //남서

            if(!find){

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;i++,j--,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

                    find = 1;

                    break;

                }

            }

            }

            //서

            if(!find){

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;j--,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

                    find = 1;

                    break;

                }

            }

            }

            if(!find){

            //서북

            for(i=grid_i,j=grid_j,word_j=0;i>=0&&i<m&&j>=0&&j<=n;i--,j--,word_j++){

                if(getLowerCase(grid[i][j])!=getLowerCase(word[word_i][word_j])) break;

                if(word_j+1==word_n){

                    find = 1;

               &n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0bsp;    break;

                }

            }

            }

        }

        printf("%d %d

",grid_i+1,grid_j+1);

    }

}

▼ more
WERTYU
2014-10-07 22:50:28

//의지의 한국인 코드

#include <stdio.h>

// 0 1 2 3 4 5 6 7 8 9 10 11 12

// ` 1 2 3 4 5 6 7 8 9 0 - =

// 13 14 15 16 17 18 19 20 21 22 23 24 25

// q w e r t y u i o p [ ] \

// 26 27 28 27 28 29 30 31 32

// a s d f g j k l ; '

// 33 34 35 36 37 38 39 40 41

// z x c v b n m , . /

const char *keyboard = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;\'ZXCVBNM,./ ";

inline int mystrlen(const char* str){int n=0;for(n=0;str[n]!='\0';n++);return n;}

int getIndex(char c){

if(c=='`')return 0;

if(c=='1')return 1;if(c=='2')return 2;if(c=='3')return 3;if(c=='4')return 4;if(c=='5')return 5;

if(c=='6')return 6;if(c=='7')return 7;if(c=='8')return 8;if(c=='9')return 9;if(c=='0')return 10;

if(c=='-')return 11;if(c=='=')return 12;if(c=='Q')return 13;if(c=='W')return 14;if(c=='E')return 15;

if(c=='R')return 16;if(c=='T')return 17;if(c=='Y')return 18;if(c=='U')return 19;if(c=='I')return 20;

if(c=='O')return 21;if(c=='P')return 22;if(c=='[')return 23;if(c==']')return 24;if(c=='\\')return 25;

if(c=='A')return 26;if(c=='S')return 27;if(c=='D')return 28;if(c=='F')return 29;if(c=='G')return 30;

if(c=='H')return 31;if(c=='J')return 32;if(c=='K')return 33;if(c=='L')return 34;if(c==';')return 35;

if(c=='\'')return 36;if(c=='Z')return 37;if(c=='X')return 38;if(c=='C')return 39;if(c=='V')return 40;

if(c=='B')return 41;if(c=='N')return 42;if(c=='M')return 43;if(c==',')return 44;if(c=='.')return 45;

if(c=='/')return 46;

return -1;

}

int main(){

    const char* input="O S, GOMR YPFSU/";

    int n = mystrlen(input);

    int i,idx;

    for(i=0;i<n;i++){

        if(input[i]==' ')idx = 48;

        else idx = getIndex(input[i])-1;

        printf("%c",keyboard[idx]);

    }

    printf("

");

}

▼ more