submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s808352999 | p03645 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <limits>
#include <map>
using namespace std;
typedef std::numeric_limits<double> dbl;
const long long int LL_INF=1LL<<60;
vector<string> split(const string& input, char delimiter)
{
stringstream stream(input);
string field;
vector<string> result;
while (getline(stream, field, delimiter)) {
result.push_back(field);
}
return result;
}
//#define DEBUG
int N, M;
pair<int, int> data[200000];
int candi[200000];
int main()
{
cin >> N >> M;
for (int m = 0; m < M; ++m) {
cin >> data[m].first >> data[m].second;
}
int cnt = 0;
for (auto& d : data) {
if (N == d.first){
candi[cnt] = d.second;
cnt++;
}else if (N == d.second) {
candi[cnt] = d.first;
cnt++;
}
}
sort(data[0], data[M-1]);
for (int i = 0; i < cnt; ++i) {
int c = candi[i];
for (int m = 0; m < M; ++m) {
if (c == data[m].first && data[m].second == 1 ){
cout << "POSSIBLE" << endl;
return 0;
}
if (c == data[m].second && data[m].first == 1 ){
cout << "POSSIBLE" << endl;
return 0;
}
}
}
cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:37:20: error: reference to 'data' is ambiguous
37 | cin >> data[m].first >> data[m].second;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:37:37: error: reference to 'data' is ambiguous
37 | cin >> data[m].first >> data[m].second;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:41:24: error: reference to 'data' is ambiguous
41 | for (auto& d : data) {
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:51:14: error: reference to 'data' is ambiguous
51 | sort(data[0], data[M-1]);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:51:23: error: reference to 'data' is ambiguous
51 | sort(data[0], data[M-1]);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:55:26: error: reference to 'data' is ambiguous
55 | if (c == data[m].first && data[m].second == 1 ){
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:55:43: error: reference to 'data' is ambiguous
55 | if (c == data[m].first && data[m].second == 1 ){
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:59:26: error: reference to 'data' is ambiguous
59 | if (c == data[m].second && data[m].first == 1 ){
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:59:44: error: reference to 'data' is ambiguous
59 | if (c == data[m].second && dat |
s157745926 | p03645 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int MAXN=200050;
int f[MAXN];
int n,m;
int fInd(int x)
{
while(f[x]!=f[f[x]]) f[x]=f[f[x]];
return f[x];
}
void merge(int a,int b)
{
a=find(a); b=find(b);
f[b]=a;
return;
}
int main()
{
int u,v;
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++) f[i]=i;
for(int i=1;i<=m;i++)
{
scanf("%d%d",&u,&v);
merge(u,v);
}
if(find(1)==find(n)) puts("POSSIBLE");
else puts("IMPOSSIBLE");
return 0;
} | a.cc: In function 'void merge(int, int)':
a.cc:18:11: error: no matching function for call to 'find(int&)'
18 | a=find(a); b=find(b);
| ~~~~^~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
3842 | find(_InputIterator __first, _InputIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate expects 4 arguments, 1 provided
a.cc:18:22: error: no matching function for call to 'find(int&)'
18 | a=find(a); b=find(b);
| ~~~~^~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
3842 | find(_InputIterator __first, _InputIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate expects 4 arguments, 1 provided
a.cc: In function 'int main()':
a.cc:32:12: error: no matching function for call to 'find(int)'
32 | if(find(1)==find(n)) puts("POSSIBLE");
| ~~~~^~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
3842 | find(_InputIterator __first, _InputIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate expects 4 arguments, 1 provided
a.cc:32:21: error: no matching function for call to 'find(int&)'
32 | if(find(1)==find(n)) puts("POSSIBLE");
| ~~~~^~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
3842 | find(_InputIterator __first, _InputIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate expects 4 arguments, 1 provided
|
s511689308 | p03645 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <limits>
#include <map>
using namespace std;
typedef std::numeric_limits<double> dbl;
const long long int LL_INF=1LL<<60;
vector<string> split(const string& input, char delimiter)
{
stringstream stream(input);
string field;
vector<string> result;
while (getline(stream, field, delimiter)) {
result.push_back(field);
}
return result;
}
//#define DEBUG
int N, M;
pair<int, int> data[200000];
int candi[200000];
int main()
{
cin >> N >> M;
for (int m = 0; m < M; ++m) {
cin >> data[m].first >> data[m].second;
}
int cnt = 0;
for (auto& d : data) {
if (N == d.first){
candi[cnt] = d.second;
cnt++;
}else if (N == d.second) {
candi[cnt] = d.first;
cnt++;
}
}
sort(data.begin(), data.end());
for (int i = 0; i < cnt; ++i) {
int c = candi[i];
for (int m = 0; m < M; ++m) {
if (c == data[m].first && data[m].second == 1 ){
cout << "POSSIBLE" << endl;
return 0;
}
if (c == data[m].second && data[m].first == 1 ){
cout << "POSSIBLE" << endl;
return 0;
}
}
}
cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:37:20: error: reference to 'data' is ambiguous
37 | cin >> data[m].first >> data[m].second;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:37:37: error: reference to 'data' is ambiguous
37 | cin >> data[m].first >> data[m].second;
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:41:24: error: reference to 'data' is ambiguous
41 | for (auto& d : data) {
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:51:14: error: reference to 'data' is ambiguous
51 | sort(data.begin(), data.end());
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:51:28: error: reference to 'data' is ambiguous
51 | sort(data.begin(), data.end());
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:55:26: error: reference to 'data' is ambiguous
55 | if (c == data[m].first && data[m].second == 1 ){
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:55:43: error: reference to 'data' is ambiguous
55 | if (c == data[m].first && data[m].second == 1 ){
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:59:26: error: reference to 'data' is ambiguous
59 | if (c == data[m].second && data[m].first == 1 ){
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:30:16: note: 'std::pair<int, int> data [200000]'
30 | pair<int, int> data[200000];
| ^~~~
a.cc:59:44: error: reference to 'data' is ambiguous
59 | if (c == data |
s884202216 | p03645 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#define maxN 2000000
using namespace std;
int N,M;
int ED[maxN][maxN];
bool e_flg=false;
void dfs(int n, int c){
if(e_flg) return;
if(c==2 && n==N){
cout<<"POSSIBLE"<<endl;
e_flg=true;
return;
}
for(int i = 1; i <= N; i++){
if(i==n) continue;
else if(ED[n][i]==1) dfs(i,c+1);
}
}
int main(void){
cin.sync_with_stdio(false);
cin>>N>>M;
for(int i = 1; i <= N; i++){
ED[i][i] = 0;
}
for(int i = 0; i < M; i++){
int a,b;
cin>>a>>b;
ED[a][b] = 1;
}
dfs(1,0);
if(e_flg==false) cout<<"IMPOSSIBLE"<<endl;
return 0;
} | /tmp/cc1pWZcn.o: in function `dfs(int, int)':
a.cc:(.text+0x11): relocation truncated to fit: R_X86_64_PC32 against symbol `e_flg' defined in .bss section in /tmp/cc1pWZcn.o
a.cc:(.text+0x5b): relocation truncated to fit: R_X86_64_PC32 against symbol `e_flg' defined in .bss section in /tmp/cc1pWZcn.o
/tmp/cc1pWZcn.o: in function `main':
a.cc:(.text+0x1b7): relocation truncated to fit: R_X86_64_PC32 against symbol `e_flg' defined in .bss section in /tmp/cc1pWZcn.o
collect2: error: ld returned 1 exit status
|
s457707955 | p03645 | C++ | #include <iostream>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int map[200001][200001];
int N, M;
int main(){
cin >> N >> M;
REP(i, M){
int a, b;
cin >> a >> b;
map[a][b] = 1;
}
int flag = 0;
REP(i, 200001){
if(map[1][i] == 1){
if(map[i][N] == 1){
flag = 1;
}
}
}
if(flag){
cout << "POSSIBLE" << endl;
}else{
cout << "IMPOSSIBLE" << endl;
}
return 0;
} | /tmp/ccmQ32GZ.o: in function `main':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccmQ32GZ.o
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccmQ32GZ.o
a.cc:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccmQ32GZ.o
a.cc:(.text+0xd5): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccmQ32GZ.o
collect2: error: ld returned 1 exit status
|
s644941413 | p03645 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> f;
bool t[200000] = {};
bool fl=false;
int n,m;
int a,b;
cin>>n>>m;
for(int i=0;i<m;i++){
cin>>a>>b;
if(a==1){
f.push_back(b);
}else if(b==n){
t[a] = true;
}
}
for(int i=0;i<f.size();i++){
if(t[f[i]]){
fl=true;
break;
}
}
cout<< (fl?"POSSIBLE":"IMPOSSIBLE")<<endl;
return 0;
}
. | a.cc:28:1: error: expected unqualified-id before '.' token
28 | .
| ^
|
s879569228 | p03645 | C++ | #include <iostream>
#include <vector>
using namespace std;
vector<int> f[200005];
int main(){
int N,M,a,b;
cin>>N>>M;
for(int i=1;i<=M;i++)
{
cin>>a>>b;
f[a].push_back(b);
}
for(int i=0;i<f[1].size();i++)
{
for(int j=0;j<f[f[1][i]].size();j++)
if(f[f[1][i]][j]==5) {
cout<<"POSSIBLE"<<endl; return 0;
}
}
cout<<"IMPOSSIBLE"<<endl;
return 0
}
| a.cc: In function 'int main()':
a.cc:21:10: error: expected ';' before '}' token
21 | return 0
| ^
| ;
22 | }
| ~
|
s941701793 | p03645 | C++ |
#include <iostream>
#include <conio.h>
#include <vector>
using namespace std;
vector<int> graph[200005];
int main()
{
int n, m;
cin >> n >> m;
int a, b;
for (int i = 0; i < m; i++)
{
cin >> a >> b;
graph[a].push_back(b);
graph[b].push_back(a);
}
for (int i = 0; i < graph[1].size(); i++)
{
for (int j = 0; j < graph[graph[1][i]].size(); j++)
{
if (graph[graph[1][i]][j] == n)
{
cout << "POSSIBLE";
//_getch();
return 0;
}
}
}
cout << "IMPOSSIBLE";
//_getch();
return 0;
} | a.cc:3:10: fatal error: conio.h: No such file or directory
3 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s153335772 | p03645 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> f;
vector<int> t;
int n,m;
int a,b;
cin>>n>>m;
for(int i=0;i<M;i++){
cin>>a>>b;
if(a==M){
f.push_back(b);
}
if(b==N){
t.push_back(a);
}
}
bool f=false;
for(int i=0;i<f.size();i++){
b=f[i];
for(int j=0;j<t.size();j++){
if(b==t[j]){
f=true;
break;
}
}
if(f)break;
}
cout<< f?"POSSIBLE":"IMPOSSIBLE"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:23: error: 'M' was not declared in this scope
11 | for(int i=0;i<M;i++){
| ^
a.cc:16:23: error: 'N' was not declared in this scope
16 | if(b==N){
| ^
a.cc:20:14: error: conflicting declaration 'bool f'
20 | bool f=false;
| ^
a.cc:5:21: note: previous declaration as 'std::vector<int> f'
5 | vector<int> f;
| ^
a.cc:25:35: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'bool')
25 | f=true;
| ^~~~
In file included from /usr/include/c++/14/vector:72,
from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from 'bool' to 'const std::vector<int>&'
211 | operator=(const vector<_Tp, _Alloc>& __x)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note: no known conversion for argument 1 from 'bool' to 'std::vector<int>&&'
766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
| ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
788 | operator=(initializer_list<value_type> __l)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note: no known conversion for argument 1 from 'bool' to 'std::initializer_list<int>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:29:20: error: could not convert 'f' from 'std::vector<int>' to 'bool'
29 | if(f)break;
| ^
| |
| std::vector<int>
a.cc:31:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>')
31 | cout<< f?"POSSIBLE":"IMPOSSIBLE"<<endl;
| ~~~~^~ ~
| | |
| | std::vector<int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<int>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = s |
s653691964 | p03645 | C++ | #include<bits/stdc++.h>
using namespace std;
bool f[200001][200001];
int main(){
int n,m;
cin>>n>>m;
for(int i=0;i<m;i++){
int a,b;
cin>>a>>b;
f[a][b]++;
f[b][a]++;
}
bool ans=false;
for(int i=2;i<n;i++){
if(f[1][i]&&f[i][n]){
ans++;
}
}
if(!ans)cout<<"IM";
cout<<"POSSIBLE"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:15: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
10 | f[a][b]++;
| ~~~~~~^
a.cc:11:15: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
11 | f[b][a]++;
| ~~~~~~^
a.cc:16:13: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
16 | ans++;
| ^~~
|
s103861224 | p03645 | C++ | #include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <ctime>
#include <unordered_set>
#include <unordered_map>
using namespace std;
#ifdef __APPLE__
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...)
#endif
const int N = (int)1e6 + 123;
const int MOD = (int)1e9 + 7;
const int inf = (int)5e8;
const long long infll = (long long)1e17;
bool used[N];
vector<int> g[N];
void dfs(int v) {
used[v] = true;
for (auto to : g[v]) {
if (!used[to]) dfs(to);
}
}
void solve() {
int n, m;
scanf("%d %d", &n, &m);
for (int i = 0; i < m; ++i) {
int u, v;
scanf("%d %d", &u, &v);
--u;
--v;
g[u].push_back(v);
#g[v].push_back(u);
}
dfs(0);
if (used[n - 1]) {
printf("POSSIBLE");
} else {
printf("IMPOSSIBLE");
}
}
int main() {
#ifdef __APPLE__
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t = 1;
while (t--) {
solve();
}
return 0;
} | a.cc:46:9: error: invalid preprocessing directive #g
46 | #g[v].push_back(u);
| ^
|
s776598501 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int k;
cin >> k;
cout << 50 << endl;
for(long long int i=0;i<49;i++){
cout << 1LL+50LL*(k/50LL+(k%50LL>i)) << " ";
}
cout << 1LLLL+50*(k/50LL) << " ";
} | a.cc: In function 'int main()':
a.cc:10:13: error: unable to find numeric literal operator 'operator""LLLL'
10 | cout << 1LLLL+50*(k/50LL) << " ";
| ^~~~~
|
s327863945 | p03646 | C++ | #include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
FastRead
//freopen("output.txt", "w", stdout);
if(n==0){
cout<<"4"<<endl;
cout<<"3 3 3 3"<<endl;
}
else if(n==1){
cout<<"3"<<endl;
cout<<"3 1 0 3"<<endl;
}
else if(n==2){
cout<<"2"<<endl;
cout<<"2 2"<<endl;
}
else if(n==3){
cout<<"7"<<endl;
cout<<"27 0 0 0 0 0 0"<<endl;
}
else{
cout<<"2"<<endl;
cout<<k-2<<" "<<k-1<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:9: error: 'n' was not declared in this scope; did you mean 'yn'?
19 | if(n==0){
| ^
| yn
a.cc:37:15: error: 'k' was not declared in this scope
37 | cout<<k-2<<" "<<k-1<<endl;
| ^
|
s873906432 | p03646 | C++ | #include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;
const int N = 100010, M = 1010;
LL a[N];
LL k;
int main()
{
cin >> k;
for (int i = 1; i <= n; i ++ ) a[i] = i + k / 50LL;
for (int i = 1; i <= 50LL - k % 50LL; i ++ ) a[i] -- ;
puts("50");
for (int i = 1; i <= n; i ++ ) cout << a[i] << ' ';
puts("");
return 0;
} | a.cc: In function 'int main()':
a.cc:22:30: error: 'n' was not declared in this scope
22 | for (int i = 1; i <= n; i ++ ) a[i] = i + k / 50LL;
| ^
a.cc:26:30: error: 'n' was not declared in this scope
26 | for (int i = 1; i <= n; i ++ ) cout << a[i] << ' ';
| ^
|
s517808206 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll =long long;
typedef pair<int,int> P;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b) for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n) For(i, 0, n)
#define debug(x) cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//Write From this Line
int main()
{
ll k;
cin >> k;
for(int n = 50; n >= 2; n--){
ll sum = (n - 1) * n + k;
if(sum % n == 0){
cout << n << endl;
rep(i,n){
cout << sum / n << endl;
}
return 0;
}
}
// n = 2でやる
ll sum = n + k;
cout << 2 << endl;
cout <<(sum+1) / 2 << endl;
cout << sum / 2 << endl;
}
| a.cc: In function 'int main()':
a.cc:30:18: error: 'n' was not declared in this scope
30 | ll sum = n + k;
| ^
|
s393150516 | p03646 | C++ | #include<iostream>
using namespace std ;
int main(){
long long k ;
cin >> k ;
cout << "2\n" ;
if(K&1){
cout << (k-1)/2 << " " << (k+5)/2 << endl ;
}else{
cout << k/2 << " " << k/2 << endl ;
}
} | a.cc: In function 'int main()':
a.cc:8:6: error: 'K' was not declared in this scope
8 | if(K&1){
| ^
|
s306878112 | p03646 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int64_t K;
cin>>K;
int64_t a=K/50;
int64_t b=K%50;
vector<int64_t>a(50,49+a);
for(int i=0;i<50-b;i++)
a.at(i)-=b;
for(int i=50-b;i<50;i++)
a.at(i)+=51-b;
cout<<50<<endl;
for(int i=0;i<49;i++)
cout<<a.at(i)<<" ";
cout<<a.at(49)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:18: error: conflicting declaration 'std::vector<long int> a'
8 | vector<int64_t>a(50,49+a);
| ^
a.cc:6:11: note: previous declaration as 'int64_t a'
6 | int64_t a=K/50;
| ^
a.cc:10:7: error: request for member 'at' in 'a', which is of non-class type 'int64_t' {aka 'long int'}
10 | a.at(i)-=b;
| ^~
a.cc:12:7: error: request for member 'at' in 'a', which is of non-class type 'int64_t' {aka 'long int'}
12 | a.at(i)+=51-b;
| ^~
a.cc:15:13: error: request for member 'at' in 'a', which is of non-class type 'int64_t' {aka 'long int'}
15 | cout<<a.at(i)<<" ";
| ^~
a.cc:16:11: error: request for member 'at' in 'a', which is of non-class type 'int64_t' {aka 'long int'}
16 | cout<<a.at(49)<<endl;
| ^~
|
s667347679 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
signed main() {
int K; cin >> K;
int rec[60], ans[60];
int div = K / 50, md = K % 50;
int n=50;
for(int i=0;i<n;i++){
rec[i]=div+(i<md);
}
for(int i=0;i<n;i++){
int S = 0;
for(int j=0;j<n;j++) {
if(i != j) S += rec[j];
}
ans[i] = 50 * (rec[i] + 1) - S - 1;
}
cout << 50 << endl;
rep(i,0,50) cout << (i ? " " : "") << ans[i];
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:9: error: 'i' was not declared in this scope
22 | rep(i,0,50) cout << (i ? " " : "") << ans[i];
| ^
a.cc:22:5: error: 'rep' was not declared in this scope; did you mean 'rec'?
22 | rep(i,0,50) cout << (i ? " " : "") << ans[i];
| ^~~
| rec
|
s161024708 | p03646 | C++ | #include <bits/stdc++.h>
#define rep(i,s,n) for(int i=s;i<n;i++)
#define pb push_back
#define all(x) (x).begin(),(x).end()
using namespace std;
using P=pair<int,int>;
using Graph=vector<vector<int>>;
using ll=long long;
ll gcd(ll A, ll B){
if(B == 0)return A;
return gcd(B, A % B);
}
ll lcm(ll A, ll B){
return A * B / gcd(A, B);
}
bool root(string s){
int n=s.length();
if(n==2){
if(s[0]==s[1]){
return true;
}
else return false;
}
if(n==3){
if(s[0]==s[2]){
return true;
}
else return false;
}
return false;
}
//深さ優先
vector<int> seen;
vector<ll> h;
//普通の深さ優先探索seenを返す感じ
void dfs(const Graph &G,int v){
seen[v] = 0; //v探索済み
P good=make_pair(v,h[v]);
for(auto next_v :G[v]){
if(seen[next_v]!=-1) continue;//もう探索していた
if(h[next_v]>good.second){
good=make_pair(next_v,h[next_v]);
}
dfs(G,next_v);
}
if(!(h[v]==good.second && v==good.first)){
seen[good.first]=1;
}
}
signed main() {
int K; cin >> K;
int rec[60], ans[60];
int div = K / 50, md = K % 50;
rep(i,0,50) rec[i] = div + (i < md);
rep(i,0,50) {
int S = 0;
rep(j,0,50) {
if(i != j) S += rec[j];
}
ans[i] = 50 * (rec[i] + 1) - S - 1;
}
cout << 50 << endl;
rep(i,0,50) cout << (i ? " " : "") << ans[i];
cout << endl;
return 0;
}
/*
int main(){
/*
int n,m;
cin>>n>>m;
h.assign(n,0);
rep(i,0,n) cin>>h[i];
Graph G(n);
rep(i,0,m){
int a,b; cin>>a>>b;
G[a-1].push_back(b-1);
G[b-1].push_back(a-1);
}
seen.assign(n,-1);
rep(i,0,n){
if(seen[i]==-1){
dfs(G,i);
}
}
int sum=accumulate(all(seen),0);
cout<<sum<<endl;*/
ll k; cin>>k;
ll n=50;
ll s[n],ans[n];
vector<ll> d(n,0);
ll div=k/n; ll ama=k%n;
rep(i,0,n){
s[i]=div+(i<ama);
}
rep(i,0,n){
int sum=0;
rep(j,0,n){
if(i!=j) sum+=s[j];
}
ans[i]=n*(s[i]+1)-sum-1;
}
cout<<n<<endl;
rep(i,0,n){
cout<<(i ? " ":"") <<ans[i];
}
cout<<endl;
}
*/ | a.cc:104:11: error: 'cin' does not name a type
104 | ll k; cin>>k;
| ^~~
a.cc:106:10: error: size of array 's' is not an integral constant-expression
106 | ll s[n],ans[n];
| ^
a.cc:106:17: error: size of array 'ans' is not an integral constant-expression
106 | ll s[n],ans[n];
| ^
a.cc:109:8: error: 'll div' redeclared as different kind of entity
109 | ll div=k/n; ll ama=k%n;
| ^~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
from a.cc:1:
/usr/include/stdlib.h:992:14: note: previous declaration 'div_t div(int, int)'
992 | extern div_t div (int __numer, int __denom)
| ^~~
a.cc:2:20: error: expected unqualified-id before 'for'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^~~
a.cc:111:5: note: in expansion of macro 'rep'
111 | rep(i,0,n){
| ^~~
a.cc:111:9: error: 'i' does not name a type
111 | rep(i,0,n){
| ^
a.cc:2:32: note: in definition of macro 'rep'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^
a.cc:111:9: error: 'i' does not name a type
111 | rep(i,0,n){
| ^
a.cc:2:36: note: in definition of macro 'rep'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^
a.cc:2:20: error: expected unqualified-id before 'for'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^~~
a.cc:115:5: note: in expansion of macro 'rep'
115 | rep(i,0,n){
| ^~~
a.cc:115:9: error: 'i' does not name a type
115 | rep(i,0,n){
| ^
a.cc:2:32: note: in definition of macro 'rep'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^
a.cc:115:9: error: 'i' does not name a type
115 | rep(i,0,n){
| ^
a.cc:2:36: note: in definition of macro 'rep'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^
a.cc:123:5: error: 'cout' does not name a type
123 | cout<<n<<endl;
| ^~~~
a.cc:2:20: error: expected unqualified-id before 'for'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^~~
a.cc:124:5: note: in expansion of macro 'rep'
124 | rep(i,0,n){
| ^~~
a.cc:124:9: error: 'i' does not name a type
124 | rep(i,0,n){
| ^
a.cc:2:32: note: in definition of macro 'rep'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^
a.cc:124:9: error: 'i' does not name a type
124 | rep(i,0,n){
| ^
a.cc:2:36: note: in definition of macro 'rep'
2 | #define rep(i,s,n) for(int i=s;i<n;i++)
| ^
a.cc:128:5: error: 'cout' does not name a type
128 | cout<<endl;
| ^~~~
a.cc:129:1: error: expected declaration before '}' token
129 | }
| ^
a.cc:130:2: error: expected unqualified-id before '/' token
130 | */
| ^
|
s015769231 | p03646 | C++ | int K, rec[60], ans[60];
const int N = 50;
signed main() {
cin >> K;
int div = K / N, mo = K % N;
rep(i,0,N) rec[i] = div + (i < mo);
rep(i,0,N) {
int sum = 0;
rep(j,0,N) if(i != j) sum += rec[j];
ans[i] = N * (rec[i] + 1) - sum - 1;
}
cout << N << endl;
rep(i,0,N) cout << (i ? " " : "") << ans[i];
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin >> K;
| ^~~
a.cc:7:9: error: 'i' was not declared in this scope
7 | rep(i,0,N) rec[i] = div + (i < mo);
| ^
a.cc:7:5: error: 'rep' was not declared in this scope; did you mean 'rec'?
7 | rep(i,0,N) rec[i] = div + (i < mo);
| ^~~
| rec
a.cc:14:5: error: 'cout' was not declared in this scope
14 | cout << N << endl;
| ^~~~
a.cc:14:18: error: 'endl' was not declared in this scope
14 | cout << N << endl;
| ^~~~
|
s286745840 | p03646 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define ALL(v) v.begin(),v.end()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cout<<v[i]<<" "
using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct Edge{ll from, to, cost;};
struct node{ll cost, to;
bool friend operator>(node a, node b){
return a.cost>b.cost;
}
};
ll mod(ll a, ll mod){
ll res = a%mod;
if(res<0)res=res + mod;
return res;
}
ll modpow(ll a, ll n, ll mod){
ll res=1;
while(n>0){
if(n&1) res=res*a%mod;
a=a*a%mod;
n>>=1;
}
return res;
}
ll modinv(ll a, ll mod){
return modpow(a, mod-2, mod);
}
ll gcd(ll a, ll b){
ll r = a%b;
if(r==0) return b;
else return gcd(b, a%b);
}
bool is_prime(ll n){
ll i = 2;
if(n==1)return false;
if(n==2)return true;
bool res = true;
while(i*i <n){
if(n%i==0){
res = false;
}
i = i+1;
}
//if(i==1)res = false;
if(n%i==0)res=false;
return res;
}
/**************************************
** A main function starts from here **
***************************************/
int main(){
ll K, N;
//cin >> K >> N;
cin >> K;
N=50
//N=5;
ll from = K/(N);
ll exception = K/(N)+N-(K%(N));
//cout << exception << endl;
cout << N <<endl;
FOR(i, from, from+N+1){
if(i==exception)continue;
cout << i << " ";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:73:7: error: expected ';' before 'll'
73 | N=50
| ^
| ;
74 | //N=5;
75 | ll from = K/(N);
| ~~
a.cc:79:10: error: 'from' was not declared in this scope; did you mean 'fromfp'?
79 | FOR(i, from, from+N+1){
| ^~~~
a.cc:6:31: note: in definition of macro 'FOR'
6 | #define FOR(i, j, k) for(ll i=j;i<k;i++)
| ^
|
s391240348 | p03646 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define ALL(v) v.begin(),v.end()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cout<<v[i]<<" "
using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct Edge{ll from, to, cost;};
struct node{ll cost, to;
bool friend operator>(node a, node b){
return a.cost>b.cost;
}
};
ll mod(ll a, ll mod){
ll res = a%mod;
if(res<0)res=res + mod;
return res;
}
ll modpow(ll a, ll n, ll mod){
ll res=1;
while(n>0){
if(n&1) res=res*a%mod;
a=a*a%mod;
n>>=1;
}
return res;
}
ll modinv(ll a, ll mod){
return modpow(a, mod-2, mod);
}
ll gcd(ll a, ll b){
ll r = a%b;
if(r==0) return b;
else return gcd(b, a%b);
}
bool is_prime(ll n){
ll i = 2;
if(n==1)return false;
if(n==2)return true;
bool res = true;
while(i*i <n){
if(n%i==0){
res = false;
}
i = i+1;
}
//if(i==1)res = false;
if(n%i==0)res=false;
return res;
}
/**************************************
** A main function starts from here **
***************************************/
int main(){
ll K, N;
cin >> K;
N=50
ll from = K/(N+1);
ll exception = K/(N+1)+N-(K%(N+1));
cout << exception << endl;
cout << N <<endl;
FOR(i, from, from+N+1){
if(i==exception)continue;
cout << i << " ";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:72:7: error: expected ';' before 'll'
72 | N=50
| ^
| ;
73 | ll from = K/(N+1);
| ~~
a.cc:77:10: error: 'from' was not declared in this scope; did you mean 'fromfp'?
77 | FOR(i, from, from+N+1){
| ^~~~
a.cc:6:31: note: in definition of macro 'FOR'
6 | #define FOR(i, j, k) for(ll i=j;i<k;i++)
| ^
|
s869363403 | p03646 | C++ | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1)/b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
int nmax=200000; // 2*(10^5)
vvec g(nmax);
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(15);
//---------------------------------------------
int k;
cin>>k;
vec a(50,49);
int n=50;
rep(i,n) a[i]+=k/50;
int memo=k%50;
a[0]+=memo*50;
rep(i,n-1) a[i+1]-=memo;
cout<<50<endl;
rep(i,n) cout<<a[i]<<" ";
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:65:13: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
65 | cout<<50<endl;
| ~~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: couldn't deduce template parameter '_Bi_iter'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: couldn't deduce template parameter '_Bi_iter'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
65 | cout<<50<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
65 | cout<<50<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
65 | cout<<50<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: couldn't deduce template parameter '_CharT'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
65 | cout<<50<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:65:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits |
s557763162 | p03646 | C++ | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1)/b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
int nmax=200000; // 2*(10^5)
vvec g(nmax);
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(15);
//---------------------------------------------
int k;
cin>>k;
vec a(50,49);
int n=50;
rep(i,n) a[i]+=k/50;
int memo=k%50;
a[0]+=memo*50;
rep(i,n-1) a[i+1]-=memo;
cout<<<50<endl;
rep(i,n) cout<<a[i]<<" ";
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:65:11: error: expected primary-expression before '<' token
65 | cout<<<50<endl;
| ^
|
s710005728 | p03646 | C++ | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1)/b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
int nmax=200000; // 2*(10^5)
vvec g(nmax);
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(15);
//---------------------------------------------
int k;
cin>>k;
vec a(50,49);
rep(i,n) a[i]+=k/50;
int memo=k%50;
a[0]+=memo*50;
rep(i,n-1) a[i+1]-=memo;
cout<<<50<endl;
rep(i,n) cout<<a[i]<<" ";
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:59:11: error: 'n' was not declared in this scope
59 | rep(i,n) a[i]+=k/50;
| ^
a.cc:8:39: note: in definition of macro 'rep'
8 | #define rep(i, n) for (int i = 0; i < n; ++i)
| ^
a.cc:62:11: error: 'n' was not declared in this scope
62 | rep(i,n-1) a[i+1]-=memo;
| ^
a.cc:8:39: note: in definition of macro 'rep'
8 | #define rep(i, n) for (int i = 0; i < n; ++i)
| ^
a.cc:64:11: error: expected primary-expression before '<' token
64 | cout<<<50<endl;
| ^
a.cc:65:11: error: 'n' was not declared in this scope
65 | rep(i,n) cout<<a[i]<<" ";
| ^
a.cc:8:39: note: in definition of macro 'rep'
8 | #define rep(i, n) for (int i = 0; i < n; ++i)
| ^
|
s394765145 | p03646 | C++ | //#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) \
{ \
cout << x << ' '; \
} \
cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
if (a < b)
{
a = b;
return 1;
}
return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
if (b < a)
{
a = b;
return 1;
}
return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll n, k;
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
cin >> k;
n=50;
vector<ll> a(50,0);
int i=0;
while(k){
a[i]=min(pow(10,16)+1000/50,k);
k-=a[i];
i++;
}
cout<<n<<"\n";
rep(i,50)
cout << a[i] << " ";
cout<<"\n";
}
| a.cc: In function 'int main()':
a.cc:59:17: error: no matching function for call to 'min(__gnu_cxx::__promote<double>::__type, ll&)'
59 | a[i]=min(pow(10,16)+1000/50,k);
| ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:59:17: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'll' {aka 'long long int'})
59 | a[i]=min(pow(10,16)+1000/50,k);
| ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:59:17: note: mismatched types 'std::initializer_list<_Tp>' and 'double'
59 | a[i]=min(pow(10,16)+1000/50,k);
| ~~~^~~~~~~~~~~~~~~~~~~~~~
|
s439331075 | p03646 | C++ | #include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
ll k;
cin>>k;
ll n;
if(k>50) n=50;
else n=k;
ll d=k/n;
vll a(n,n-1+d);
ll cu=k%n;
ll i=0;
while(cu){
a[i]++;
i++;
cu--;
}
COUT(n);
rep(i,n){
cour<<a[i]<<" ";
}
}
| a.cc: In function 'int main()':
a.cc:59:5: error: 'cour' was not declared in this scope; did you mean 'cu'?
59 | cour<<a[i]<<" ";
| ^~~~
| cu
|
s728062022 | p03646 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0;i--)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor,int number,int degree){
if(floor==degree){
fspattern.at(fspcnt) = fspattern_draft;
fspcnt++;
}else{
rep(i,number){
fspattern_draft.at(floor) = i;
setfspattern_core(floor+1,number,degree);
}
}
}
void setfspattern(int number,int degree){
fspcnt = 0;
int64_t array_num = 1;
rep(i,degree){
array_num *= number;
}
fspattern = vector<vector<int>>(array_num,vector<int>(degree));
fspattern_draft = vector<int>(degree);
setfspattern_core(0,number,degree);
}
//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);
/*void setmodfact(){
for(int i=0;i<factnum;i++){
if(i == 0){
modfact.at(i) = 1;
}else{
modfact.at(i) = (modfact.at(i-1)*i)%univMod;
}
}
}
int64_t calcmodpower(int64_t a,int64_t n){
int64_t res = 1;
while(n != 0){
if(n & 1){
res = (res * a) % univMod;
}
a = (a*a) % univMod;
n = n >> 1;
}
return res;
}
int64_t calcinverse(int64_t n){
return calcmodpower(n,univMod-2);
}
void setmodinvfact(){
for(int i=0;i<factnum;i++){
if(i==0){
modinvfact.at(i) = 1;
}else{
modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
}
}
}*/
/*
int64_t calcGCD(int64_t a,int64_t b){
int64_t p = a;
int64_t q = b;
int64_t c = a%b;
while(c != 0){
p = q;
q = c;
c = p%q;
}
return q;
}
*/
bool cmp(pair<int64_t,int64_t> a,pair<int64_t,int64_t> b){
if(a.first != b.first){
return a.first < b.first;
}else{
return a.second > b.second;
}
}
int main(){
int64_t k;
cin >> k;
vector<int64_t> a(50);
rep(i,50){
a.at(i) = 49+(k/50);
if(i < k%50){
a.at(i) -= ((k%50)-1-50);
}else{
a.at(i) -= (k%50);
}
}
cout << 50 << endl;
rep(i,50){
cout << a.at(i) << " ";
}
cout << endl;
}#include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0;i--)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor,int number,int degree){
if(floor==degree){
fspattern.at(fspcnt) = fspattern_draft;
fspcnt++;
}else{
rep(i,number){
fspattern_draft.at(floor) = i;
setfspattern_core(floor+1,number,degree);
}
}
}
void setfspattern(int number,int degree){
fspcnt = 0;
int64_t array_num = 1;
rep(i,degree){
array_num *= number;
}
fspattern = vector<vector<int>>(array_num,vector<int>(degree));
fspattern_draft = vector<int>(degree);
setfspattern_core(0,number,degree);
}
//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);
/*void setmodfact(){
for(int i=0;i<factnum;i++){
if(i == 0){
modfact.at(i) = 1;
}else{
modfact.at(i) = (modfact.at(i-1)*i)%univMod;
}
}
}
int64_t calcmodpower(int64_t a,int64_t n){
int64_t res = 1;
while(n != 0){
if(n & 1){
res = (res * a) % univMod;
}
a = (a*a) % univMod;
n = n >> 1;
}
return res;
}
int64_t calcinverse(int64_t n){
return calcmodpower(n,univMod-2);
}
void setmodinvfact(){
for(int i=0;i<factnum;i++){
if(i==0){
modinvfact.at(i) = 1;
}else{
modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
}
}
}*/
/*
int64_t calcGCD(int64_t a,int64_t b){
int64_t p = a;
int64_t q = b;
int64_t c = a%b;
while(c != 0){
p = q;
q = c;
c = p%q;
}
return q;
}
*/
bool cmp(pair<int64_t,int64_t> a,pair<int64_t,int64_t> b){
if(a.first != b.first){
return a.first < b.first;
}else{
return a.second > b.second;
}
}
int main(){
int64_t k;
cin >> k;
vector<int64_t> a(50);
rep(i,50){
a.at(i) = 49+(k/50);
if(i < k%50){
a.at(i) -= ((k%50)-1-50);
}else{
a.at(i) -= (k%50);
}
}
cout << 50 << endl;
rep(i,50){
cout << a.at(i) << " ";
}
cout << endl;
} | a.cc:119:2: error: stray '#' in program
119 | }#include <bits/stdc++.h>
| ^
a.cc:119:3: error: 'include' does not name a type
119 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:125:21: error: redefinition of 'std::vector<std::vector<int> > fspattern'
125 | vector<vector<int>> fspattern;
| ^~~~~~~~~
a.cc:7:21: note: 'std::vector<std::vector<int> > fspattern' previously declared here
7 | vector<vector<int>> fspattern;
| ^~~~~~~~~
a.cc:126:13: error: redefinition of 'std::vector<int> fspattern_draft'
126 | vector<int> fspattern_draft;
| ^~~~~~~~~~~~~~~
a.cc:8:13: note: 'std::vector<int> fspattern_draft' previously declared here
8 | vector<int> fspattern_draft;
| ^~~~~~~~~~~~~~~
a.cc:127:5: error: redefinition of 'int fspcnt'
127 | int fspcnt = 0;
| ^~~~~~
a.cc:9:5: note: 'int fspcnt' previously defined here
9 | int fspcnt = 0;
| ^~~~~~
a.cc:129:6: error: redefinition of 'void setfspattern_core(int, int, int)'
129 | void setfspattern_core(int floor,int number,int degree){
| ^~~~~~~~~~~~~~~~~
a.cc:11:6: note: 'void setfspattern_core(int, int, int)' previously defined here
11 | void setfspattern_core(int floor,int number,int degree){
| ^~~~~~~~~~~~~~~~~
a.cc:141:6: error: redefinition of 'void setfspattern(int, int)'
141 | void setfspattern(int number,int degree){
| ^~~~~~~~~~~~
a.cc:23:6: note: 'void setfspattern(int, int)' previously defined here
23 | void setfspattern(int number,int degree){
| ^~~~~~~~~~~~
a.cc:208:6: error: redefinition of 'bool cmp(std::pair<long int, long int>, std::pair<long int, long int>)'
208 | bool cmp(pair<int64_t,int64_t> a,pair<int64_t,int64_t> b){
| ^~~
a.cc:90:6: note: 'bool cmp(std::pair<long int, long int>, std::pair<long int, long int>)' previously defined here
90 | bool cmp(pair<int64_t,int64_t> a,pair<int64_t,int64_t> b){
| ^~~
a.cc:217:5: error: redefinition of 'int main()'
217 | int main(){
| ^~~~
a.cc:99:5: note: 'int main()' previously defined here
99 | int main(){
| ^~~~
|
s469310742 | p03646 | C | #include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0;i--)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor,int number,int degree){
if(floor==degree){
fspattern.at(fspcnt) = fspattern_draft;
fspcnt++;
}else{
rep(i,number){
fspattern_draft.at(floor) = i;
setfspattern_core(floor+1,number,degree);
}
}
}
void setfspattern(int number,int degree){
fspcnt = 0;
int64_t array_num = 1;
rep(i,degree){
array_num *= number;
}
fspattern = vector<vector<int>>(array_num,vector<int>(degree));
fspattern_draft = vector<int>(degree);
setfspattern_core(0,number,degree);
}
//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);
/*void setmodfact(){
for(int i=0;i<factnum;i++){
if(i == 0){
modfact.at(i) = 1;
}else{
modfact.at(i) = (modfact.at(i-1)*i)%univMod;
}
}
}
int64_t calcmodpower(int64_t a,int64_t n){
int64_t res = 1;
while(n != 0){
if(n & 1){
res = (res * a) % univMod;
}
a = (a*a) % univMod;
n = n >> 1;
}
return res;
}
int64_t calcinverse(int64_t n){
return calcmodpower(n,univMod-2);
}
void setmodinvfact(){
for(int i=0;i<factnum;i++){
if(i==0){
modinvfact.at(i) = 1;
}else{
modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
}
}
}*/
/*
int64_t calcGCD(int64_t a,int64_t b){
int64_t p = a;
int64_t q = b;
int64_t c = a%b;
while(c != 0){
p = q;
q = c;
c = p%q;
}
return q;
}
*/
bool cmp(pair<int64_t,int64_t> a,pair<int64_t,int64_t> b){
if(a.first != b.first){
return a.first < b.first;
}else{
return a.second > b.second;
}
}
int main(){
int64_t k;
cin >> k;
vector<int64_t> a(50);
rep(i,50){
a.at(i) = 49+(k/50);
if(i < k%50){
a.at(i) -= ((k%50)-1-50);
}else{
a.at(i) -= (k%50);
}
}
cout << 50 << endl;
rep(i,50){
cout << a.at(i) << " ";
}
cout << endl;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s418379208 | p03646 | C | #include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0;i--)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor,int number,int degree){
if(floor==degree){
fspattern.at(fspcnt) = fspattern_draft;
fspcnt++;
}else{
rep(i,number){
fspattern_draft.at(floor) = i;
setfspattern_core(floor+1,number,degree);
}
}
}
void setfspattern(int number,int degree){
fspcnt = 0;
int64_t array_num = 1;
rep(i,degree){
array_num *= number;
}
fspattern = vector<vector<int>>(array_num,vector<int>(degree));
fspattern_draft = vector<int>(degree);
setfspattern_core(0,number,degree);
}
//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);
/*void setmodfact(){
for(int i=0;i<factnum;i++){
if(i == 0){
modfact.at(i) = 1;
}else{
modfact.at(i) = (modfact.at(i-1)*i)%univMod;
}
}
}
int64_t calcmodpower(int64_t a,int64_t n){
int64_t res = 1;
while(n != 0){
if(n & 1){
res = (res * a) % univMod;
}
a = (a*a) % univMod;
n = n >> 1;
}
return res;
}
int64_t calcinverse(int64_t n){
return calcmodpower(n,univMod-2);
}
void setmodinvfact(){
for(int i=0;i<factnum;i++){
if(i==0){
modinvfact.at(i) = 1;
}else{
modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
}
}
}*/
/*
int64_t calcGCD(int64_t a,int64_t b){
int64_t p = a;
int64_t q = b;
int64_t c = a%b;
while(c != 0){
p = q;
q = c;
c = p%q;
}
return q;
}
*/
bool cmp(pair<int64_t,int64_t> a,pair<int64_t,int64_t> b){
if(a.first != b.first){
return a.first < b.first;
}else{
return a.second > b.second;
}
}
int main(){
int64_t k;
cin >> k;
vector<int64_t> a(50);
rep(i,50){
a.at(i) = 49+(k/50);
if(i < k%50){
a.at(i) -= ((k%50)-1-50);
}else{
a.at(i) -= (k%50);
}
}
cout << 50 << endl;
rep(i,50){
cout << a.at(i) << " ";
}
cout << endl;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s731993580 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=(a); i<(b); ++i)
#define per(i,a,b) for(int i=(b)-1; i>=(a); --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define S second
int main(void) {
//freopen("in.txt", "r", stdin);
ll k;
cin >> k;
int n = 50;
vl ret(n);
rep(i,0,n) {
ret[i] = i;
}
ll x = k / n;
ll y = k % n;
rep(i,0,n) {
ret[i] += x
}
rep(i,0,y) {
ret[i] += (ll)n;
ret[i] -= y-1;
}
rep(i,y,n) {
ret[i] -= y;
}
cout << n << '\n';
rep(i,0,n) {
cout << ret[i] << ' ';
}
cout << '\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:29:28: error: expected ';' before '}' token
29 | ret[i] += x
| ^
| ;
30 | }
| ~
|
s248120105 | p03646 | C++ | #include "bits/stdc++.h"
#define rep(i,n) for(ll i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define ll long long
#define vl vector<long long>
#define vll vector<vector<long long>>
ll count(ll num1,ll num2){
if(num1>num2)swap(num1,num2);
ll k1;
if((num2-num1)%3==0){
k1=(num2-num1)/3;
}else{
k1=(num2-num1)/3;
for(ll dif=-2;dif<3;dif++){
if(num2-2*(k1+dif)<=k1+dif+num1){
k1+=dif;
break;
}
}
}
if(k1<0)return -1;
ll k2;
if(k1+num1==num2-2*k1){
k2=2*k1-2;
}else{
k2=num1+num2-k1-1;
}
//cout<<k1<<" "<<k2<<" "<<k1+k2<<" "<<num1+num2<<endl;
return k1+k2;
}
int main(void){
ll k;
cin >> k ;
//t-2*k1<=k1 t<=3*k1
/*
if(t-k1 %2==1){
k2=t-k1-1;
}else{
k2=t-k1-2;
}
*/
if(k>100000000000000){
vi a(2);
a[1000]=1;
}
ll ans=k+500;
ll ans1,ans2;
int flag2=0;
rep(i,1000){
ll c=count(0,ans-i);
if(c<0)continue;
if(c==k){
ans-=i;
//cout<<k1<<" "<<k2<<endl;
break;
}
if(c<k){
ll i2=i-1;
flag2=1;
rep(j,10000){
ll num1=j;
ll num2=ans-i-j;
ll c2=count(num1,num2);
if(c2==k){
ans1=num1;
ans2=num2;
break;
}
}
ans-=i;
break;
}
}
cout<<2<<endl;
if(flag2==0){
cout<<flag2<<" "<<ans<<endl;
}else{
cout<<ans1<<" "<<ans2<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:48:4: error: 'vi' was not declared in this scope; did you mean 'vl'?
48 | vi a(2);
| ^~
| vl
a.cc:49:4: error: 'a' was not declared in this scope
49 | a[1000]=1;
| ^
|
s715469838 | p03646 | C++ | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define bFor(i,a,b) for(i=a;i>=b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define mod 1000000007
#define endl "\n"
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}while(0)
long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}
ll modinv(ll a) {
ll b=mod,u=1,v=0,t;
while(b){
t=a/b;
a-=t*b; swap(a,b);
u-=t*v; swap(u,v);
}
return (u+mod)%mod;
}
ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}
ll modncr(ll n,ll r){
ll i,plus=1;
rep(i,r){
plus=(plus*(n-i))%mod;
plus=moddevide(plus,i+1);
}
return plus;
}
ll modncrlistp[200000],modncrlistm[200000];
ll modncrs(ll n,ll r){
ll i,j;
if(modncrlistp[n]==0){
for(i=n;i>=0;i--){
if(modncrlistp[i])break;
}
if(i<0){
modncrlistp[0]=1;
rep1(i,n+1){
modncrlistp[i]=(modncrlistp[i-1]*i)%mod;
}
}else{
For(j,i+1,n+1){
modncrlistp[j]=(modncrlistp[j-1]*j)%mod;
}
}
}
if(modncrlistm[n]==0){
for(i=n;i>=0;i--){
if(modncrlistm[i])break;
}
if(i<0){
modncrlistm[0]=1;
rep1(i,n+1){
modncrlistm[i]=(modncrlistm[i-1]*modinv(i))%mod;
}
}else{
For(j,i+1,n+1)modncrlistm[j]=(modncrlistm[j-1]*modinv(j))%mod;
}
}
return (((modncrlistp[n]*modncrlistm[r])%mod)*modncrlistm[n-r])%mod;
}
ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll countdigits(ll n){
ll ans=0;
while(n){n/=10;ans++;}
return ans;
}
ll sumdigits(ll n){
ll ans=0;
while(n){ans+=n%10;n/=10;}
return ans;
}
vec eratosthenes(ll N){
ll i;
vec ch(N+1,1),p;
ch[0]=ch[1]=0;
rep(i,N+1){
if(ch[i]){
p.push_back(i);
for(ll j=2;i*j<=N;j++){
ch[i*j]=0;
}
}
}
return ch;
}
int main(){
ll i,j,N=50,K;
cin>>K;
cout<<N<<endl;
ll x=K/N,y=K%N;
vec ans(N);
rep(i,N){
ans[i]=i+x;
}
rep(i,y){
ans[i]+=N+1;
rep(j,n){
ans[j]--;
}
}
output(ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:121:11: error: 'n' was not declared in this scope
121 | rep(j,n){
| ^
a.cc:11:30: note: in definition of macro 'For'
11 | #define For(i,a,b) for(i=a;i<b;i++)
| ^
a.cc:121:5: note: in expansion of macro 'rep'
121 | rep(j,n){
| ^~~
|
s661688864 | p03646 | C++ | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define bFor(i,a,b) for(i=a;i>=b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define mod 1000000007
#define endl "\n"
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}while(0)
long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}
ll modinv(ll a) {
ll b=mod,u=1,v=0,t;
while(b){
t=a/b;
a-=t*b; swap(a,b);
u-=t*v; swap(u,v);
}
return (u+mod)%mod;
}
ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}
ll modncr(ll n,ll r){
ll i,plus=1;
rep(i,r){
plus=(plus*(n-i))%mod;
plus=moddevide(plus,i+1);
}
return plus;
}
ll modncrlistp[200000],modncrlistm[200000];
ll modncrs(ll n,ll r){
ll i,j;
if(modncrlistp[n]==0){
for(i=n;i>=0;i--){
if(modncrlistp[i])break;
}
if(i<0){
modncrlistp[0]=1;
rep1(i,n+1){
modncrlistp[i]=(modncrlistp[i-1]*i)%mod;
}
}else{
For(j,i+1,n+1){
modncrlistp[j]=(modncrlistp[j-1]*j)%mod;
}
}
}
if(modncrlistm[n]==0){
for(i=n;i>=0;i--){
if(modncrlistm[i])break;
}
if(i<0){
modncrlistm[0]=1;
rep1(i,n+1){
modncrlistm[i]=(modncrlistm[i-1]*modinv(i))%mod;
}
}else{
For(j,i+1,n+1)modncrlistm[j]=(modncrlistm[j-1]*modinv(j))%mod;
}
}
return (((modncrlistp[n]*modncrlistm[r])%mod)*modncrlistm[n-r])%mod;
}
ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll countdigits(ll n){
ll ans=0;
while(n){n/=10;ans++;}
return ans;
}
ll sumdigits(ll n){
ll ans=0;
while(n){ans+=n%10;n/=10;}
return ans;
}
vec eratosthenes(ll N){
ll i;
vec ch(N+1,1),p;
ch[0]=ch[1]=0;
rep(i,N+1){
if(ch[i]){
p.push_back(i);
for(ll j=2;i*j<=N;j++){
ch[i*j]=0;
}
}
}
return ch;
}
int main(){
ll i,N,K,M=pow(10,16);
cin>>K;
N=max(2LL,(K+M-1)/M);
cout<<N<<endl;
if(N==2){
if(K%2){
cout<<(K+3)/2<<" "<<(K-1)/2<<endl;
}else{
cout<<K/2+1<<" "<<K/2+1<<endl;
}
return 0;
}
ll x=K/N,y=K%N;
vec ans(N,(x+1)*(N-1));
rep(i,y)
ans[i]+=N;
ans[i+1]--;
}
output(ans);
return 0;
} | a.cc:22:19: error: expected unqualified-id before 'do'
22 | #define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}while(0)
| ^~
a.cc:129:3: note: in expansion of macro 'output'
129 | output(ans);
| ^~~~~~
a.cc:22:82: error: expected unqualified-id before 'while'
22 | #define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}while(0)
| ^~~~~
a.cc:129:3: note: in expansion of macro 'output'
129 | output(ans);
| ^~~~~~
a.cc:130:3: error: expected unqualified-id before 'return'
130 | return 0;
| ^~~~~~
a.cc:131:1: error: expected declaration before '}' token
131 | }
| ^
|
s285306963 | p03646 | C++ | 4#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>
#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef int64_t ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tupiii;
typedef tuple<ll, ll, ll> tuplll;
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
void SWAP(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
void SWAP(int& a, int& b) { a ^= b; b ^= a; a ^= b; }
class D {
ll k;
const ll n{ 50 };
public:
D()
{
cin >> k;
}
void solve()
{
vll ans(50, 0);
ll r{ k % 50 };
if (!r)
{
r = 50;
}
REP(i, r)
{
ans[i] = (ll)50 - i;
}
REP(i, n)
ans[i] += (k - r) / 50;
cout << n << endl;
REP(i, n - 1)
cout << ans[i] << " ";
cout << ans[n - 1] << endl;
}
};
int main()
{
D solution;
solution.solve();
return 0;
} | a.cc:1:2: error: stray '#' in program
1 | 4#include <algorithm>
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4#include <algorithm>
| ^
In file included from /usr/include/c++/14/cmath:45,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/stdlib.h:32,
from /usr/include/c++/14/bits/std_abs.h:38,
from /usr/include/c++/14/cmath:49:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type
125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
+++ |+#include <cstddef>
1 | // Types used in iterator implementation -*- C++ -*-
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type
214 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type
225 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_algobase.h:66:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type
112 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
65 | #include <debug/assertions.h>
+++ |+#include <cstddef>
66 | #include <bits/stl_iterator_base_types.h>
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type
118 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_iterator.h: |
s180262101 | p03646 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
bool prime_(int n){
if(n==1){
return false;
}else if(n==2){
return true;
}else{
for(int i=2;i<=sqrt(n);i++){
if(n%i==0){
return false;
}
}
return true;
}
}
long long gcd_(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
return b;
}else{
return gcd_(b,a%b);
}
}
long long lcm_(long long x, long long y){
return (x/gcd_(x,y))*y;
}
class UnionFind {
public:
//各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
vector<int> Parent;
//クラスを作るときは、Parentの値を全て-1にする。
//以下のようにすると全てバラバラの頂点として解釈できる。
UnionFind(int N) {
Parent = vector<int>(N, -1);
}
//Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0) return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)];//先祖をrootで取っておきたい。
}
//AとBをくっ付ける
bool connect(int A, int B) {
//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらAとBをひっくり返す。
if (size(A) < size(B)) swap(A, B);
//Aのサイズを更新する
Parent[A] += Parent[B];
//Bの親をAに変更する
Parent[B] = A;
return true;
}
};
int main(){
long long k;
long long n = 50;
vector<long long> ans(n);
REP(i,n){
ans[i] = i;
}
long long loop = k/n;
long long rest = k%n;
REP(i,n){
ans[i] += loop;
}
REP(i,rest){
ans[i] += n;
ans[i] -= rest-1;
}
for(int i=rest;i<n;i++){
ans[i] -= rest;
}
cout<<n<<endl;
REP(i,n){
cout<<a[i]<<' ';
}
cout<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:112:11: error: 'a' was not declared in this scope
112 | cout<<a[i]<<' ';
| ^
|
s163671641 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll K;
cin >> K;
ll N = 50;
vector<ll> A(N);
for (int i = 0; i < N; i++)
A[i] = 49 + K / N;
K = K % N;
for (int i = 0; i < K; i++) {
A[i] += N + 1;
for (int j = 0; j < N; j++)
A[j]--;
}
cout << N << '\n';
for (int i = 0; i < N; i++)
cout << A[i] << (i == N - 1 ? '\n' : " ");
return 0;
}
| a.cc: In function 'int main()':
a.cc:23:33: error: operands to '?:' have different types 'char' and 'const char*'
23 | cout << A[i] << (i == N - 1 ? '\n' : " ");
| ~~~~~~~~~~~^~~~~~~~~~~~
|
s177960297 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll K;cin>>K;
int r=K%50, q=K/50;
ll a(50);
for (int i=0;i<50;++i){
if (i<r-1){a[i]=50+q;}else{
a[i]=q;
}
}
cout << 50 << endl;
for (int i=0;i<50;++i){
cout << a[i] << ' ';
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:17: error: invalid types 'll {aka long long int}[int]' for array subscript
11 | if (i<r-1){a[i]=50+q;}else{
| ^
a.cc:12:8: error: invalid types 'll {aka long long int}[int]' for array subscript
12 | a[i]=q;
| ^
a.cc:17:14: error: invalid types 'll {aka long long int}[int]' for array subscript
17 | cout << a[i] << ' ';
| ^
|
s211877362 | p03646 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
return b;
}else{
return gcd(b,a%b);
}
}
long long lcm(long long x, long long y){
return (x/gcd(x,y))*y;
}
class UnionFind {
public:
//各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
vector<int> Parent;
//クラスを作るときは、Parentの値を全て-1にする。
//以下のようにすると全てバラバラの頂点として解釈できる。
UnionFind(int N) {
Parent = vector<int>(N, -1);
}
//Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0) return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)];//先祖をrootで取っておきたい。
}
//AとBをくっ付ける
bool connect(int A, int B) {
//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらAとBをひっくり返す。
if (size(A) < size(B)) swap(A, B);
//Aのサイズを更新する
Parent[A] += Parent[B];
//Bの親をAに変更する
Parent[B] = A;
return true;
}
};
int main(){
long long k;
cin>>k
return 0;
} | a.cc: In function 'int main()':
a.cc:73:9: error: expected ';' before 'return'
73 | cin>>k
| ^
| ;
74 |
75 | return 0;
| ~~~~~~
|
s909186441 | p03646 | C++ | #include <iostream>
using namespamce std;
int main(){
cout<< "POSSIBLE" << endl;
return 0;
} | a.cc:2:7: error: expected nested-name-specifier before 'namespamce'
2 | using namespamce std;
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
4 | cout<< "POSSIBLE" << endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:4:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
4 | cout<< "POSSIBLE" << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s753506136 | p03646 | C++ | #include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;
// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;
// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr<<#x<<":"<< (x);BR;
// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)
signed main() {
INIT;
VAR(int, k);
int p = k / 50, q = k % 50;
vector< int > ans(50, n + p);
REP(i, q) {
ans[i] += 51;
}
OUT(50)BR;
REP(i, 50) {
OUT(ans[i]);
if (i < 49) SP
else BR
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:40:31: error: 'n' was not declared in this scope
40 | vector< int > ans(50, n + p);
| ^
|
s688161923 | p03646 | C++ | n=int(input())+1
a=["0"]*n
a[0]=str(n**2-1)
print(n)
print("".join(a)) | a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())+1
| ^
|
s590579141 | p03646 | C++ | #include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
int main()
{
ll a[51],K,k,mo,d;
REP(i,50){
a[i] = i;
}
cin >> K;
d = K/50;
mo = K % 50;
REP(i,50){
a[i] += d;
}
REP(i,mo){
a[49-i] += 1;
}
cin << 50 << endl;
REP(i,50)
cout << a[i] << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:32:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
32 | cin << 50 << endl;
| ~~~ ^~ ~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:32:7: note: candidate: 'operator<<(int, int)' (built-in)
32 | cin << 50 << endl;
| ~~~~^~~~~
a.cc:32:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/deque:81,
from /usr/include/c++/14/queue:62,
from a.cc:2:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:32:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
32 | cin << 50 << endl;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:8:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
32 | cin << 50 << endl;
| ^~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
32 | cin << 50 << endl;
| ^~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:32:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:32:10: required from here
32 | cin << 50 << endl;
| ^~
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
|
s082310261 | p03646 | C++ | #include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
int main()
{
ll a[51],K,k,mo;
REP(i,50){
a[i] = i;
}
cin >> K;
d = K/50;
mo = K % 50;
REP(i,50){
a[i] += d;
}
REP(i,mo){
a[49-i] += 1;
}
REP(i,50)
cout << a[i] << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:24:3: error: 'd' was not declared in this scope
24 | d = K/50;
| ^
|
s612839094 | p03646 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
//#define ll long long
const int INF=1000000007;
ll k;
ll n;
ll t[100];
int main(){
cin>>k;
if(k>=50)n=50;
else n=k;
if(k==0)n=1;
rep(i,n)t[i]=(k/n)+(n-1);
rep(i,(k%n))t[i]--;
cout<<n<<endl;
rep(i,n){cout<<t[i];if(i!=n-1)cout<<" ";}
cout<<endl;
return 0;
}
| a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:19:1: note: in expansion of macro 'll'
19 | ll k;
| ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:20:1: note: in expansion of macro 'll'
20 | ll n;
| ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:21:1: note: in expansion of macro 'll'
21 | ll t[100];
| ^~
a.cc: In function 'int main()':
a.cc:24:14: error: 'k' was not declared in this scope
24 | cin>>k;
| ^
a.cc:25:18: error: 'n' was not declared in this scope
25 | if(k>=50)n=50;
| ^
a.cc:26:14: error: 'n' was not declared in this scope
26 | else n=k;
| ^
a.cc:27:17: error: 'n' was not declared in this scope
27 | if(k==0)n=1;
| ^
a.cc:29:15: error: 'n' was not declared in this scope
29 | rep(i,n)t[i]=(k/n)+(n-1);
| ^
a.cc:12:32: note: in definition of macro 'rep'
12 | #define rep(i,a) for(int i=0;i<a;i++)
| ^
a.cc:29:17: error: 't' was not declared in this scope
29 | rep(i,n)t[i]=(k/n)+(n-1);
| ^
a.cc:30:18: error: 'n' was not declared in this scope
30 | rep(i,(k%n))t[i]--;
| ^
a.cc:12:32: note: in definition of macro 'rep'
12 | #define rep(i,a) for(int i=0;i<a;i++)
| ^
a.cc:30:21: error: 't' was not declared in this scope
30 | rep(i,(k%n))t[i]--;
| ^
a.cc:32:15: error: 'n' was not declared in this scope
32 | cout<<n<<endl;
| ^
a.cc:33:24: error: 't' was not declared in this scope
33 | rep(i,n){cout<<t[i];if(i!=n-1)cout<<" ";}
| ^
|
s004880387 | p03646 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<iomanip>
#include<utility>
#include<cmath>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<map>
#include<set>
#include<cstring>
#include<iterator>
#include<bitset>
#include<assert.h>
using namespace std;
#define int ll
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,pair<int,int> > PP;
typedef vector<int> VI;
typedef vector<long long int> VL;
static const int MOD = 1000000007;
static const int INF = 2147483647;
//static const long long INF = 9223372000000000000;
//static const long long INF = 9223372000000000000/2;
//static const int INF = 1000010000;
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define FI first
#define SE second
#define NP next_permutation
#define PQ priority_queue
#define UB upper_bound
#define LB lower_bound
#define ALL(x) (x).begin(),(x).end()
#define SZ(a) int((a).size())
#define LEN(a) int((a).length())
#define MAX(a,b,c) max((a),max((b),(c)))
#define MIN(a,b,c) min((a),min((b),(c)))
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REP1(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREP1(i,x) for(int i=((int)(x));i>0;i--)
//struct edge {int to,cost;};
signed main(){
int k;
cin >> k;
if(k<=50){
printf("%lld\n",k);
REP1(i,k) printf("%lld ",i);
puts("");
} else {
int a = k/50;
int b = k%50;
int ans[51]={};
REP(i,50) ans[i] = i+1;
REP(i,50) ans[i] += a;
for(int i=50-b;i<50;i++) ans[i]++;
puts("50");
REP(i,50) printf("%lld ",ans[i]);
puts("")
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:77:17: error: expected ';' before '}' token
77 | puts("")
| ^
| ;
78 | }
| ~
|
s216252328 | p03646 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main()
{
unsigned long long K;
cin >> K;
long long N = 50;
vector<long long> numVec;
for (int i = 0; i < N; i++)
{
numVec.push_back(i + N * K / N);
}
for (int count = 0; count < N % K; count++)
{
for (int i = 0; i < N i++)
{
if (i == count)
{
numVec[i] += N;
}
else
{
numVec[i]--;
}
}
}
cout << N << endl;
for (int i = 0; i < N; i++)
{
if (i)
cout << " ";
cout << numVec[i];
}
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:21:30: error: expected ';' before 'i'
21 | for (int i = 0; i < N i++)
| ^~
| ;
|
s123263166 | p03646 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main()
{
unsigned long long K;
cin >> K;
long long N = 50;
vector<long long> numVec;
for (int i = 0; i < N; i++)
{
numVec.push_back(i + N * K / N);
}
for (int i = 0; i < N % K; i++)
{
if (i == count)
{
numVec[i] += N;
}
else
{
numVec[i]--;
}
}
cout << N << endl;
for (int i = 0; i < N; i++)
{
if (i)
cout << " ";
cout << numVec[i];
}
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:21:18: error: 'count' was not declared in this scope
21 | if (i == count)
| ^~~~~
|
s601360723 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
int in() { int x; scanf("%d", &x); return x; }
template<typename T> void pv(T a, T b) { for (T i = a; i < b; i++) cout << *i << ' '; cout << endl; }
template<typename T, typename U> void chmin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> void chmax(T &x, U y) { if (x < y) x = y; }
using ll = long long;
int main() {
ll K;
cin >> K;
puts("2");
cout << K + 1 << ' ' 1 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:23: error: expected ';' before numeric constant
20 | cout << K + 1 << ' ' 1 << endl;
| ^~
| ;
|
s934397689 | p03646 | C++ | #include <bits/stdc++.h>
#define maxs 2020202
#define mme(i,j) memset(i,j,sizeof(i))
using namespace std;
int main(){
__int64 k;
while(~scanf("%I64d",&k)){
if(k==0){
printf("4\n3 3 3 3\n");
continue;
}
printf("2\n");
printf("0 %I64d\n",2*k+1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:4: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
7 | __int64 k;
| ^~~~~~~
| __ynf64
a.cc:8:27: error: 'k' was not declared in this scope
8 | while(~scanf("%I64d",&k)){
| ^
|
s594396212 | p03646 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main() {
int K, N = 4;
int a[4] = { 0,1,2,3 };
int div, rem;
cin >> K;
rem = K % 4;
div = K / 4;
if (rem == 0) {
a[0] += div; a[1] += div;
a[2] += div; a[3] += div;
}
if (rem == 1) {
a[0] = div + N; a[1] = div;
a[2] = div + 1; a[3] = div + 2;
}
if (rem == 2) {
a[0] = 3 + div; a[1] = N + div;
a[2] = div; a[3] = 1 + div;
}
if (rem == 3) {
a[0] = 2 + div; a[1] = 3 + div;
a[2] = N + div; a[3] = div;
}
cout << N << endl;
cout << a[0] << ' ' << a[1] << ' ' << a[2] << ' ' << a[3] << endl:
return 0;
} | a.cc: In function 'int main()':
a.cc:33:82: error: expected ';' before ':' token
33 | cout << a[0] << ' ' << a[1] << ' ' << a[2] << ' ' << a[3] << endl:
| ^
| ;
|
s124291458 | p03646 | C++ | #include<iostream>
using namespace std;
#include<queue>
#include<cstdio>
#include<hash_map>
#include<map>
#include<set>
typedef long long LL;
queue<LL> team;
inline LL getint()
{
LL w = 0, q = 0;
char c = getchar();
while ((c<'0' || c>'9') && c != '-') c = getchar();
if (c == '-') q = 1, c = getchar();
while (c >= '0'&&c <= '9') w = w * 10 + c - '0', c = getchar();
return q ? -w : w;
}
struct data
{
LL sj;
LL bh;
bool operator<(const data &b)const
{
if (this->sj == b.sj) return this->bh>b.bh;
return this->sj<b.sj;
}
};
set<struct data> preset;
hash_map<LL, LL> maps;
int n, k;
int main()
{
set<struct data>::iterator pt;
int rq = 0;
//cin>>n>>k;
n = getint();
k = getint();
LL pre;
int ml;
LL dx;
struct data mx;
for (int i = 1; i <= n; i++)
{
//scanf("%d",&ml);
ml = getint();
if (ml == 1)
{
dx = getint();
// scanf("%lld",&dx);
struct data np;
np.bh = dx; np.sj = maps[dx];
preset.erase(np);
maps[dx]++;
np.sj = maps[dx];
preset.insert(np);
team.push(dx);
if (team.size() == k + 1)
{
pre = team.front();
np.bh = pre; np.sj = maps[pre];
preset.erase(np);
team.pop();
maps[pre]--;
if (maps[pre] == 0) continue;
np.sj = maps[pre];
preset.insert(np);
}
}
if (ml == 2)
{
pt = preset.end();
--pt;
int bh = (*pt).bh;
// cout<<bh<<endl;
printf("%d\n", bh);
}
}
return 0;
}
| In file included from /usr/include/c++/14/backward/hash_map:60,
from a.cc:5:
/usr/include/c++/14/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
32 | #warning \
| ^~~~~~~
a.cc:30:1: error: 'hash_map' does not name a type
30 | hash_map<LL, LL> maps;
| ^~~~~~~~
a.cc: In function 'int main()':
a.cc:52:45: error: 'maps' was not declared in this scope
52 | np.bh = dx; np.sj = maps[dx];
| ^~~~
|
s370867676 | p03646 | C++ | #include<cstdio>
using namespace std;
typedef long long ll;
ll n=50;
int main()
{
ll k;
scanf("%lld",&k);
printf("50\n");
while(n--)
{
printf("%lld",49-i+((49-i+k)/50));
if(n)
printf(" ");
else
printf("\n");
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:26: error: 'i' was not declared in this scope
12 | printf("%lld",49-i+((49-i+k)/50));
| ^
|
s428675042 | p03646 | C | #include<stdio.h>
int four(int k){
k=k+4;
return k;
}
int one(int k){
k=k-1;
return k;
}
int main(void){
long long int k;
scanf("%lld",&k);
printf("4\n");
long longint a[4]={0,1,2,3},i,n,m;
n=k/4;
m=k%4;
if(m==0){
a[0]=0+n;
a[1]=1+n;
a[2]=2+n;
a[3]=3+n;
}
if(m==1){
a[0]=4+n;
a[1]=0+n;
a[2]=1+n;
a[3]=2+n;
}
if(m==2){
a[0]=3+n;
a[1]=4+n;
a[2]=0+n;
a[3]=1+n;
}
if(m==3){
a[0]=2+n;
a[1]=3+n;
a[2]=4+n;
a[3]=0+n;
}
printf("%lld %lld %lld %lld\n",a[0],a[1],a[2],a[3]);
return 0;
} | main.c: In function 'main':
main.c:14:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
14 | long longint a[4]={0,1,2,3},i,n,m;
| ^
main.c:14:14: error: 'a' undeclared (first use in this function)
main.c:14:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:19: error: expected expression before '{' token
14 | long longint a[4]={0,1,2,3},i,n,m;
| ^
main.c:15:1: error: 'n' undeclared (first use in this function)
15 | n=k/4;
| ^
main.c:16:1: error: 'm' undeclared (first use in this function)
16 | m=k%4;
| ^
|
s281629284 | p03646 | C | #include<stdio.h>
int four(int k){
k=k+4;
return k;
}
int one(int k){
k=k-1;
return k;
}
int main(void){
long long int k;
scanf("%lld",&k);
printf("4\n");
int a[4]={0,1,2,3},i,n,m;
n=k/4;
m=k%4;
if(m==0){
a[0]=0+n
a[1]=1+n
a[2]=2+n
a[3]=3+n
}
if(m==1){
a[0]=4+n
a[1]=0+n
a[2]=1+n
a[3]=2+n
}
if(m==2){
a[0]=3+n
a[1]=4+n
a[2]=2+n
a[3]=1+n
}
if(m==3){
a[0]=2+n
a[1]=3+n
a[2]=1+n
a[3]=5+n
}
printf("%d %d %d %d\n",a[0],a[1],a[2],a[3]);
return 0;
} | main.c: In function 'main':
main.c:18:9: error: expected ';' before 'a'
18 | a[0]=0+n
| ^
| ;
19 | a[1]=1+n
| ~
main.c:24:9: error: expected ';' before 'a'
24 | a[0]=4+n
| ^
| ;
25 | a[1]=0+n
| ~
main.c:30:9: error: expected ';' before 'a'
30 | a[0]=3+n
| ^
| ;
31 | a[1]=4+n
| ~
main.c:36:9: error: expected ';' before 'a'
36 | a[0]=2+n
| ^
| ;
37 | a[1]=3+n
| ~
|
s265262346 | p03646 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
int main (){
ll k,a,b;
cin >> k;
a=k/3+2;
b=k%3;
ll d1[]={-1,-1,3};
ll d2[]={-2,2,2};
cout<<"3"<<endl;
if(b==0){
for(ll i=0;i<3;i++){
if(i==0)
cout<<a;
else
cout<<" "<<a-i;
}
cout<<endl;
}
if(b==1){
for(ll i=0;i<3;i++){
if(i==0)
cout<<a+d1[i];
else
cout<<" "<<a-i+d1[i];
}
cout<<endl;
}
if(b==2){
for(ll i=0;i<3;i++){
if(i==0)
cout<<a+d2[i];
else
cout<<" "<<a-i+d2[i];
}
cout<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:12: error: narrowing conversion of '-1' from 'int' to 'll' {aka 'long long unsigned int'} [-Wnarrowing]
9 | ll d1[]={-1,-1,3};
| ^~
a.cc:9:15: error: narrowing conversion of '-1' from 'int' to 'll' {aka 'long long unsigned int'} [-Wnarrowing]
9 | ll d1[]={-1,-1,3};
| ^~
a.cc:10:12: error: narrowing conversion of '-2' from 'int' to 'll' {aka 'long long unsigned int'} [-Wnarrowing]
10 | ll d2[]={-2,2,2};
| ^~
|
s228409348 | p03646 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll main (){
ll k,a,b;
cin >> k;
a=k/3+2;
b=k%3;
ll d1[]={-1,-1,3};
ll d2[]={-2,2,2};
cout<<"3"<<endl;
if(b==0){
for(ll i=0;i<3;i++){
if(i==0)
cout<<a;
else
cout<<" "<<a-i;
}
cout<<endl;
}
if(b==1){
for(ll i=0;i<3;i++){
if(i==0)
cout<<a+d1[i];
else
cout<<" "<<a-i+d1[i];
}
cout<<endl;
}
if(b==2){
for(ll i=0;i<3;i++){
if(i==0)
cout<<a+d2[i];
else
cout<<" "<<a-i+d2[i];
}
cout<<endl;
}
return 0;
}
| a.cc:4:1: error: '::main' must return 'int'
4 | ll main (){
| ^~
|
s096596626 | p03646 | C++ | 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s583275186 | p03646 | C++ | #include <bits/stdc++.h>
using namespace std;
long long k, x[50];
int main() {
scanf("%lld", &k);
printf("50\n");
for (int i = 0; i < 50; i++)
x[i] = 50 + k / 50;
for (int i = 0; i < (50 - k % 50); i++)
for (int j = 0; j < 50; j++)
if (i == j)
x[j] -= 50;
else
x[j]++;
for (int i = 0; i < 50; i++)
printf("%lld%c", x[i], i == 49 ? '\n' : ' ');
return 0;
}
Submission | a.cc:22:1: error: 'Submission' does not name a type
22 | Submission
| ^~~~~~~~~~
|
s751122618 | p03646 | C++ | #include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <cstring>
#include <map>
#include <vector>
#include <cmath>
#include <bitset>
#include <set>
#include <complex>
#include <queue>
#include <stack>
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;
const ld pi = acos(-1.0);
const ld e = exp(1.0);
const int N = 50;
ll k;
ll a[N];
void invstep(){
ll* x = min_element(a, a+N);
(*x) = (*x) + N;
for(int i =0; i<N; i++) if(a+i != x) a[i]--;
}
int main(){
cin >> k;
for(int i=0; i<N; i++) a[i] = i;
for(int i=0; i<N; i++) a[i] += (k/N);
for(int i=0; i<k%N; i++) invstep();
printf("%d\n", N)
for(int i=0; i<N; i++){
printf("%lld", a[i]);
if(i<N-1) printf(" ");
}
printf("\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:43:26: error: expected ';' before 'for'
43 | printf("%d\n", N)
| ^
| ;
44 | for(int i=0; i<N; i++){
| ~~~
a.cc:44:22: error: 'i' was not declared in this scope; did you mean 'pi'?
44 | for(int i=0; i<N; i++){
| ^
| pi
|
s253943776 | p03646 | Java | import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigDecimal;
public class CB68D {
public static void main (String[] args) throws java.lang.Exception {
InputReader in = new InputReader(System.in);
PrintWriter w = new PrintWriter(System.out);
int n = 50;
long k = in.nextLong();
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = i ;
}
for (int i = 0; i < n; i++)
a[i] += k / n;
for (int i = 0; i < k % n; i++) {
a[i] += n + 1;
for (int j = 0; j < n; j++)
a[j]--;
}
for (long x : a)
w.print(x + " ");
w.close();
}
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int read() {
if (numChars == -1)
throw new UnknownError();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new UnknownError();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public int peek() {
if (numChars == -1)
return -1;
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
return -1;
}
if (numChars <= 0)
return -1;
}
return buf[curChar];
}
public void skip(int x) {
while (x-- > 0)
read();
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public String nextString() {
return next();
}
public String next() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuffer res = new StringBuffer();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
public String nextLine() {
StringBuffer buf = new StringBuffer();
int c = read();
while (c != '\n' && c != -1) {
if (c != '\r')
buf.appendCodePoint(c);
c = read();
}
return buf.toString();
}
public double nextDouble() {
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
double res = 0;
while (!isSpaceChar(c) && c != '.') {
if (c == 'e' || c == 'E')
return res * Math.pow(10, nextInt());
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
}
if (c == '.') {
c = read();
double m = 1;
while (!isSpaceChar(c)) {
if (c == 'e' || c == 'E')
return res * Math.pow(10, nextInt());
if (c < '0' || c > '9')
throw new InputMismatchException();
m /= 10;
res += (c - '0') * m;
c = read();
}
}
return res * sgn;
}
public int[] nextIntArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = nextInt();
return a;
}
public long[] nextLongArray(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++)
a[i] = nextLong();
return a;
}
public boolean hasNext() {
int value;
while (isSpaceChar(value = peek()) && value != -1)
read();
return value != -1;
}
private boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
}
} | Main.java:6: error: class CB68D is public, should be declared in a file named CB68D.java
public class CB68D {
^
1 error
|
s629423468 | p03646 | C++ | #include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <string>
#include <map>
#include <unordered_map>
#include <queue>
#include <functional>
using namespace std;
typedef long long ll;
ll k;
ll res[51];
int main() {
cin >> k;
ll n = 50;
for (ll i = 0; i < n; i++) res[i] = i;
for (ll i = 0; i < k%n; i++) {
for (ll j = 0; j < n; j++) {
if (i == j) res[j] += n;
else res[j] -= 1;
}
}
cout << n << endl;
for (ll i = 0; i < n; i++) {
cout << res[i];
if (i != n - 1) cout << " ";
}
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:9: error: 'cin' was not declared in this scope
19 | cin >> k;
| ^~~
a.cc:11:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
10 | #include <functional>
+++ |+#include <iostream>
11 | using namespace std;
a.cc:28:9: error: 'cout' was not declared in this scope
28 | cout << n << endl;
| ^~~~
a.cc:28:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:22: error: 'endl' was not declared in this scope
28 | cout << n << endl;
| ^~~~
a.cc:11:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
10 | #include <functional>
+++ |+#include <ostream>
11 | using namespace std;
|
s465606610 | p03646 | C++ | #include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define ll long long int
ll a[55];
int main()
{
ll n;
while(~scanf("%lld",&n))
{
for(int i=1;i<=50;i++)a[i]=i;
for(int i=1;i<=50;i++)a[i]+=(n-50)/50;
(n-50)%=50;
for(int i=50;i>=1;i--)
{
if(n>0)n--,a[i]++;
}
printf("50\n");
for(int i=1;i<=50;i++)
{
if(i>1)printf(" ");
printf("%lld",a[i]);
}
printf("\n");
}
}
| a.cc: In function 'int main()':
a.cc:14:10: error: lvalue required as left operand of assignment
14 | (n-50)%=50;
| ~~^~~~
|
s692704718 | p03646 | C++ | #include<cstdio>
using namespace std;
int main()
{
long long k;
scanf("%lld",&k);
if(k&1) prinf("%lld %lld",k>>1,(k>>1)+2LL);
else printf("%lld %lld",k>>1,(k>>1)+1LL);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:13: error: 'prinf' was not declared in this scope; did you mean 'printf'?
7 | if(k&1) prinf("%lld %lld",k>>1,(k>>1)+2LL);
| ^~~~~
| printf
|
s898952952 | p03646 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
using namespace std;
typedef int64_t ll;
typedef vector<ll> vll;
struct Solution {
void solve(std::istream& in, std::ostream& out) {
ll K;
in >> K;
vll a(50, 100000000000001000);
ll j = 0;
while(true)
{
ll sum = -1;
rep(i, 50) sum += a[i];
if (sum == 50) {
j++;
if (j == 50) break;
}
else if (sum > 50) {
a[j] /= 2;
}
else {
a[j] *= 2;
}
}
out << 50 << endl;
rep (i, 50) out << a[i] << " ";
}
};
void solve(std::istream& in, std::ostream& out)
{
out << std::setprecision(12);
Solution solution;
solution.solve(in, out);
}
#include <fstream>
#include <iostream>
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
istream& in = cin;
ostream& out = cout;
solve(in, out);
return 0;
}
#include <Windows.h>
| a.cc:65:10: fatal error: Windows.h: No such file or directory
65 | #include <Windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s057746781 | p03646 | C++ | #if 1
#include <bits/stdc++.h>
#else
#include "../../../../bits/stdc++.h"
#endif
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define REP(i,n) FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
ll K;
ll a[50];
int main(){
cin.tie(0);
cin>>K;
ll k = K/2 + 1;
if(k<10000000000000000) {
cout<<2<<endl;
ll k = K/2 + 1;
if(K%2==0) {
cout<<k<<' '<<k<<endl;
}else {
cout<<k+1<<' '<<k-1<<endl;
}
}else {
ll k1 = K/50, k2 = K%50;
if(k2==0) {
REP(i, 50)a[i] = 50+k1-1;
}else {
REP(i, 50)a[i] = 50+k1;
REP8(i, 50-k2) {
REP(j, 50) {
if(j<i)a[j] - 50;
a[j] ++;
}
}
}
cout<<50<<endl;
REP(i, 50)cout<<a[i]<<' ';
cout<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:44:12: error: 'i' was not declared in this scope
44 | REP8(i, 50-k2) {
| ^
a.cc:44:7: error: 'REP8' was not declared in this scope; did you mean 'REP'?
44 | REP8(i, 50-k2) {
| ^~~~
| REP
|
s096108672 | p03646 | C++ | #include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define ll __int64
ll a[55];
int main()
{
ll n;
while(~scanf("%lld",&n))
{
for(int i=1;i<=50;i++)a[i]=i;
for(int i=1;i<=50;i++)a[i]+=n/50;
n%=50;
for(int i=50;i>=1;i--)
{
if(n>0)n--,a[i]++;
}
printf("50\n");
for(int i=1;i<=50;i++)
{
if(i>1)printf(" ");
printf("%lld",a[i]);
}
printf("\n");
}
}
| a.cc:5:12: error: '__int64' does not name a type; did you mean '__int64_t'?
5 | #define ll __int64
| ^~~~~~~
a.cc:6:1: note: in expansion of macro 'll'
6 | ll a[55];
| ^~
a.cc: In function 'int main()':
a.cc:5:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
5 | #define ll __int64
| ^~~~~~~
a.cc:9:4: note: in expansion of macro 'll'
9 | ll n;
| ^~
a.cc:10:25: error: 'n' was not declared in this scope
10 | while(~scanf("%lld",&n))
| ^
a.cc:12:30: error: 'a' was not declared in this scope
12 | for(int i=1;i<=50;i++)a[i]=i;
| ^
a.cc:13:30: error: 'a' was not declared in this scope
13 | for(int i=1;i<=50;i++)a[i]+=n/50;
| ^
a.cc:17:23: error: 'a' was not declared in this scope
17 | if(n>0)n--,a[i]++;
| ^
a.cc:23:27: error: 'a' was not declared in this scope
23 | printf("%lld",a[i]);
| ^
|
s210058604 | p03646 | C++ | #include<cstdio>
using namespace std;
int main()
{
long long k;
scanf("%lld',&k);
if(k&1) prinf("%lld %lld",k>>1,(k>>1)+2LL);
else printf("%lld %lld",k>>1,(k>>1)+1LL);
return 0;
}
| a.cc:6:11: warning: missing terminating " character
6 | scanf("%lld',&k);
| ^
a.cc:6:11: error: missing terminating " character
6 | scanf("%lld',&k);
| ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: expected primary-expression before 'if'
7 | if(k&1) prinf("%lld %lld",k>>1,(k>>1)+2LL);
| ^~
a.cc:8:5: error: 'else' without a previous 'if'
8 | else printf("%lld %lld",k>>1,(k>>1)+1LL);
| ^~~~
|
s414494520 | p03646 | C++ | #if 1
#include <bits/stdc++.h>
#else
#include "../../../../bits/stdc++.h"
#endif
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define REP(i,n) FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
ll K;
ll a[50];
int main(){
cin.tie(0);
cin>>K;
ll k = K/2 + 1;
if(k<10000000000000000) {
cout<<2<<endl;
ll k = K/2 + 1;
if(K%2==0) {
cout<<k<<' '<<k<<endl;
}else {
cout<<k+1<<' '<<k-1<<endl;
}
}else {
ll k1 = K/50, k2 = K%50;
if(k2==0) {
REP(i, 50)a[i] = 50+k1-1;
}else {
REP(i, 50)a[i] = 50+k1;
REP8(i, N-k2) {
REP(j, 50) {
if(j<i)a[j] - 50;
a[j] ++;
}
}
}
cout<<50<<endl;
REP(i, 50)cout<<a[i]<<' ';
cout<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:44:12: error: 'i' was not declared in this scope
44 | REP8(i, N-k2) {
| ^
a.cc:44:15: error: 'N' was not declared in this scope
44 | REP8(i, N-k2) {
| ^
a.cc:44:7: error: 'REP8' was not declared in this scope; did you mean 'REP'?
44 | REP8(i, N-k2) {
| ^~~~
| REP
|
s240123598 | p03646 | C++ | #if 1
#include <bits/stdc++.h>
#else
#include "../../../../bits/stdc++.h"
#endif
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define REP(i,n) FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
ll K;
ll a[50];
int main(){
cin.tie(0);
cin>>K;
ll k = K/2 + 1;
if(k<10000000000000000) {
cout<<2<<endl;
ll k = K/2 + 1;
if(K%2==0) {
cout<<k<<' '<<k<<endl;
}else {
cout<<k+1<<' '<<k-1<<endl;
}
}else {
ll k1 = K/N, k2 = K%N;
if(k2==0) {
REP(i, 50)a[i] = N+k1-1;
}else {
REP(i, 50)a[i] = N+k1;
REP8(i, N-k2) {
REP(j, 50) {
if(j<i)a[j] - N;
a[j] ++;
}
}
}
cout<<50<<endl;
REP(i, 50)cout<<a[i]<<' ';
cout<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:39:15: error: 'N' was not declared in this scope
39 | ll k1 = K/N, k2 = K%N;
| ^
a.cc:40:8: error: 'k2' was not declared in this scope; did you mean 'k1'?
40 | if(k2==0) {
| ^~
| k1
a.cc:44:12: error: 'i' was not declared in this scope
44 | REP8(i, N-k2) {
| ^
a.cc:44:7: error: 'REP8' was not declared in this scope; did you mean 'REP'?
44 | REP8(i, N-k2) {
| ^~~~
| REP
|
s074290194 | p03646 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
long k;
cin >> k;
long n = k / 50;
long m = k % 50;
vector<long> ans(50, max(50 * n - m, 0));
for (int i = 0; i < m; i++) {
ans[i] += 50;
}
cout << 50 << endl;
for (int i = 0; i < 50; i++) {
cout << ans[i];
if (i != 49) cout << " ";
}
cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:27: error: no matching function for call to 'max(long int, int)'
18 | vector<long> ans(50, max(50 * n - m, 0));
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:18:27: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
18 | vector<long> ans(50, max(50 * n - m, 0));
| ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:18:27: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
18 | vector<long> ans(50, max(50 * n - m, 0));
| ~~~^~~~~~~~~~~~~~~
|
s634053591 | p03646 | C++ | #include "math.h"
#include<vector>
#include<queue>
using namespace std;
vector<vector<int>> edges;
vector<int> mark;
vector<int> d;
queue<int> q;
long long int n,m;
void BFS(int start){
q.push(start);
d[start]=0;
mark[start]=1;
while(!q.empty()){
int v=q.front();
q.pop();
for(int i=0;i<edges[v].size();i++){
if(mark[edges[v][i]]!=1){
d[edges[v][i]]=d[v]+1;
mark[edges[v][i]]=1;
q.push(edges[v][i]);
}
}
}
}
using namespace std;
int main(){
cin>>n;
cout<<"50"<<endl;
int k;
cout<<"0 ";
for(int i=0;i<49;i++){
cout<<n/50+49+n%50<<" ";
if(n%50!=0){
n--;
}
}
cin>>n;
} | a.cc: In function 'int main()':
a.cc:30:9: error: 'cin' was not declared in this scope
30 | cin>>n;
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include<queue>
+++ |+#include <iostream>
4 | using namespace std;
a.cc:31:9: error: 'cout' was not declared in this scope
31 | cout<<"50"<<endl;
| ^~~~
a.cc:31:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:21: error: 'endl' was not declared in this scope
31 | cout<<"50"<<endl;
| ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
3 | #include<queue>
+++ |+#include <ostream>
4 | using namespace std;
|
s177468075 | p03646 | Java | import java.io.*;
import java.util.*;
import java.util.stream.IntStream;
class Test {
FastScanner _in;
PrintWriter _out;
void solve() {
long k = _in.nextLong();
if (k == 0) {
_out.println(2);
_out.println("1 1");
} else if (k == 1) {
_out.println(2);
_out.println("2 0");
}
long i;
_out.println(k + 1);
LongStream.rangeClosed(1, k).parallel().forEach((j) -> {
_out.print("0 ");
});
_out.println(k * (k + 1));
}
void run() throws Exception {
_in = new FastScanner();
_out = new PrintWriter(System.out);
solve();
_out.close();
}
public static void main(String[] args) throws Exception {
new Test().run();
}
class FastScanner {
BufferedReader _br;
StringTokenizer _st;
public FastScanner(String fileName) {
try {
_br = new BufferedReader(new FileReader(fileName));
} catch (FileNotFoundException e) {
// Error
}
}
public FastScanner() {
_br = new BufferedReader(new InputStreamReader(System.in));
}
String nextToken() {
while (_st == null || !_st.hasMoreElements()) {
try {
_st = new StringTokenizer(_br.readLine());
} catch (IOException e) {
throw new InputMismatchException();
}
}
return _st.nextToken();
}
String next() {
return nextToken();
}
short nextShort() {
return Short.parseShort(nextToken());
}
int nextInt() {
return Integer.parseInt(nextToken());
}
long nextLong() {
return Long.parseLong(nextToken());
}
float nextFloat() {
return Float.parseFloat(nextToken());
}
double nextDouble() {
return Double.parseDouble(nextToken());
}
}
} | Main.java:25: error: cannot find symbol
LongStream.rangeClosed(1, k).parallel().forEach((j) -> {
^
symbol: variable LongStream
location: class Test
1 error
|
s176108717 | p03646 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int N=50;
long long base,offset,K;
scanf("%lld",&K);
base=L/N;
offset=L%N;
printf("%lld",base+offset);
for(int i=2;i<=N;i++)
printf(" %lld",base);
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:10: error: 'L' was not declared in this scope
13 | base=L/N;
| ^
|
s608935971 | p03646 | C++ | #include<iostream> // 入出力
#include<stdio.h> // printf()が使える小数は%fで
#include<math.h> // 数学の関数
#include<vector> // 配列
#include<string> // 文字列
#include<map> // 連想配列
#include<stack> // スタック
#include<queue> // キュー
#include<algorithm> // ソートとか
using namespace std;
using ll = long long;
int main()
{
ll K; cin >> K;
ll N = K;
if (K >= 10) { N = 10; }
if (K == 0) { cout << "4\n3 3 3 3" << endl; return 0; }
if (K == 1) { cout << "3\n1 0 3" << endl; return 0; }
vector<ll> a(N, -K);
a[0] = N - 1 - K;
ll tuika = (K*(N + 1)) / (N);
ll amari = (K*(N + 1)) % (N);
for (int i = 0; i < N; ++i)
{
a[i] += tuika;
}
a[0] += amari;
cout << N << endl;
for (int i = 0; i < N; ++i)
{
cout << a[i] << " " << flush;
}
cout << endl;
return 0;
| a.cc: In function 'int main()':
a.cc:46:18: error: expected '}' at end of input
46 | return 0;
| ^
a.cc:16:1: note: to match this '{'
16 | {
| ^
|
s157202090 | p03646 | C++ | #include<cstring>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<cmath>
#include<map>
#include<sstream>
#define rep(i,l,r) for (int i=l;i<=r;i++)
#define down(i,l,r) for (int i=l;i>=r;i--)
#define clr(x,y) memset(x,y,sizeof(x))
#define maxn 500500
#define inf 1152921504606846976
#define ll long long
#define mm 1000000007
#define eps 1e-9
#define low(x) x&(-x)
#define pb push_back
#define PII pair<int,int>
using namespace std;
ll read(){
ll x=0,f=1; char ch=getchar();
while (!isdigit(ch)) {if (ch=='-') f=-1; ch=getchar();}
while (isdigit(ch)){x=x*10+ch-'0'; ch=getchar();}
return x*f;
}
ll k;
int main(){
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
k=read();
if (k==1) {
puts("2");
puts("2 0");
}
else if (k<=10000000000000000){
puts("2");
printf("%lld 1",k);
}
else {
ll n=k/10000000000000000;
m=k%10000000000000000;
if (m!=0) n++;
printf("%lld\n",n);
rep(i,1,n-1) printf("%lld ",10000000000000000);
printf("%lld\n",m+n-1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:43:17: error: 'm' was not declared in this scope
43 | m=k%10000000000000000;
| ^
|
s276563205 | p03646 | C++ | #include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <conio.h>
#define INF 123456789
#define MOD 1000000007
int main()
{
long long int N;
scanf("%lld", &N);
printf("2\n");
printf("%lld 0\n", N / 2 + N);
_getch();
return 0;
} | a.cc:5:10: fatal error: conio.h: No such file or directory
5 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s486109795 | p03646 | C++ | #include<iostream>
#define MAX 10000000000000999l
using namespace std;
int main(){
long long int k;
cin>>k;
cout<<"50"<<endl;
for(int i=1;i<=50;i++){
cout<<()(k<MAX*i)?49:49+k-MAX*i);
if(i-50)cout<<" ";
}
cout<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:24: error: expected primary-expression before ')' token
10 | cout<<()(k<MAX*i)?49:49+k-MAX*i);
| ^
|
s210564110 | p03647 | C++ | #include<iostream>
#include<vector>
using namespace std;
vector<int>graph[200005];
int main() {
int n, m; cin >> n >> m;
for (int i = 0, a, b; i < m; i++) {
cin >> a >> b; a--; b--;
graph[a].push_back(b);
graph[b].push_back(a);
}
for (int i = 0; i < graph[0].size(); i++) {
int v = graph[0][i];
for (int j = 0; j < graph[v].size(); j++) {
int u = graph[v][j];
if (u == n - 1) {
cout << "POSSIBLE" << endl;
return 0;
}
}
}
cout << "IMPOSSIBLE" << endl;
return 0;
}
#include<iostream>
#include<vector>
using namespace std;
vector<int>graph[200005];
int main() {
int n, m; cin >> n >> m;
for (int i = 0, a, b; i < m; i++) {
cin >> a >> b; a--; b--;
graph[a].push_back(b);
graph[b].push_back(a);
}
for (int i = 0; i < graph[0].size(); i++) {
int v = graph[0][i];
for (int j = 0; j < graph[v].size(); j++) {
int u = graph[v][j];
if (u == n - 1) {
cout << "POSSIBLE" << endl;
return 0;
}
}
}
cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc:32:12: error: redefinition of 'std::vector<int> graph [200005]'
32 | vector<int>graph[200005];
| ^~~~~
a.cc:5:12: note: 'std::vector<int> graph [200005]' previously declared here
5 | vector<int>graph[200005];
| ^~~~~
a.cc:34:5: error: redefinition of 'int main()'
34 | int main() {
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main() {
| ^~~~
|
s372650709 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
vector<int>graph[200005];
int main()
{
int n, m; cin >> n >> m;
for (int i = 0, a, b; i < m; i++)
{
cin >> a >> b; a--; b--;
graph[a].push_back(b);
graph[b].push_back(a);
}
for (int i = 0; i < graph[0].size(); i++) {
int v = graph[0][i];
for (int j = 0; graph[v].size();j++) {
int u = graph[v][j];
if (u == n - 1) {
cout<<"POSSIBLE<<endl;
return 0;
}
}
}
cout << "IMPOSSIBLE" << endl;
return 0;
}
| a.cc:18:39: warning: missing terminating " character
18 | cout<<"POSSIBLE<<endl;
| ^
a.cc:18:39: error: missing terminating " character
18 | cout<<"POSSIBLE<<endl;
| ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:19:33: error: expected primary-expression before 'return'
19 | return 0;
| ^~~~~~
|
s496039624 | p03647 | C++ | #include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <locale>
#include <iomanip>
#include <memset>
#define nl '\n'
using namespace std;
int n, m, a, b;
queue<pair <int, int> > Q; //distance, node
int dist[200005];
vector<int> G[200005];
int main(){
cin >> n >> m;
for(int i = 0; i < m; i++){
cin >> a >> b;
G[a].push_back(b);
G[b].push_back(a);
}
int SOURCE = 1;
memset(dist, -1, sizeof(dist));
Q.push(make_pair(0, SOURCE));
while(!Q.empty()){
int d = Q.front().first, u = Q.front().second;
Q.pop();
if(dist[u] != -1) continue;
dist[u] = d; //the shortest distance to node u is d
for(int i = 0; i < G[u].size(); i++){
Q.push(make_pair(d+1, G[u][i]));
}
}
if(dist[n] == 2){
cout << "POSSIBLE";
} else{
cout << "IMPOSSIBLE";
}
}
//g++ -std=c++14 comp.cpp -o b; ./b.exe
//g++ -std=c++14 comp.cpp && ./a.out | a.cc:15:10: fatal error: memset: No such file or directory
15 | #include <memset>
| ^~~~~~~~
compilation terminated.
|
s709930819 | p03647 | C++ | #include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <locale>
#include <iomanip>
#include <memeset>
#define nl '\n'
using namespace std;
int n, m, a, b;
queue<pair <int, int> > Q; //distance, node
int dist[200005];
vector<int> G[200005];
int main(){
cin >> n >> m;
for(int i = 0; i < m; i++){
cin >> a >> b;
G[a].push_back(b);
G[b].push_back(a);
}
int SOURCE = 1;
memset(dist, -1, sizeof(dist));
Q.push(make_pair(0, SOURCE));
while(!Q.empty()){
int d = Q.front().first, u = Q.front().second;
Q.pop();
if(dist[u] != -1) continue;
dist[u] = d; //the shortest distance to node u is d
for(int i = 0; i < G[u].size(); i++){
Q.push(make_pair(d+1, G[u][i]));
}
}
if(dist[n] == 2){
cout << "POSSIBLE";
} else{
cout << "IMPOSSIBLE";
}
}
//g++ -std=c++14 comp.cpp -o b; ./b.exe
//g++ -std=c++14 comp.cpp && ./a.out | a.cc:15:10: fatal error: memeset: No such file or directory
15 | #include <memeset>
| ^~~~~~~~~
compilation terminated.
|
s830145785 | p03647 | C++ | #include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <locale>
#include <iomanip>
#define nl '\n'
using namespace std;
int n, m, a, b;
queue<pair <int, int> > Q; //distance, node
int dist[200005];
vector<int> G[200005];
int main(){
cin >> n >> m;
for(int i = 0; i < m; i++){
cin >> a >> b;
G[a].push_back(b);
G[b].push_back(a);
}
int SOURCE = 1;
memset(dist, -1, sizeof(dist));
Q.push(make_pair(0, SOURCE));
while(!Q.empty()){
int d = Q.front().first, u = Q.front().second;
Q.pop();
if(dist[u] != -1) continue;
dist[u] = d; //the shortest distance to node u is d
for(int i = 0; i < G[u].size(); i++){
Q.push(make_pair(d+1, G[u][i]));
}
}
if(dist[n] == 2){
cout << "POSSIBLE";
} else{
cout << "IMPOSSIBLE";
}
}
//g++ -std=c++14 comp.cpp -o b; ./b.exe
//g++ -std=c++14 comp.cpp && ./a.out | a.cc: In function 'int main()':
a.cc:38:5: error: 'memset' was not declared in this scope
38 | memset(dist, -1, sizeof(dist));
| ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
14 | #include <iomanip>
+++ |+#include <cstring>
15 |
|
s397290659 | p03647 | C++ | #include <iostream>
using namespace std;
vector<int> *adj;
bool vis[200007] = {};
int n;
bool dfs(int v, int depth){
if(depth == 2) return (v == n-1);
if(vis[v]) return false;
vis[v] = 1;
bool r = false;
for(auto& u : adj[v]){
r |= dfs(u, depth+1);
}
return r;
}
int main(){
int e, a, b;
cin >> n >> e;
adj = new vector<int>[n];
while(e--){
cin >> a >> b;
a--; b--;
adj[a].push_back(b);
adj[b].push_back(a);
}
cout << (dfs(0, 0) ? "POSSIBLE" : "IMPOSSIBLE") << '\n';
}
| a.cc:4:1: error: 'vector' does not name a type
4 | vector<int> *adj;
| ^~~~~~
a.cc: In function 'bool dfs(int, int)':
a.cc:13:17: error: 'adj' was not declared in this scope
13 | for(auto& u : adj[v]){
| ^~~
a.cc: In function 'int main()':
a.cc:22:3: error: 'adj' was not declared in this scope
22 | adj = new vector<int>[n];
| ^~~
a.cc:22:13: error: 'vector' does not name a type
22 | adj = new vector<int>[n];
| ^~~~~~
a.cc:22:20: error: expected primary-expression before 'int'
22 | adj = new vector<int>[n];
| ^~~
|
s052141923 | p03647 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n-1;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
int main(){
ll n,m;
cin>>n>>m;
vll fi(200010);
vll la(200010);
rep(i,m){
ll a,b;
cin>>a>>b;
if(a==1){
fi[b]++;
}
if(b==n){
la[a]++;
}
}
vll ab(200010);
rep(i,200010){
ab[i]=a[i]+b[i];
}
ll cu=0;
rep(i,200010){
if(ab[i]==2){
COUT("POSSIBLE");
cu++;
}
}
if(cu==0) COUT("IMPOSSIBLE");
}
| a.cc: In function 'int main()':
a.cc:52:11: error: 'a' was not declared in this scope
52 | ab[i]=a[i]+b[i];
| ^
a.cc:52:16: error: 'b' was not declared in this scope
52 | ab[i]=a[i]+b[i];
| ^
|
s942429764 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using graph = vector<vector<int>>;
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;
int main() {
int n,m;cin >> n>> m;
graph G(n);
for(int i = 0; i < n; ++i){
int a,b;cin >> a>> b;
G[a].push_back(b);
}
strong ans="IMPOSSIBLE";
for(int i = 0; i < G[1].size(); ++i){
if(G[1][i]==n)ans="POSSIBLE";
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:21:3: error: 'strong' was not declared in this scope
21 | strong ans="IMPOSSIBLE";
| ^~~~~~
a.cc:23:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
23 | if(G[1][i]==n)ans="POSSIBLE";
| ^~~
| abs
a.cc:25:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
25 | cout << ans << endl;
| ^~~
| abs
|
s220960506 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll =long long;
using db = double;
using vll = vector<long long>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b) for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n) For(i, 0, n)
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
#define debug(x) cout << #x << " = " << (x) << endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"POSSIBLE"<<endl;}
bool coN(){cout <<"IMPOSSIBLE"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;
//ここから書き始める
int main()
{
int n,m;
cin >> n>> m;
int latte[200000] = {}, malta[200000] ={};
rep(i,m){
int a , b;
cin >> a >> b;
--a,--b;
if(a==0) latte[b] = true;
if(b==n-1) malta[a] = true;
}
rep(i,n){
if(latte[i] && malta[i]){
coY();
return 0 ;
}
}
else coN();
}
| a.cc: In function 'bool coY()':
a.cc:19:37: warning: no return statement in function returning non-void [-Wreturn-type]
19 | bool coY() {cout <<"POSSIBLE"<<endl;}
| ^
a.cc: In function 'bool coN()':
a.cc:20:38: warning: no return statement in function returning non-void [-Wreturn-type]
20 | bool coN(){cout <<"IMPOSSIBLE"<<endl;}
| ^
a.cc: In function 'int main()':
a.cc:44:9: error: 'else' without a previous 'if'
44 | else coN();
| ^~~~
|
s019879973 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define pri priority_queue
#define syo <int,V<int>
//#define min min<int>
//#define max max<int>
template<class T>
void cou(vector<vector<T>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}
/*template<>
void cou(vector<vector<char>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}*/
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
/*int lcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
}
*/ int gcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return f;
}
bool prime(int a){
if(a<2)
return false;
else if(a==2)
return true;
else if(a%2==0)
return false;
double b=sqrt(a);
for(int i=3;i<=b;i+=2){
if(a%i==0){
return false;
}
}
return true;
}
struct Union{
vector<int> par;
Union(int a){
par= vector<int>(a,-1);
}
int find(int a){
if(par[a]<0)
return a;
else
return par[a]=find(par[a]);
}
bool same(int a,int b){
return find(a)==find(b);
}
int Size(int a){
return -par[find(a)];
}
void unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)
return;
if(Size(b)>Size(a))
swap<int>(a,b);
par[a]+=par[b];
par[b]=a;
}
};
int ketas(int a){
string b=to_string(a);
int c=0;
fo(i,keta(a)){
c+=b[i]-'0';
}
return c;
}
/*int gcm(int a,int b){
if(b==0)
return a;
return gcm(b,a%b);
}*/
int lcm(int a,int b){
return a/gcm(a,b)*b;
}
/*struct aa{
vector<int> gt;
aa(int n){
gt= vector<int>(n, 1);
}
void c(V<int> d,int b){
if(d[b]==0){
gt[d[b]-1]++;
gt[gt.sz-1]++;
}
else{
gt[d[b]-1]++;
c(d,d[d[b]]-1);
}
}
void cok(int a){
cout<<gt[a-1]<<endl;
fo(i,a-1)
cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){
}*/
bool fe(int a,int b){
a%=10;
b%=10;
if(a==0)
a=10;
if(b==0)
b=10;
if(a>b)
return true;
else
return false;
}
int INF=1000000007;
struct edge{int s,t,d; };
signed main(){
int a,b;
cin>>a>>b;
V<P<int,int>> d(b);
fo(i,b){
cin>>d[i].fi>>d[i].se;
d[i].fi--;
d[i].se--;
}
V<int> e;
Sort(d);
for(int i=0;i<b&&d[i].fi==0;i++){
e.pb(d[i].se);
}
fo(i,a){
if(d[i].se==b){
e.pb(d[i].fi)
}
}
Sort(e);
int f=0;
fo(i,e.sz-1){
if(e[i]==e[i+1])
f=1;
}
if(f)
cout<<"POSSIBLE"<<endl;
else
cout<<"IMPOSSIBLE"<<endl;
} | a.cc: In function 'int main()':
a.cc:221:5: error: expected ';' before '}' token
221 | }
| ^
|
s746905829 | p03647 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
if(m==1){
cout<<"IMPOSSIBLE"<<endl;
return 0;
}
int a[200000];
int b[200000];
int sum=0;
for(int i=0;i<m;i++){
cin>>a[i]>>b[i];
if(a[i]==1){
sum++;
}
}
for(int i=0;i<m;i++){
for(int j=i;j<m;j++){
if(a[i]>a[j]){
int temp1=a[i];
a[i]=a[j];
int a[j]=temp1;
int temp2=b[i];
b[i]=b[j];
int b[j]=temp2;
}
}
}
for(int i=0;i<sum;i++){
for(int j=0;j<m;j++){
if(a[j]==b[i]&&b[j]==n){
cout<<"POSSIBLE"<<endl;
return 0;
}
}
}
cout<<"IMPOSSIBLE"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:26:34: error: array must be initialized with a brace-enclosed initializer
26 | int a[j]=temp1;
| ^~~~~
a.cc:29:34: error: array must be initialized with a brace-enclosed initializer
29 | int b[j]=temp2;
| ^~~~~
|
s782472476 | p03647 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
if(m==1){
cout<<"IMPOSSIBLE"<<endl;
return 0;
}
int a[200000];
int b[200000];
int sum=0;
for(int i=0;i<m;i++){
cin>>a[i]>>b[i];
if(a[i]==1){
sum++;
}
}
for(int i=0;i<m;i++){
if(a[i]>a[j]){
int temp1=a[i];
a[i]=a[j];
int a[j]=temp1;
int temp2=b[i];
b[i]=b[j];
int b[j]=temp2;
}
}
for(int i=0;i<sum;i++){
for(int j=0;j<m;j++){
if(a[j]==b[i]&&b[j]==n){
cout<<"POSSIBLE"<<endl;
return 0;
}
}
}
cout<<"IMPOSSIBLE"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:27: error: 'j' was not declared in this scope
22 | if(a[i]>a[j]){
| ^
|
s090826150 | p03647 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int a[200000];
int b[200000];
for(int i=0;i<m;i++){
cin>>a[i]>>b[i];3
}
for(int i=0;i<m;i++){
if(a[i]==1){
for(int j=0;j<m;j++){
if(a[j]==b[i]&&b[j]==n){
cout<<"POSSIBLE"<<endl;
return 0;
}
cout<<"IMPOSSIBLE"<<endl;
return 0;
}
}
}
} | a.cc: In function 'int main()':
a.cc:11:34: error: expected ';' before '}' token
11 | cin>>a[i]>>b[i];3
| ^
| ;
12 | }
| ~
|
s098699431 | p03647 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int nmax = 200002;
bool graph[nmax][nmax];
int n, m;
bool frag = false;
void dfs(int v, int depth) {
if (depth == 2 && v == n-1) frag = true;
if (depth > 2) return;
rep(i, n) {
if (!graph[v][i]) continue;
dfs(i, depth+1);
}
}
int main() {
cin >> n >> m;
rep(i, m) {
int x, y;
cin >> x >> y;
graph[x-1][y-1] = graph[y-1][x-1] = true;
}
dfs(0, 0);
if (frag) printf("POSSIBLE\n");
else printf("IMPOSSIBLE\n");
}
| /tmp/cc7SUYbG.o: in function `dfs(int, int)':
a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc7SUYbG.o
a.cc:(.text+0x24): relocation truncated to fit: R_X86_64_PC32 against symbol `frag' defined in .bss section in /tmp/cc7SUYbG.o
a.cc:(.text+0x7c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc7SUYbG.o
/tmp/cc7SUYbG.o: in function `main':
a.cc:(.text+0x95): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc7SUYbG.o
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc7SUYbG.o
a.cc:(.text+0x167): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc7SUYbG.o
a.cc:(.text+0x186): relocation truncated to fit: R_X86_64_PC32 against symbol `frag' defined in .bss section in /tmp/cc7SUYbG.o
collect2: error: ld returned 1 exit status
|
s723554123 | p03647 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int nmax = 200002;
bool graph[nmax][nmax];
int n, m;
bool frag = false;
void dfs(int v, int depth) {
if (depth == 2 && v == n-1) frag = true;
if (depth > 2) return;
rep(i, n) {
if (!graph[v][i]) continue;
dfs(i, depth+1);
}
}
int main() {
scanf("%d %d", &n, &m);
rep(i, m) {
int x, y;
scanf("%d %d", &x, &y);
graph[x-1][y-1] = graph[y-1][x-1] = true;
}
dfs(0, 0);
if (frag) printf("POSSIBLE\n");
else printf("IMPOSSIBLE\n");
}
| /tmp/cc08kMZ5.o: in function `dfs(int, int)':
a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc08kMZ5.o
a.cc:(.text+0x24): relocation truncated to fit: R_X86_64_PC32 against symbol `frag' defined in .bss section in /tmp/cc08kMZ5.o
a.cc:(.text+0x7c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc08kMZ5.o
/tmp/cc08kMZ5.o: in function `main':
a.cc:(.text+0x95): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc08kMZ5.o
a.cc:(.text+0x9f): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc08kMZ5.o
a.cc:(.text+0x158): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc08kMZ5.o
a.cc:(.text+0x177): relocation truncated to fit: R_X86_64_PC32 against symbol `frag' defined in .bss section in /tmp/cc08kMZ5.o
collect2: error: ld returned 1 exit status
|
s906844149 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){//桁数
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
int lcm(int a,int b){//最小公倍数
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
}
int gcm(int a,int b){//最大公約数
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return f;
}
signed main(){
int a,b,e,f=0,g;
cin>>a>>b;
vector<pair<int,int>> c(b)
fo(i,b)
cin>>c[i].first>>c[i].second;
Sort(c);
vector<int> d;
fo(i,b){
if(c[i].first==1)
d.push_back(c[i].second);
else
break;
}
int l=0,r=d.size()-1;
fo(i,b){
e=1;
if(c[i].second==a)
while(e){
g=(r+l)/2;
if(d[g]==c[i].first){
f=1;
break;
}
else{
if(l==g&&r==g)
break;
if(d[g]<c[i].first)
l=g;
else
r=g;
}
}
}
if(f)
cout<<"POSSIBLE"<<endl;
else
cout<<"IMPOSSIBLE"<<endl;
} | a.cc: In function 'int main()':
a.cc:4:17: error: expected ',' or ';' before 'for'
4 | #define fo(a,b) for(int a=0;a<b;a++)
| ^~~
a.cc:62:3: note: in expansion of macro 'fo'
62 | fo(i,b)
| ^~
a.cc:62:6: error: 'i' was not declared in this scope
62 | fo(i,b)
| ^
a.cc:4:29: note: in definition of macro 'fo'
4 | #define fo(a,b) for(int a=0;a<b;a++)
| ^
|
s979403508 | p03647 | C | #include <stdio.h>
int main(void){
int n,m,a,b;
int fl[200001]={0};
scanf("%d %d",&n,&m);
for(int i=0;i<m;i++){
scanf("%d %d",&a,&b);
if(a==1){
fl[b]=fl[b]+1;
}
if(b==n){
fl[a]|=fl[a]+1;
}
}
for(i=1;i<=n;i++){
if(fl[i]==2){
printf("POSSIBLE\n");
break;
}
}
printf("IMPOSSIBLE\n");
return 0;
} | main.c: In function 'main':
main.c:16:7: error: 'i' undeclared (first use in this function)
16 | for(i=1;i<=n;i++){
| ^
main.c:16:7: note: each undeclared identifier is reported only once for each function it appears in
|
s119626478 | p03647 | C++ | #include<bits/stdc++.h>
#define itn int
#define REP(i,n) for(int i=0;i<n;i++)
#define IREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=k;i<n;i++)
#define REPEACH(itr,k) for(auto itr : k)
#define MOD 1000000007
using namespace std;
typedef long long ll;
const ll INF = 1LL<<60;
typedef pair<double,int> P;
vector<vector<int>> v(200000,vector<int>());
bool ans(int x){
if(x==n){
return true;
}
REP(i,v[x].size()){
return ans(v[x][i]);
}
}
int main(){
int n,m;
cin >> n >> m;
REP(i,n){
int a,b;
cin >> a >> b;
v[a].push_back(b);
v[b].push_back(a);
}
REP(i,v[0].size()){
bool a=ans(v[0][i]);
if(a==true){
cout << "POSSIBLE" << endl;
return 0;
}
}
cout << "IMPOSSIBLE" << endl;
} | a.cc: In function 'bool ans(int)':
a.cc:17:15: error: 'n' was not declared in this scope
17 | if(x==n){
| ^
a.cc:23:1: warning: control reaches end of non-void function [-Wreturn-type]
23 | }
| ^
|
s392782799 | p03647 | C++ | #include<bits/stdc++.h>
#define itn int
#define REP(i,n) for(int i=0;i<n;i++)
#define IREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=k;i<n;i++)
#define REPEACH(itr,k) for(auto itr : k)
#define MOD 1000000007
using namespace std;
typedef long long ll;
const ll INF = 1LL<<60;
typedef pair<double,int> P;
vector<vector<int>> v(200000,vector<int>());
bool ans(int x){
if(x==n){
return true;
}
REP(i,v[x].size()){
return ans(v[x][i]);
}
}
int main(){
int n,m;
cin >> n >> m;
REP(i,n){
int a,b;
cin >> a >> b;
v[a].push_back(b);
v[b].push_back(a);
}
REP(i,v[0].size()){
bool a=ans(v[0][i]);
if(a==true){
cout << "POSSIBLE" << endl
return 0;
}
}
cout << "IMPOSSIBLE" << endl;
} | a.cc: In function 'bool ans(int)':
a.cc:17:15: error: 'n' was not declared in this scope
17 | if(x==n){
| ^
a.cc: In function 'int main()':
a.cc:36:51: error: expected ';' before 'return'
36 | cout << "POSSIBLE" << endl
| ^
| ;
37 | return 0;
| ~~~~~~
a.cc: In function 'bool ans(int)':
a.cc:23:1: warning: control reaches end of non-void function [-Wreturn-type]
23 | }
| ^
|
s159484491 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N >> M;
vector<int> a;
pair<int,int> pe[M];
map<int,int> mp;
for(int i=0;i<M;i++){
int p,q;
cin >> p >> q;
pe[i]=make_pair(p,q);
if(p==1)mp[q]++;
}
for(int i=0;i<M;i++){
if(pe.second==N)mp[pe.first]++;
}
bool ans=false;
for(auto x:mp){
if(x.second==2)ans=true;
}
if(ans)cout << "POSSIBLE";
else cout << "IMPOSSIBLE";
}
| a.cc: In function 'int main()':
a.cc:17:11: error: request for member 'second' in 'pe', which is of non-class type 'std::pair<int, int> [M]'
17 | if(pe.second==N)mp[pe.first]++;
| ^~~~~~
a.cc:17:27: error: request for member 'first' in 'pe', which is of non-class type 'std::pair<int, int> [M]'
17 | if(pe.second==N)mp[pe.first]++;
| ^~~~~
|
s553653032 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<bool> c(n + 1, false), d(n + 1, false);
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
if (x == 1) c[y] = true;
if (y == n) d[x] = true;
for (int i = 0; i <= n; i++) {
if (c[i] && d[i]) {
cout << "POSSIBLE" << endl;
return 0;
}
}
cout << "IMPOSSIBLE" << endl;
} | a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
21 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s337631713 | p03647 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main(){
int N,M,count=0; cin >> N >> M;
int a[M+10],b[M+10],c[M+10]={};
for(int i=0; i<M; i++){
cin >> a[i] >> b[i];
if(a[i]==1){
c[count]=b[i];
count+=1;
}
for(int i=0; i<=count; i++){
if(c[i]!=0){
for(int j=0; j<M; j++){
if(c[i]==a[j]){
if(b[j]==N){
cout << "POSSIBLE" << endl;
return 0;
}
}
}
}
}
cout << "IMPOSSIBLE" << endl;
} | a.cc: In function 'int main()':
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:10:11: note: to match this '{'
10 | int main(){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.