| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 266605 | dCoding | Gap (APIO16_gap) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
#define F0R(i,n) for(int i = 0; i < (n); i++)
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define ll long long
#define pb push_back
long long findGap(int T, int N) {
vector<ll> a;
ll lo = 0, hi = 1e18;
while((int)a.size() < N) {
ll *mn = 0,*mx = 0;
MinMax(lo,hi,mn,mx);
if(mn == mx) {
a.pb(mn);
} else {
a.pb(mn); a.pb(mx);
hi = mx-1; lo = mn+1;
assert(lo <= hi);
}
}
ll ans = 0;
sort(a.begin(),a.end());
FOR(i,1,N-1) ans = max(ans,a[i]-a[i-1]);
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:19:28: error: no matching function for call to 'push_back(long long int*&)'
19 | a.pb(mn);
| ^
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/queue:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from gap.cpp:4:
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::value_type = long long int]' <near match>
1184 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: conversion of argument 1 would be ill-formed:
gap.cpp:19:26: error: invalid conversion from 'long long int*' to 'std::vector<long long int>::value_type' {aka 'long long int'} [-fpermissive]
19 | a.pb(mn);
| ^~
| |
| long long int*
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/queue:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from gap.cpp:4:
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::value_type = long long int]' <near match>
1200 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: conversion of argument 1 would be ill-formed:
gap.cpp:19:26: error: invalid conversion from 'long long int*' to 'std::vector<long long int>::value_type' {aka 'long long int'} [-fpermissive]
19 | a.pb(mn);
| ^~
| |
| long long int*
gap.cpp:21:28: error: no matching function for call to 'push_back(long long int*&)'
21 | a.pb(mn); a.pb(mx);
| ^
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/queue:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from gap.cpp:4:
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::value_type = long long int]' <near match>
1184 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: conversion of argument 1 would be ill-formed:
gap.cpp:21:26: error: invalid conversion from 'long long int*' to 'std::vector<long long int>::value_type' {aka 'long long int'} [-fpermissive]
21 | a.pb(mn); a.pb(mx);
| ^~
| |
| long long int*
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/queue:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from gap.cpp:4:
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::value_type = long long int]' <near match>
1200 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: conversion of argument 1 would be ill-formed:
gap.cpp:21:26: error: invalid conversion from 'long long int*' to 'std::vector<long long int>::value_type' {aka 'long long int'} [-fpermissive]
21 | a.pb(mn); a.pb(mx);
| ^~
| |
| long long int*
gap.cpp:21:38: error: no matching function for call to 'push_back(long long int*&)'
21 | a.pb(mn); a.pb(mx);
| ^
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/queue:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from gap.cpp:4:
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::value_type = long long int]' <near match>
1184 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: conversion of argument 1 would be ill-formed:
gap.cpp:21:36: error: invalid conversion from 'long long int*' to 'std::vector<long long int>::value_type' {aka 'long long int'} [-fpermissive]
21 | a.pb(mn); a.pb(mx);
| ^~
| |
| long long int*
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/queue:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from gap.cpp:4:
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::value_type = long long int]' <near match>
1200 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: conversion of argument 1 would be ill-formed:
gap.cpp:21:36: error: invalid conversion from 'long long int*' to 'std::vector<long long int>::value_type' {aka 'long long int'} [-fpermissive]
21 | a.pb(mn); a.pb(mx);
| ^~
| |
| long long int*
gap.cpp:22:28: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
22 | hi = mx-1; lo = mn+1;
| ~~^~
| |
| long long int*
gap.cpp:22:39: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
22 | hi = mx-1; lo = mn+1;
| ~~^~
| |
| long long int*