AtCoder Beginner Contest 005

Submission #1679369

Source codeソースコード

#include <stdio.h>
int main(void)
{
  int t,a[100]={0},b,*p=a;
  int n,m;
  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");
  else
    printf("yes");
  return 0;
}

Submission

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

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

./Main.c: In function ‘main’:
./Main.c:7:7: error: ‘i’ undeclared (first use in this function)
for(i=0;i<n;++i){
^
./Main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
./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: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