제출 #219384

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2193842020-04-05 08:22:23ho94949치료 계획 (JOI20_treatment)C++17
35 / 100
3081 ms5344 KiB
#include <bits/stdc++.h>
using namespace std;
const int MAXM = 1e5;
int N, M;
int T[MAXM], L[MAXM], R[MAXM], C[MAXM];
int XL[MAXM], YL[MAXM], XR[MAXM], YR[MAXM];
bool vis[MAXM];
int main()
{
scanf("%d%d", &N, &M);
vector<int> x, y;
for(int i=0; i<M; ++i)
{
scanf("%d%d%d%d", T+i, L+i, R+i, C+i);
--L[i]; //L[i] = 0, R[i] = N covers whole
XL[i] = L[i]-T[i], YL[i] = L[i]+T[i];
XR[i] = R[i]-T[i], YR[i] = R[i]+T[i];
x.push_back(XL[i]); x.push_back(XR[i]);
y.push_back(YL[i]); y.push_back(YR[i]);
}
sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
sort(y.begin(), y.end()); y.erase(unique(y.begin(), y.end()), y.end());
for(int i=0; i<M; ++i)
{
XL[i] = lower_bound(x.begin(), x.end(), XL[i]) - x.begin();
XR[i] = lower_bound(x.begin(), x.end(), XR[i]) - x.begin();
YL[i] = lower_bound(y.begin(), y.end(), YL[i]) - y.begin();
YR[i] = lower_bound(y.begin(), y.end(), YR[i]) - y.begin();
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

treatment.cpp: In function 'int main()':
treatment.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &N, &M);
     ~~~~~^~~~~~~~~~~~~~~~
treatment.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d%d", T+i, L+i, R+i, C+i);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...