Problem gift
User Pout
Submission Time 2026-08-28 19:26:55
Score 0
Max Time N/A
Max Memory N/A

Compile Error

gift.cpp: In function ‘int main()’:
gift.cpp:14:32: error: ‘std::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘split’
14 | long int n, diff = first_line.split();
| ^~~~~
gift.cpp:16:29: error: no matching function for call to ‘getline(std::ifstream&, long int&)’
16 | while (getline(file, timing)) {
| ^
In file included from /usr/include/stdio.h:864,
from /usr/include/c++/9/cstdio:42,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:46,
from gift.cpp:1:
/usr/include/x86_64-linux-gnu/bits/stdio.h:118:1: note: candidate: ‘__ssize_t getline(char**, size_t*, FILE*)’
118 | getline (char **__lineptr, size_t *__n, FILE *__stream)
| ^~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdio.h:118:1: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/