AtCoder Beginner Contest 005

Submission #1679373

Source codeソースコード

#include <stdio.h>
int main(void)
{
  int t,a[100]={0},b,*p=a;
  int n,m,i;
  scanf("%d %d",&t,&n);
  for(i=0;i<n;++i){
    scanf("%d",a+i);
  }
  scanf("%d",&m);
  for(i=0;i<m;++i){
    scanf("%d",&b);
    for(;*p<b-t;++p){
      //drop
    }
    if(*p>b || *p==0){
      //soldout
      break;
    } else {
      //sale
      ++p;
    }
  }
  if(i<m)
    printf("no\n");
  else
    printf("yes\n");
  return 0;
}

Submission

Task問題 C - おいしいたこ焼きの売り方
User nameユーザ名 Eisuke
Created time投稿日時
Language言語 C (GCC 5.4.1)
Status状態 AC
Score得点 100
Source lengthソースコード長 444 Byte
File nameファイル名
Exec time実行時間 1 ms
Memory usageメモリ使用量 128 KB

Compiler messageコンパイルメッセージ

./Main.c: In function ‘main’:
./Main.c:6:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&t,&n);
^
./Main.c:8:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",a+i);
^
./Main.c:10:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&m);
^
./Main.c:12:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&b);
^

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 rand0.txt,rand1.txt,rand10.txt,rand11.txt,rand12.txt,rand13.txt,rand14.txt,rand15.txt,rand16.txt,rand17.txt,rand18.txt,rand19.txt,rand2.txt,rand20.txt,rand21.txt,rand22.txt,rand23.txt,rand24.txt,rand25.txt,rand26.txt,rand27.txt,rand28.txt,rand29.txt,rand3.txt,rand4.txt,rand5.txt,rand6.txt,rand7.txt,rand8.txt,rand9.txt,s1.txt,s2.txt,s3.txt,s4.txt,s5.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
rand0.txt AC
rand1.txt AC
rand10.txt AC
rand11.txt AC
rand12.txt AC
rand13.txt AC
rand14.txt AC
rand15.txt AC
rand16.txt AC
rand17.txt AC
rand18.txt AC
rand19.txt AC
rand2.txt AC
rand20.txt AC
rand21.txt AC 1 ms 128 KB
rand22.txt AC
rand23.txt AC
rand24.txt AC
rand25.txt AC
rand26.txt AC
rand27.txt AC 1 ms 128 KB
rand28.txt AC
rand29.txt AC
rand3.txt AC
rand4.txt AC
rand5.txt AC
rand6.txt AC
rand7.txt AC
rand8.txt AC
rand9.txt AC
s1.txt AC
s2.txt AC
s3.txt AC
s4.txt AC
s5.txt AC 1 ms 128 KB