Submission #1175603
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 data[6]={1,2,3,4,5,6};
int n;
scanf("%d",&n);
n%=30;
int loop1,loop2;
int temp;
for(loop1=0;loop1<n;loop1++){
temp=data[loop1%5];
data[loop1%5]=data[loop1%5+1];
data[loop1%5+1]=temp;
/*for(loop2=0;loop2<6;loop2++){
printf("%d",data[loop2]);
}*/
//printf(" %d\n",loop1);
}
for(loop1=0;loop1<6;loop1++){
printf("%d",data[loop1]);
}
printf("\n");
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
2017-03-21 20:45:08+0900
Task
C - 入れ替え
User
infer496
Language
C (GCC 5.4.1)
Score
100
Code Size
3972 Byte
Status
AC
Exec Time
1 ms
Memory
128 KB
Compile Error
./Main.c: In function ‘main’:
./Main.c:25:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
^
./Main.c: In function ‘input_array’:
./Main.c:53:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&data[loop]);
^
Judge Result
Set Name
Subtask1
Subtask2
Score / Max Score
30 / 30
70 / 70
Status
Set Name
Test Cases
Subtask1
SubTask1/00_sample_00.txt, SubTask1/00_sample_01.txt, SubTask1/00_sample_02.txt, SubTask1/rand_19.txt, SubTask1/rand_2.txt, SubTask1/rand_25.txt, SubTask1/rand_27.txt, SubTask1/rand_33.txt, SubTask1/rand_35.txt, SubTask1/rand_4.txt, SubTask1/rand_44.txt, SubTask1/rand_48.txt, SubTask1/rand_8.txt
Subtask2
SubTask2/00_sample_03.txt, SubTask2/max_case.txt, SubTask2/rand_120009641.txt, SubTask2/rand_134230520.txt, SubTask2/rand_136939465.txt, SubTask2/rand_200732473.txt, SubTask2/rand_211796835.txt, SubTask2/rand_312330341.txt, SubTask2/rand_377341731.txt, SubTask2/rand_384611280.txt, SubTask2/rand_386098102.txt, SubTask2/rand_399010727.txt, SubTask2/rand_409627453.txt, SubTask2/rand_416537730.txt, SubTask2/rand_425486442.txt, SubTask2/rand_493135174.txt, SubTask2/rand_573105326.txt, SubTask2/rand_62794810.txt, SubTask2/rand_649471654.txt, SubTask2/rand_693017484.txt, SubTask2/rand_729197057.txt, SubTask2/rand_759630883.txt, SubTask2/rand_823752210.txt, SubTask2/rand_830399384.txt, SubTask2/rand_893242387.txt, SubTask2/rand_935005824.txt, SubTask2/rand_989703310.txt
Case Name
Status
Exec Time
Memory
SubTask1/00_sample_00.txt
AC
1 ms
128 KB
SubTask1/00_sample_01.txt
AC
1 ms
128 KB
SubTask1/00_sample_02.txt
AC
1 ms
128 KB
SubTask1/rand_19.txt
AC
1 ms
128 KB
SubTask1/rand_2.txt
AC
1 ms
128 KB
SubTask1/rand_25.txt
AC
1 ms
128 KB
SubTask1/rand_27.txt
AC
1 ms
128 KB
SubTask1/rand_33.txt
AC
1 ms
128 KB
SubTask1/rand_35.txt
AC
1 ms
128 KB
SubTask1/rand_4.txt
AC
1 ms
128 KB
SubTask1/rand_44.txt
AC
1 ms
128 KB
SubTask1/rand_48.txt
AC
1 ms
128 KB
SubTask1/rand_8.txt
AC
1 ms
128 KB
SubTask2/00_sample_03.txt
AC
1 ms
128 KB
SubTask2/max_case.txt
AC
1 ms
128 KB
SubTask2/rand_120009641.txt
AC
1 ms
128 KB
SubTask2/rand_134230520.txt
AC
1 ms
128 KB
SubTask2/rand_136939465.txt
AC
1 ms
128 KB
SubTask2/rand_200732473.txt
AC
1 ms
128 KB
SubTask2/rand_211796835.txt
AC
1 ms
128 KB
SubTask2/rand_312330341.txt
AC
1 ms
128 KB
SubTask2/rand_377341731.txt
AC
1 ms
128 KB
SubTask2/rand_384611280.txt
AC
1 ms
128 KB
SubTask2/rand_386098102.txt
AC
1 ms
128 KB
SubTask2/rand_399010727.txt
AC
1 ms
128 KB
SubTask2/rand_409627453.txt
AC
1 ms
128 KB
SubTask2/rand_416537730.txt
AC
1 ms
128 KB
SubTask2/rand_425486442.txt
AC
1 ms
128 KB
SubTask2/rand_493135174.txt
AC
1 ms
128 KB
SubTask2/rand_573105326.txt
AC
1 ms
128 KB
SubTask2/rand_62794810.txt
AC
1 ms
128 KB
SubTask2/rand_649471654.txt
AC
1 ms
128 KB
SubTask2/rand_693017484.txt
AC
1 ms
128 KB
SubTask2/rand_729197057.txt
AC
1 ms
128 KB
SubTask2/rand_759630883.txt
AC
1 ms
128 KB
SubTask2/rand_823752210.txt
AC
1 ms
128 KB
SubTask2/rand_830399384.txt
AC
1 ms
128 KB
SubTask2/rand_893242387.txt
AC
1 ms
128 KB
SubTask2/rand_935005824.txt
AC
1 ms
128 KB
SubTask2/rand_989703310.txt
AC
1 ms
128 KB