Submission #47524

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
475242018-05-05 02:10:30ngkan146Schools (IZhO13_school)C++11
100 / 100
192 ms41936 KiB
// khanh best
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct school{
ll m, s, id;
school(ll m=0,ll s=0,ll id=0): m(m), s(s), id(id) {}
};
ll N,M,S;
school a[300005];
ll sum;
bool cmp(school x,school y){
return x.m - x.s < y.m - y.s;
}
struct cmpS{
bool operator ()(school x,school y){
return x.s > y.s;
}
};
struct cmpM{
bool operator ()(school x,school y){
return x.m - x.s > y.m - y.s;
}
};
struct cmpM2{
bool operator ()(school x,school y){
return x.m > y.m;
}
};
priority_queue <school,vector<school>,cmpS> pqS;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

school.cpp: In function 'int main()':
school.cpp:35:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%lld %lld %lld",&N,&M,&S);
    ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
school.cpp:38:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
       scanf("%lld %lld",&a[i].m,&a[i].s),
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       sum += a[i].m,
       ~~~~~~~~~~~~~^~
       a[i].id = i;
       ~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...