제출 #54045

#제출 시각아이디문제언어결과실행 시간메모리
54045robert선물상자 (IOI15_boxes)C++14
0 / 100
2 ms376 KiB
#include <iostream> #include <algorithm> using namespace std; int dtz(int a, int L){ return min(a, L-a); } int delivery(int N, int K, int L, int *p){ p[N] = 0; sort(p, p+N); p[N+1] = 0; long long ans = 0; for(int n=0; n<=N; n++){ ans = min(ans, (long long)p[n] + (long long)(L-p[n+1])); } return ans; }

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

boxes.cpp: In function 'int delivery(int, int, int, int*)':
boxes.cpp:18:9: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans;
         ^~~
boxes.cpp:10:25: warning: unused parameter 'K' [-Wunused-parameter]
 int delivery(int N, int K, int L, int *p){
                         ^
#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...