# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
217324 | jurichhh8 | Konstrukcija (COCI20_konstrukcija) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
include <iostream>
#include <cmath>
#include <vector>
using namespace std;
vector<int> veki[1000];
int mx;
int main () {
long long k;
cin>>k;
if(k==0){
cout<<5<<" "<<5<<endl<<1<<" "<<2<<endl<<2<<" "<<3<<endl<<2<<" "<<4<<endl<<4<<" "<<5<<endl<<3<<" "<<5;
return 0;
}
int sgn=(k<0);
int nep=(k%2);
k=abs(k);
long long x=log2(k);
x++;
long long br;
if(sgn){
br=k;
}
else br=pow(2ll,x)-k;
veki[1].push_back(2);
veki[1].push_back(3);
veki[1].push_back(4);
int e=3;
for(int i=1;i<x;i++){
veki[3*i-1].push_back(3*i+2);
veki[3*i-1].push_back(3*i+3);
veki[3*i-1].push_back(3*i+4);
veki[3*i].push_back(3*i+2);
veki[3*i].push_back(3*i+3);
veki[3*i].push_back(3*i+4);
veki[3*i+1].push_back(3*i+2);
veki[3*i+1].push_back(3*i+3);
veki[3*i+1].push_back(3*i+4);
e+=9;
}
br/=2;
mx=3*x+2;
for(long long i=0;i<x;i++){
if(br & (1<<i)){
if(i%2==0){
veki[1].push_back(mx);
veki[mx].push_back(3*(x-i)+1);
veki[mx].push_back(3*(x-i));
veki[mx].push_back(3*(x-i)-1);
mx++;
e+=4;
}
else{
veki[1].push_back(mx);
veki[mx].push_back(3*(x-i)+1);
veki[mx].push_back(3*(x-i));
veki[mx].push_back(3*(x-i)-1);
mx++;
veki[1].push_back(mx);
veki[mx].push_back(3*(x-i-1)+1);
veki[mx].push_back(3*(x-i-1));
veki[mx].push_back(3*(x-i-1)-1);
mx++;
e+=8;
}
}
}
if(x%2==0){
veki[1].push_back(mx);
veki[mx].push_back(2);
veki[mx].push_back(3);
veki[mx].push_back(4);
mx++;
e+=4;
if(sgn==0){
veki[1].push_back(mx);
veki[mx].push_back(2);
veki[mx].push_back(3);
veki[mx].push_back(4);
mx++;
e+=4;
}
}
else{
if(sgn){
veki[1].push_back(mx);
veki[mx].push_back(2);
veki[mx].push_back(3);
veki[mx].push_back(4);
mx++;
e+=4;
}
}
if(nep){
veki[1].push_back(mx);
veki[mx].push_back(3*x+1);
veki[mx].push_back(3*x-1);
veki[mx].push_back(3*x);
mx++;
veki[1].push_back(mx);
veki[mx].push_back(mx+1);
mx++;
e+=6;
}
veki[3*x].push_back(mx);
veki[3*x-1].push_back(mx);
veki[3*x+1].push_back(mx);
e+=3;
cout<<mx<<" "<<e<<endl;
for(int i=1;i<mx;i++){
for(int j=0;j<veki[i].size();j++){
cout<<i<<" "<<veki[i][j]<<endl;
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
konstrukcija.cpp:1:1: error: 'include' does not name a type include <iostream> ^~~~~~~ In file included from /usr/include/c++/7/cmath:43:0, from konstrukcija.cpp:2: /usr/include/c++/7/ext/type_traits.h:162:35: error: 'bool __gnu_cxx::__is_null_pointer' redeclared as different kind of symbol __is_null_pointer(std::nullptr_t) ^ /usr/include/c++/7/ext/type_traits.h:157:5: note: previous declaration 'template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)' __is_null_pointer(_Type) ^~~~~~~~~~~~~~~~~ /usr/include/c++/7/ext/type_traits.h:162:26: error: 'nullptr_t' is not a member of 'std' __is_null_pointer(std::nullptr_t) ^~~~~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:362:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^~~~~~ /usr/include/c++/7/type_traits:363:25: error: '_Size' was not declared in this scope struct is_array<_Tp[_Size]> ^~~~~ /usr/include/c++/7/type_traits:363:31: error: template argument 1 is invalid struct is_array<_Tp[_Size]> ^ /usr/include/c++/7/type_traits:561:42: error: 'nullptr_t' is not a member of 'std' struct __is_null_pointer_helper<std::nullptr_t> ^~~~~~~~~ /usr/include/c++/7/type_traits:561:42: error: 'nullptr_t' is not a member of 'std' /usr/include/c++/7/type_traits:561:51: error: template argument 1 is invalid struct __is_null_pointer_helper<std::nullptr_t> ^ /usr/include/c++/7/type_traits:1464:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, __alignof__(_Tp)> { }; ^~~~~~ /usr/include/c++/7/type_traits:1464:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1464:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, __alignof__(_Tp)> { }; ^~~~~~ /usr/include/c++/7/type_traits:1464:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1464:61: error: template argument 1 is invalid : public integral_constant<std::size_t, __alignof__(_Tp)> { }; ^ /usr/include/c++/7/type_traits:1464:61: note: invalid template non-type parameter /usr/include/c++/7/type_traits:1469:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^~~~~~ /usr/include/c++/7/type_traits:1469:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1469:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^~~~~~ /usr/include/c++/7/type_traits:1469:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1469:46: error: template argument 1 is invalid : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/7/type_traits:1469:46: note: invalid template non-type parameter /usr/include/c++/7/type_traits:1471:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^~~~~~ /usr/include/c++/7/type_traits:1472:21: error: '_Size' was not declared in this scope struct rank<_Tp[_Size]> ^~~~~ /usr/include/c++/7/type_traits:1472:27: error: template argument 1 is invalid struct rank<_Tp[_Size]> ^ /usr/include/c++/7/type_traits:1473:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^~~~~~ /usr/include/c++/7/type_traits:1473:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1473:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^~~~~~ /usr/include/c++/7/type_traits:1473:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1473:65: error: template argument 1 is invalid : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/7/type_traits:1473:65: note: invalid template non-type parameter /usr/include/c++/7/type_traits:1477:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^~~~~~ /usr/include/c++/7/type_traits:1477:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1477:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^~~~~~ /usr/include/c++/7/type_traits:1477:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1477:65: error: template argument 1 is invalid : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/7/type_traits:1477:65: note: invalid template non-type parameter /usr/include/c++/7/type_traits:1482:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^~~~~~ /usr/include/c++/7/type_traits:1482:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1482:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^~~~~~ /usr/include/c++/7/type_traits:1482:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1482:46: error: template argument 1 is invalid : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/7/type_traits:1482:46: note: invalid template non-type parameter /usr/include/c++/7/type_traits:1484:47: error: 'std::size_t' has not been declared template<typename _Tp, unsigned _Uint, std::size_t _Size> ^~~~~~ /usr/include/c++/7/type_traits:1485:23: error: '_Size' was not declared in this scope struct extent<_Tp[_Size], _Uint> ^~~~~ /usr/include/c++/7/type_traits:1485:36: error: template argument 1 is invalid struct extent<_Tp[_Size], _Uint> ^ /usr/include/c++/7/type_traits:1486:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^~~~~~ /usr/include/c++/7/type_traits:1486:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1486:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^~~~~~ /usr/include/c++/7/type_traits:1486:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1487:24: error: '_Size' was not declared in this scope _Uint == 0 ? _Size : extent<_Tp, ^~~~~ /usr/include/c++/7/type_traits:1488:28: error: template argument 1 is invalid _Uint - 1>::value> ^ /usr/include/c++/7/type_traits:1488:28: note: invalid template non-type parameter /usr/include/c++/7/type_traits:1493:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^~~~~~ /usr/include/c++/7/type_traits:1493:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1493:37: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^~~~~~ /usr/include/c++/7/type_traits:1493:37: note: suggested alternative: In file included from /usr/include/stdlib.h:32:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from konstrukcija.cpp:2: /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:216:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^~~~~~ In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/vector:60, from konstrukcija.cpp:3: /usr/include/c++/7/type_traits:1495:31: error: template argument 1 is invalid _Uint - 1>::value> ^ /usr/include/c++/7/type_traits:1495:31: note: invalid template non-type parameter /usr/include/c++/7/type_traits:1944:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^~~~~~ /usr/include/c++/7/type_traits:1945:30: error: '_Size' was not declared in this scope struct remove_extent<_Tp[_Size]> ^~~~~ /usr/include/c++/7/type_traits:1945:36: error: template argument 1 is invalid struct remove_extent<_Tp[_Size]> ^ /usr/include/c++/7/type_traits:1957:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^~~~~~ /usr/include/c++/7/type_traits:1958:35: error: '_Size' was not declared in this scope struct remove_all_extents<_Tp[_Size]> ^~~~~ /usr/include/c++/7/type_traits:1958:41: error: template argument 1 is invalid struct remove_all_extents<_Tp[_Size]> ^ /usr/include/c++/7/type_traits:2016:17: error: 'std::size_t' has not been declared template<std::size_t _Len> ^~~~~~ /usr/include/c++/7/type_traits:2021:23: error: '_Len' was not declared in this scope unsigned char __data[_Len]; ^~~~ /usr/include/c++/7/type_traits:2021:23: note: suggested alternative: '__yn' unsigned char __data[_Len]; ^~~~ __yn /usr/include/c++/7/type_traits:2036:17: error: 'std::size_t' has not been declared template<std::size_t _Len, std::size_t _Align = ^~~~~~ /usr/include/c++/7/type_traits:2036:35: error: 'std::size_t' has not been declared template<std::size_t _Len, std::size_t _Align = ^~~~~~ /usr/include/c++/7/type_traits:2037:48: error: '_Len' was not declared in this scope __alignof__(typename __aligned_storage_msa<_Len>::__type)> ^~~~ /usr/include/c++/7/type_traits:2037:48: note: suggested alternative: '__yn' __alignof__(typename __aligned_storage_msa<_Len>::__type)> ^~~~ __yn /usr/include/c++/7/type_traits:2037:52: error: temp