제출 #340504

#제출 시각아이디문제언어결과실행 시간메모리
340504KerimExhibition (JOI19_ho_t2)C++17
100 / 100
74 ms4588 KiB
#include "bits/stdc++.h" #define MAXN 100009 #define INF 1000000007 #define mp(x,y) make_pair(x,y) #define all(v) v.begin(),v.end() #define pb(x) push_back(x) #define wr cout<<"----------------"<<endl; #define ppb() pop_back() #define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++) #define ff first #define ss second #define my_little_dodge 46 #define debug(x) cerr<< #x <<" = "<< x<<endl; using namespace std; typedef long long ll; typedef pair<int,int> PII; template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} PII a[MAXN];int b[MAXN]; int main(){ //freopen("sample-1.in", "r", stdin); int n,m; scanf("%d%d",&n,&m); for(int i=0;i<n;i++) scanf("%d%d",&a[i].ss,&a[i].ff); for(int i=0;i<m;i++) scanf("%d",b+i); sort(a,a+n);sort(b,b+m); int p=m-1; for(int i=n-1;i>=0;i--) if(p>=0 and a[i].ss<=b[p]) p--; printf("%d\n",m-p-1); return 0; }

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:27:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   27 |     for(int i=0;i<m;i++)
      |     ^~~
joi2019_ho_t2.cpp:29:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   29 |  sort(a,a+n);sort(b,b+m);
      |  ^~~~
joi2019_ho_t2.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   24 |     scanf("%d%d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t2.cpp:26:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   26 |      scanf("%d%d",&a[i].ss,&a[i].ff);
      |      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:28:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   28 |      scanf("%d",b+i);
      |      ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...