Submission #54031

#TimeUsernameProblemLanguageResultExecution timeMemory
54031robertBoxes with souvenirs (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; }

Compilation message (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...