Submission #104659


Source Code Expand

Copy
#include <cstdio>
#include <iostream>
using namespace std;
#define For(i,x) for (int i=0; i<(int)(x); i++)

/*

1. 猛暑日:最高気温が 35 度以上の日
2. 真夏日:最高気温が 30 度以上、35 度未満の日
3. 夏日 :最高気温が 25 度以上、30 度未満の日
4. 熱帯夜:最低気温が 25 度以上の日
5. 冬日 :最低気温が 0 度未満で、最高気温が 0 度以上の日
6. 真冬日:最高気温が 0 度未満の日

*/

int main() {
    int n;
    scanf("%d", &n);

    int xs[10] = {};
    For(i, n) {
        double top, bottom;
        scanf("%lf %lf", &top, &bottom);

        if (top >= 35) ++xs[1];
        if (30 <= top && top < 35) ++xs[2];
        if (25 <= top && top < 30) ++xs[3];
        if (25 <= bottom) ++xs[4];
        if (bottom < 0 && top >= 0) ++xs[5];
        if (top < 0) ++xs[6];
    }

    for (int i = 1; i <= 6; i++) {
        if (i > 1) putchar(' ');
        printf("%d", xs[i]);
    }
    puts("");
}

Submission Info

Submission Time
Task B - 真冬日?真夏日?
User noriok
Language C++11 (GCC 4.8.1)
Score 100
Code Size 1028 Byte
Status
Exec Time 25 ms
Memory 932 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:19:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
                    ^
./Main.cpp:24:40: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lf %lf", &top, &bottom);
                                        ^

Test Cases

Set Name Score / Max Score Test Cases
All 100 / 100 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt
Case Name Status Exec Time Memory
00_sample_01.txt 22 ms 800 KB
00_sample_02.txt 21 ms 680 KB
00_sample_03.txt 21 ms 808 KB
test_00.txt 20 ms 796 KB
test_01.txt 21 ms 932 KB
test_02.txt 20 ms 748 KB
test_03.txt 21 ms 928 KB
test_04.txt 21 ms 800 KB
test_05.txt 22 ms 804 KB
test_06.txt 21 ms 676 KB
test_07.txt 21 ms 800 KB
test_08.txt 21 ms 804 KB
test_09.txt 23 ms 788 KB
test_10.txt 21 ms 800 KB
test_11.txt 22 ms 804 KB
test_12.txt 25 ms 800 KB
test_13.txt 21 ms 672 KB