Submission #1178239
Source Code Expand
#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);
void input_array2(int first , int second , int data[][4]);
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 loop1,loop2,loop3,loop4,loop5,i_temp;
char c_temp;
int main(void){
char a[11];
scanf("%s",a);
if(a[0]=='a'&&a[1]=='\0'){
printf("-1\n");
}else{
printf("a\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 ;
}
void input_array2(int first,int second,int data[][4]){
int loopA,loopB;
for(loopA=0;loopA<first;loopA++){
for(loopB=0;loopB<second;loopB++){
scanf("%d",&data[loopA][loopB]);
}
}
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-24 18:56:56+0900
Task
B - 辞書式順序
User
infer496
Language
C (GCC 5.4.1)
Score
100
Code Size
3956 Byte
Status
AC
Exec Time
1 ms
Memory
128 KB
Compile Error
./Main.c: In function ‘main’:
./Main.c:26:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s",a);
^
./Main.c: In function ‘input_array’:
./Main.c:41:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&data[loop]);
^
./Main.c: In function ‘input_array2’:
./Main.c:50:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&data[loopA][loopB]);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
100 / 100
Status
Set Name
Test Cases
Sample
subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt
All
subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt
Case Name
Status
Exec Time
Memory
subtask0_sample01.txt
AC
1 ms
128 KB
subtask0_sample02.txt
AC
0 ms
128 KB
subtask0_sample03.txt
AC
1 ms
128 KB
subtask0_sample04.txt
AC
0 ms
128 KB
subtask1_01.txt
AC
0 ms
128 KB
subtask1_02.txt
AC
1 ms
128 KB
subtask1_03.txt
AC
0 ms
128 KB
subtask1_04.txt
AC
1 ms
128 KB
subtask1_05.txt
AC
0 ms
128 KB
subtask1_06.txt
AC
1 ms
128 KB
subtask1_07.txt
AC
0 ms
128 KB
subtask1_08.txt
AC
1 ms
128 KB
subtask1_09.txt
AC
0 ms
128 KB
subtask1_10.txt
AC
0 ms
128 KB
subtask1_11.txt
AC
0 ms
128 KB
subtask1_12.txt
AC
1 ms
128 KB
subtask1_13.txt
AC
0 ms
128 KB
subtask1_14.txt
AC
0 ms
128 KB
subtask1_15.txt
AC
0 ms
128 KB