結果
問題 | No.796 well known |
ユーザー | plcherrim |
提出日時 | 2019-03-15 21:24:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 2,030 bytes |
コンパイル時間 | 1,686 ms |
コンパイル使用メモリ | 162,012 KB |
最終ジャッジ日時 | 2024-11-14 21:19:13 |
合計ジャッジ時間 | 2,092 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In instantiation of 'void puta(T&&) [with T = std::vector<long long int>&]': main.cpp:58:6: required from here main.cpp:38:38: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<long long int>') 38 | template<class T>void puta(T&&t){cout<<t<<"\n";} | ~~~~^~~ In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/istream:39, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/sstream:38, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/complex:45, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ccomplex:39, from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/x86_64-pc-linux-gnu/bits/stdc++.h:54, from main.cpp:1: /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:108: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>]' 108 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:108:36: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 108 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:117:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; using vb=vector<bool>; using vvb=vector<vb>; using vd=vector<double>; using vvd=vector<vd>; using vi=vector<int>; using vvi=vector<vi>; using vl=vector<ll>; using vvl=vector<vl>; using pll=pair<ll,ll>; using tll=tuple<ll,ll>; using tlll=tuple<ll,ll,ll>; using vs=vector<string>; #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define rep(i,n) range(i,0,n) #define rrep(i,n) for(ll i=(n)-1;i>=0;i--) #define range(i,a,n) for(ll i=(a);i<(n);i++) #define LINF ((ll)1ll<<60) #define INF ((int)1<<30) #define EPS (1e-9) #define MOD (1000000007ll) #define fcout(a) cout<<setprecision(a)<<fixed #define fs first #define sc second #define PI (3.1415926535897932384) int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1}; template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;} template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;} template<class S>S sum(vector<S>&a){return accumulate(all(a),S());} template<class S>S max(vector<S>&a){return *max_element(all(a));} template<class S>S min(vector<S>&a){return *min_element(all(a));} ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);} template<class T>void puta(T&&t){cout<<t<<"\n";} template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);} template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);} void YN(bool b){tf(b,"YES","NO");} void Yn(bool b){tf(b,"Yes","No");} void yn(bool b){tf(b,"yes","no");} template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;}; template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;} template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;} /*他のライブラリを入れる場所*/ int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin>>n; vl a(n,3); a[0]=1; puta(a); return 0; }