제출 #159706

#제출 시각아이디문제언어결과실행 시간메모리
159706geon040702덩치 (KOI13_body)C++14
18 / 18
2 ms504 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...