Submission #16553290
Source Code Expand
Copy
#include <stdio.h>
int main(void)
{
int n;
int m;
int company[4][50000];
int human[3][50000];
int answer[50000] = {0};
int i;
int j;
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++)
{
scanf("%d%d%d%d", &company[0][i], &company[1][i], &company[2][i], &company[3][i]);
}
for (i = 0; i < m; i++)
{
scanf("%d%d%d", &human[0][i], &human[1][i], &human[2][i]);
}
for (i = 0; i < m; i++)
{
for (j = 0; j < n; j++)
{
if (company[0][j] > human[0][i] && company[1][j] > human[1][i] && company[2][j] > human[2][i])
{
if (answer[i] < company[3][j])
answer[i] = company[3][j];
}
}
}
for (i = 0; i < m; i++)
{
printf("%d\n", answer[i]);
}
return (0);
}
Submission Info
Submission Time
2020-09-07 14:15:51+0900
Task
C - Optimal Recommendations
User
atsuk
Language
C (GCC 9.2.1)
Score
0
Code Size
1122 Byte
Status
WA
Exec Time
2205 ms
Memory
3296 KB
Compile Error
./Main.c: In function ‘main’:
./Main.c:13:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
13 | scanf("%d%d", &n, &m);
| ^~~~~~~~~~~~~~~~~~~~~
./Main.c:16:17: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
16 | scanf("%d%d%d%d", &company[0][i], &company[1][i], &company[2][i], &company[3][i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Main.c:20:17: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
20 | scanf("%d%d%d", &human[0][i], &human[1][i], &human[2][i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Judge Result
Set Name
All
Score / Max Score
0 / 100
Status
Set Name
Test Cases
All
10-random-00.txt, 10-random-01.txt, 10-random-02.txt, 10-random-03.txt, 10-random-04.txt, 20-absW-00.txt, 20-absW-01.txt, 20-absW-02.txt, 20-absW-03.txt, 20-absW-04.txt, 30-balance-00.txt, 30-balance-01.txt, 30-balance-02.txt, 30-balance-03.txt, 30-balance-04.txt, 40-limit_dim-00.txt, 40-limit_dim-01.txt, 40-limit_dim-02.txt, 40-limit_dim-03.txt, 40-limit_dim-04.txt, 40-limit_dim-05.txt, 40-limit_dim-06.txt, Corner1.txt, Sample1.txt
Case Name
Status
Exec Time
Memory
10-random-00.txt
TLE
2205 ms
3036 KB
10-random-01.txt
AC
6 ms
1952 KB
10-random-02.txt
WA
410 ms
2308 KB
10-random-03.txt
TLE
2205 ms
2436 KB
10-random-04.txt
WA
832 ms
2568 KB
20-absW-00.txt
TLE
2205 ms
2944 KB
20-absW-01.txt
WA
6 ms
1860 KB
20-absW-02.txt
TLE
2205 ms
2620 KB
20-absW-03.txt
TLE
2205 ms
2628 KB
20-absW-04.txt
WA
720 ms
2268 KB
30-balance-00.txt
TLE
2205 ms
3028 KB
30-balance-01.txt
WA
6 ms
1860 KB
30-balance-02.txt
WA
235 ms
2116 KB
30-balance-03.txt
TLE
2205 ms
2668 KB
30-balance-04.txt
WA
1062 ms
2516 KB
40-limit_dim-00.txt
WA
1429 ms
3240 KB
40-limit_dim-01.txt
TLE
2205 ms
2944 KB
40-limit_dim-02.txt
WA
1427 ms
3296 KB
40-limit_dim-03.txt
TLE
2205 ms
3040 KB
40-limit_dim-04.txt
WA
1431 ms
3208 KB
40-limit_dim-05.txt
TLE
2205 ms
3044 KB
40-limit_dim-06.txt
WA
1430 ms
3288 KB
Corner1.txt
WA
4 ms
1960 KB
Sample1.txt
WA
1 ms
1908 KB