제출 #114348

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1143482019-06-01 03:14:56onjo0127Employment (JOI16_employment)C++11
100 / 100
242 ms13188 KiB
#include <bits/stdc++.h>
using namespace std;
struct query {
int ty, a, b;
} B[200009];
vector<int> S;
int A[200009], C[200009], F[400009];
int f(int x) {
return (int)S.size() - (lower_bound(S.begin(), S.end(), x) - S.begin());
}
void upd(int x, int y) { for(int i=x; i<=(int)S.size(); i+=(i&-i)) F[i] += y; }
int get(int x) {int s = 0; for(int i=x; i>=1; i-=(i&-i)) s += F[i]; return s; }
void update(int id, int nw) {
upd(A[id], -C[id]);
A[id] = nw;
if(A[id-1] <= A[id] && A[id+1] < A[id]) C[id] = -1;
else if(A[id-1] > A[id] && A[id+1] >= A[id]) C[id] = +1;
else C[id] = 0;
upd(A[id], C[id]);
}
int main() {
int N, M; scanf("%d%d",&N,&M);
for(int i=1; i<=N; i++) {
scanf("%d",&A[i]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

employment.cpp: In function 'int main()':
employment.cpp:28:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int N, M; scanf("%d%d",&N,&M);
               ~~~~~^~~~~~~~~~~~~~
employment.cpp:30:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&A[i]);
         ~~~~~^~~~~~~~~~~~
employment.cpp:34:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         int t, a, b = -1; scanf("%d",&t);
                           ~~~~~^~~~~~~~~
employment.cpp:36:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&a);
             ~~~~~^~~~~~~~~
employment.cpp:40:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d%d",&a,&b);
             ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...