제출 #797996

#제출 시각아이디문제언어결과실행 시간메모리
797996iloveroseanneRabbit Carrot (LMIO19_triusis)C++14
0 / 100
0 ms212 KiB
/// PARK CHAEYOUNG IS MY LOVE /// Author: Ngo Ba Van /// roses_are_rosie #include<bits/stdc++.h> using namespace std; #define ll long long #define int ll #define fi first #define se second #define MASK(i) (1LL<<i) #define BIT(x,i) (x&MASK(i)) #define ONBIT(x,i) (x|MASK(i)) #define OFFBIT(x,i) (x&~MASK(i)) #define COUNT(x) (__builtin_popcount(x)) using ii=pair<int,int>; const ll N=2e5+5,M=1e9+7; ll n,m,res,a[N]; vector<int>dp; void nhap() { cin>>n>>m; for (int i=1;i<=n;i++) { int x; cin>>x; a[i]=m*i-x; } for (int i=1;i<=n;i++) { int pos=upper_bound(dp.begin(),dp.end(),a[i])-dp.begin(); if (pos==dp.size()) dp.push_back(a[i]); else dp[pos]=a[i]; } cout<<n-dp.size(); } signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); #define task "" #define task "a" if(fopen(task".inp","r")) { freopen(task".inp","r",stdin); freopen(task".out","w",stdout); } int t=1; //cin>>t; while (t--) nhap(); }

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

triusis.cpp:41: warning: "task" redefined
   41 | #define task "a"
      | 
triusis.cpp:40: note: this is the location of the previous definition
   40 | #define task ""
      | 
triusis.cpp: In function 'void nhap()':
triusis.cpp:31:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |         if (pos==dp.size()) dp.push_back(a[i]);
      |             ~~~^~~~~~~~~~~
triusis.cpp: In function 'int main()':
triusis.cpp:44:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   44 |     freopen(task".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
triusis.cpp:45:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |     freopen(task".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...