답안 #159706

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
159706 2019-10-24T03:58:06 Z geon040702 덩치 (KOI13_body) C++14
18 / 18
2 ms 504 KB
#include <bits/stdc++.h>
using namespace std;

struct data {
    int kg;
    int cm;
    int grade = 1;
};

int n, i, j;

int main(void)
{
    data person[110];
    scanf("%d", &n);

    for(i=0;i<n;i++) {
        scanf("%d%d", &person[i].kg, &person[i].cm);
    }

    for(i=0;i<n;i++) {
        for(j=0;j<n;j++) {
            if(person[i].cm < person[j].cm && person[i].kg < person[j].kg) {
                person[i].grade+=1;
            }
        }
    }

    for(i=0;i<n;i++) {
        printf("%d ", person[i].grade);
    }

    return 0;
}

Compilation message

bb.cpp: In function 'int main()':
bb.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
bb.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d", &person[i].kg, &person[i].cm);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 356 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct