제출 #908587

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9085872024-01-16 14:46:20sofija6수열 (APIO14_sequence)C++14
100 / 100
1084 ms84316 KiB
#include <bits/stdc++.h>
#define ll long long
#define MAXN 100002
#define MAXK 202
using namespace std;
ll dp[MAXN][2],pref[MAXN];
int prevv[MAXN][MAXK];
struct line
{
long double k,m;
long double Calc(ll x)
{
return k*x+m;
}
long double Intersect(line l)
{
return (m-l.m)/(l.k-k);
}
};
int main()
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll n,k,a;
cin >> n >> k;
for (int i=1;i<=n;i++)
{
cin >> a;
pref[i]=pref[i-1]+a;
}
deque<pair<line,ll> > d;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

sequence.cpp: In function 'int main()':
sequence.cpp:36:24: warning: narrowing conversion of '- pref[(j - 1)]' from 'long long int' to 'long double' [-Wnarrowing]
   36 |         d.push_front({{-pref[j-1],dp[j-1][0]},j-1});
      |                        ^~~~~~~~~~
sequence.cpp:36:44: warning: narrowing conversion of 'dp[(j - 1)][0]' from 'long long int' to 'long double' [-Wnarrowing]
   36 |         d.push_front({{-pref[j-1],dp[j-1][0]},j-1});
      |                                   ~~~~~~~~~^
sequence.cpp:51:27: warning: narrowing conversion of '- pref[i]' from 'long long int' to 'long double' [-Wnarrowing]
   51 |                 line cur={-pref[i],dp[i][0]};
      |                           ^~~~~~~~
sequence.cpp:51:43: warning: narrowing conversion of 'dp[i][0]' from 'long long int' to 'long double' [-Wnarrowing]
   51 |                 line cur={-pref[i],dp[i][0]};
      |                                    ~~~~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...