Submission #1401861
Source Code Expand
#include <stdio.h>
#include <stdlib.h>
int main()
{
int t, n, m, i, j;
int *a;
int *b;
char yes[] = "yes";
char no[] = "no";
scanf("%d", &t);
scanf("%d", &n);
a = (int *)calloc(n, sizeof(int));
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
scanf("%d", &m);
b = (int *)calloc(m, sizeof(int));
for (j = 0; j < m; j++) {
scanf("%d", &b[j]);
}
if (n < m) {
printf("%s\n", no);
goto end;
}
for (i = 0, j = 0; i < n; i++) {
if (((b[j] - a[i]) <= t) && ((b[j] - a[i]) >= 0)) {
j++;
}
}
if (j == m) {
printf("%s\n", yes);
} else {
printf("%s\n", no);
}
end:
free(a);
free(b);
return 0;
}
Submission Info
Submission Time
2017-07-04 11:29:46+0900
Task
C - おいしいたこ焼きの売り方
User
k_murata
Language
C (GCC 5.4.1)
Score
100
Code Size
678 Byte
Status
AC
Exec Time
1 ms
Memory
128 KB
Compile Error
./Main.c: In function ‘main’:
./Main.c:12:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &t);
^
./Main.c:14:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^
./Main.c:17:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a[i]);
^
./Main.c:20:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &m);
^
./Main.c:23:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &b[j]);
^
Judge Result
Set Name
All
Score / Max Score
100 / 100
Status
Set Name
Test Cases
All
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
Case Name
Status
Exec Time
Memory
rand0.txt
AC
1 ms
128 KB
rand1.txt
AC
1 ms
128 KB
rand10.txt
AC
1 ms
128 KB
rand11.txt
AC
1 ms
128 KB
rand12.txt
AC
1 ms
128 KB
rand13.txt
AC
1 ms
128 KB
rand14.txt
AC
1 ms
128 KB
rand15.txt
AC
1 ms
128 KB
rand16.txt
AC
1 ms
128 KB
rand17.txt
AC
1 ms
128 KB
rand18.txt
AC
1 ms
128 KB
rand19.txt
AC
1 ms
128 KB
rand2.txt
AC
1 ms
128 KB
rand20.txt
AC
1 ms
128 KB
rand21.txt
AC
1 ms
128 KB
rand22.txt
AC
1 ms
128 KB
rand23.txt
AC
1 ms
128 KB
rand24.txt
AC
1 ms
128 KB
rand25.txt
AC
1 ms
128 KB
rand26.txt
AC
1 ms
128 KB
rand27.txt
AC
1 ms
128 KB
rand28.txt
AC
1 ms
128 KB
rand29.txt
AC
1 ms
128 KB
rand3.txt
AC
1 ms
128 KB
rand4.txt
AC
1 ms
128 KB
rand5.txt
AC
1 ms
128 KB
rand6.txt
AC
1 ms
128 KB
rand7.txt
AC
1 ms
128 KB
rand8.txt
AC
1 ms
128 KB
rand9.txt
AC
1 ms
128 KB
s1.txt
AC
1 ms
128 KB
s2.txt
AC
1 ms
128 KB
s3.txt
AC
1 ms
128 KB
s4.txt
AC
1 ms
128 KB
s5.txt
AC
1 ms
128 KB