제출 #54031

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

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

boxes.cpp: In function 'int delivery(int, int, int, int*)':
boxes.cpp:14:9: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans;
         ^~~
boxes.cpp:9: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...