제출 #129810

#제출 시각아이디문제언어결과실행 시간메모리
129810DodgeBallMan선물상자 (IOI15_boxes)C++14
0 / 100
2 ms376 KiB
#include <bits/stdc++.h> #include "boxes.h" using namespace std; const int N = 1e6 + 10; long long ans = 1e18, dpr[N], dpl[N], n, k, l, p[N]; long long delivery( int N, int K, int L, int P[] ) { n = ( long long )N, k = ( long long )K, l = ( long long )L; for( int i = 1 ; i <= n ; i++ ) p[i] = ( long long )P[i-1]; for( int i = 1 ; i <= n ; i++ ) dpr[i] = p[i] * 2LL + dpr[max( 0LL, ( long long )i - k )]; for( int i = n ; i >= 1 ; i-- ) dpl[i] = l - p[i] * 2LL + dpl[min( l + 1, ( long long )i + k )]; for( int i = 0 ; i <= n ; i++ ) ans = min( ans, dpr[i] + dpl[i+1] ); return ans; }

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

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:9:50: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 long long delivery( int N, int K, int L, int P[] ) {
                                                  ^
boxes.cpp:6:11: note: shadowed declaration is here
 const int N = 1e6 + 10;
           ^
boxes.cpp:13:18: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     for( int i = n ; i >= 1 ; i-- ) dpl[i] = l - p[i] * 2LL + dpl[min( l + 1, ( long long )i + k )];
                  ^
#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...