Submission #1175585


Source Code Expand

//AtCoder用
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#define MOD 1000000007
void input_array(int how_data,int *data);
int get_random(int min, int max);
int factorial(int n);
int fibonacci(int n);
int qsort_09(const int *sys1 , const int *sys2);
int qsort_90(const int *sys1 , const int *sys2);
int sel_max(int a , int b);
int sel_min(int a , int b);
int array_max(int how_data,int *data);
int array_min(int how_data,int *data);
int can_DP(int how_data,int *data,int how_can,bool *can);
int array_sum(int how_data,int *data);

int main(void){
    int input;
    scanf("%d",&input);
    printf("%d\n",input*2);
    return 0;
}


//how_data個の配列data[]に標準入力
//input_array(how_data,data);
void input_array(int how_data,int *data){
    int loop;
    for(loop=0;loop<how_data;loop++){
        scanf("%d",&data[loop]);
    }
    return ;
}

int get_random(int min, int max){   //指定の範囲から乱数を1つ返すやつ
    //srand((unsigned int)time(0));   //現在時刻で疑似乱数初期化
    rand();rand();rand();rand();    //乱数を空打ち
    return (rand()%(max+1-min))+min;
}


int factorial(int n){//n!のMOD10^9+7を返すやつ
    unsigned long long int ret=1;
    for(int i=1;i<=n;i++)ret=(ret*i)%1000000007;
    return (int)ret;
}

int qsort_09(const int *sys1 , const int *sys2){ //小さいのが上にくるやつ
    //qsort(data,how_data,sizeof(int),(int (*)(const void *,const void *))qsort_09);
    if(*sys1<*sys2){
        return -1;
    }else if(*sys1==*sys2){
        return 0;
    }else{
        return 1;
    }
}

int qsort_90(const int *sys1 , const int *sys2){ //大きいのが上にくるやつ
    //qsort(data,how_data,sizeof(int),(int (*)(const void *,const void *))qsort_90);
    if(*sys1<*sys2){
        return 1;
    }else if(*sys1==*sys2){
        return 0;
    }else{
        return -1;
    }
}

int fibonacci(int n){
    switch(n){
        case 0:return 0;
        case 1:return 1;
        default :return fibonacci(n-1)+fibonacci(n-2);
    }
}

int sel_max(int a,int b){
    if(a>b)return a;
    return b;
}

int sel_min(int a,int b){
    if(a>b)return b;
    return a;
}

int can_DP(int how_data,int *data,int how_can,bool *can){//Typical DP Contest A
    //data内で組み合わせられる和をcanに0 or 1で入れる
    //返り値はパターン数
    int loopA,loopB;
    int ret=0;
    for(loopA=0;loopA<how_can;loopA++){//初期化
        can[loopA]=0;
    }
    can[0]=1;//絶対にありえる
    for(loopA=0;loopA<how_data;loopA++){
        for(loopB=how_can-1;loopB>=0;loopB--){
            if(can[loopB]==1 && loopB+data[loopA]<how_can){
                can[loopB+data[loopA]]=1;
            }
        }
    }
    for(loopA=0;loopA<how_can;loopA++){
        if(can[loopA]==1){
            ret++;
        }
    }
    return ret;
}
int array_max(int how_data,int *data){
    int loop;
    int ret=data[0];
    for(loop=0;loop<how_data;loop++){
        if(ret<data[loop])ret=data[loop];
    }
    return ret;
}
int array_min(int how_data,int *data){
    int loop;
    int ret=data[0];
    for(loop=0;loop<how_data;loop++){
        if(ret>data[loop])ret=data[loop];
    }
    return ret;
}
int array_sum(int how_data,int *data){
    int ret=0;
    int loop;
    for(loop=0;loop<how_data;loop++){
        ret+=data[loop];
    }
    return ret;
}

Submission Info

Submission Time
Task A - 流行
User infer496
Language C (GCC 5.4.1)
Score 100
Code Size 3542 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:24:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&input);
     ^
./Main.c: In function ‘input_array’:
./Main.c:35:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&data[loop]);
         ^

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 28
Set Name Test Cases
All 00_sample_00.txt, max_1000000.txt, min_0.txt, rand_133007.txt, rand_171937.txt, rand_172717.txt, rand_232508.txt, rand_242450.txt, rand_246841.txt, rand_269046.txt, rand_320433.txt, rand_435534.txt, rand_50616.txt, rand_537196.txt, rand_565439.txt, rand_601980.txt, rand_622146.txt, rand_624081.txt, rand_678601.txt, rand_696476.txt, rand_762274.txt, rand_798714.txt, rand_821336.txt, rand_85323.txt, rand_859632.txt, rand_921203.txt, rand_934508.txt, rand_993594.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 128 KB
max_1000000.txt AC 1 ms 128 KB
min_0.txt AC 0 ms 128 KB
rand_133007.txt AC 1 ms 128 KB
rand_171937.txt AC 1 ms 128 KB
rand_172717.txt AC 0 ms 128 KB
rand_232508.txt AC 1 ms 128 KB
rand_242450.txt AC 1 ms 128 KB
rand_246841.txt AC 0 ms 128 KB
rand_269046.txt AC 1 ms 128 KB
rand_320433.txt AC 1 ms 128 KB
rand_435534.txt AC 1 ms 128 KB
rand_50616.txt AC 1 ms 128 KB
rand_537196.txt AC 1 ms 128 KB
rand_565439.txt AC 1 ms 128 KB
rand_601980.txt AC 0 ms 128 KB
rand_622146.txt AC 1 ms 128 KB
rand_624081.txt AC 1 ms 128 KB
rand_678601.txt AC 0 ms 128 KB
rand_696476.txt AC 1 ms 128 KB
rand_762274.txt AC 1 ms 128 KB
rand_798714.txt AC 1 ms 128 KB
rand_821336.txt AC 1 ms 128 KB
rand_85323.txt AC 1 ms 128 KB
rand_859632.txt AC 1 ms 128 KB
rand_921203.txt AC 1 ms 128 KB
rand_934508.txt AC 1 ms 128 KB
rand_993594.txt AC 1 ms 128 KB