제출 #129383

#제출 시각아이디문제언어결과실행 시간메모리
129383MrUnknownExhibition (JOI19_ho_t2)C++11
0 / 100
2 ms256 KiB
/*** * __ __ _ _ _ * | \/ | | | | | | | * | \ / |_ __ | | | |_ __ | | ___ __ _____ ___ __ * | |\/| | '__| | | | | '_ \| |/ / '_ \ / _ \ \ /\ / / '_ \ * | | | | | _ | |__| | | | | <| | | | (_) \ V V /| | | | * |_| |_|_| (_) \____/|_| |_|_|\_\_| |_|\___/ \_/\_/ |_| |_| * * ***/ #include<stdio.h> #include<bits/stdc++.h> using namespace std; #define ll long long #define f(i,a,b) for (int i=a;i<=b;i++) #define f_(i,a,b) for (int i=a;i>=b;i--) #define MP make_pair #define ii pair<int,int> #define iii pair<int,ii> #define fi first #define se second const ll mod=1000000007; int n,m,pos=0,dem=0; vector<ii> vp; vector<int> vq; int main() { // freopen("","r",stdin); // freopen("","w",stdout); scanf("%d %d", &n, &m); f(i,0,n-1) { int ui,vi; scanf("%d %d", &ui, &vi); vp.push_back(MP(vi,ui)); // scanf("%d %d", &vp[i].se, &vp[i].fi); } f(j,1,m) { int xi; scanf("%d", &xi); vq.push_back(xi); // scanf("%d", &vq[j]); } sort(vp.begin(),vp.end()); sort(vq.begin(),vq.end()); f(i,0,n-1) { while (vq[pos]<vp[i].se&&pos<m) pos++; if (pos==m) break; dem++; pos++; } printf("%d", dem); return 0; }

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:30:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m);
  ~~~~~^~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:33:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &ui, &vi);
   ~~~~~^~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:39:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &xi);
   ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...