Submission #623477

#TimeUsernameProblemLanguageResultExecution timeMemory
623477tekiBoxes with souvenirs (IOI15_boxes)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #ifndef LOCAL_DEBUG #include "boxes.h" #endif #define pb push_back #define MS(x,y) memset((x), (y), sizeof((x))) typedef long long ll; const ll MN = 1000000007; using namespace std; int delivery (int n, int k, int l, vector<int> pos) { ll res = 0; for (int i = 0; i<n; i++) res += min(pos[i],l-pos[i]); return res; } #ifdef LOCAL_DEBUG int main() { #ifdef LOCAL_DEBUG fstream cin("in.txt"); #endif ios_base::sync_with_stdio(false); cout.tie(0); cin.tie(0); } #endif

Compilation message (stderr)

boxes.cpp: In function 'int delivery(int, int, int, std::vector<int>)':
boxes.cpp:18:12: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   18 |     return res;
      |            ^~~
boxes.cpp:13:26: warning: unused parameter 'k' [-Wunused-parameter]
   13 | int delivery (int n, int k, int l, vector<int> pos) {
      |                      ~~~~^
/usr/bin/ld: /tmp/ccDhJa2F.o: in function `main':
grader.c:(.text.startup+0x1ef): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status