Submission #800514

#TimeUsernameProblemLanguageResultExecution timeMemory
800514firewaterBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "boxes.h" #include <stdio.h> #include <stdlib.h> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define ll long long using namespace std; static char _buffer[1024]; static int _currentChar = 0; static int _charsNumber = 0; static FILE *_inputFile, *_outputFile; static inline int _read() { if (_charsNumber < 0) { exit(1); } if (!_charsNumber || _currentChar == _charsNumber) { _charsNumber = (int)fread(_buffer, sizeof(_buffer[0]), sizeof(_buffer), _inputFile); _currentChar = 0; } if (_charsNumber <= 0) { #define N 100100 ll n,k,m,ans,a[N]; long long delivery(int NN, int K, int L, int ppp[]) { n=NN; k=K; m=L; for(ll i=1;i<=n;++i) a[i]=ppp[i-1]; return min(min(m-a[1],a[n])*2,m); }

Compilation message (stderr)

boxes.cpp: In function 'int _read()':
boxes.cpp:46:53: error: a function-definition is not allowed here before '{' token
   46 | long long delivery(int NN, int K, int L, int ppp[]) {
      |                                                     ^
boxes.cpp:45:4: warning: unused variable 'n' [-Wunused-variable]
   45 | ll n,k,m,ans,a[N];
      |    ^
boxes.cpp:45:6: warning: unused variable 'k' [-Wunused-variable]
   45 | ll n,k,m,ans,a[N];
      |      ^
boxes.cpp:45:8: warning: unused variable 'm' [-Wunused-variable]
   45 | ll n,k,m,ans,a[N];
      |        ^
boxes.cpp:45:10: warning: unused variable 'ans' [-Wunused-variable]
   45 | ll n,k,m,ans,a[N];
      |          ^~~
boxes.cpp:45:14: warning: unused variable 'a' [-Wunused-variable]
   45 | ll n,k,m,ans,a[N];
      |              ^
boxes.cpp:55:1: error: expected '}' at end of input
   55 | }
      | ^
boxes.cpp:34:28: note: to match this '{'
   34 |     if (_charsNumber <= 0) {
      |                            ^
boxes.cpp:55:1: error: expected '}' at end of input
   55 | }
      | ^
boxes.cpp:26:27: note: to match this '{'
   26 | static inline int _read() {
      |                           ^
boxes.cpp: At global scope:
boxes.cpp:24:27: warning: '_outputFile' defined but not used [-Wunused-variable]
   24 | static FILE *_inputFile, *_outputFile;
      |                           ^~~~~~~~~~~