submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s570055204 | p03760 | C++ | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int dx[4] = {-1, 0, 0, 1};
const int dy[4] = {0, -1, 1, 0};
// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
ll fact(ll n) { ll res = 1; for(ll i=2;i<=n;++i) res = res * i; return res;}
ll nCr(ll n, ll r) {return (fact(n)/fact(n-r)*fact(r)) ;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const int inf = 1 << 30;
// clang-format on
string O, E;
int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> O >> E;
int i = 0, j = 0;
while (i < O.length() || j < E.length()) {
cout << (O[i] == '\0' ? '' : O[i]);
cout << (E[i] == '\0' ? '' : E[i])
if (i < O.length()) i++;
if (j < E.length()) j++;
}
cout << endl;
return 0;
}
| a.cc:45:30: error: empty character constant
45 | cout << (O[i] == '\0' ? '' : O[i]);
| ^~
a.cc:46:30: error: empty character constant
46 | cout << (E[i] == '\0' ? '' : E[i])
| ^~
a.cc: In function 'int main()':
a.cc:46:40: error: expected ';' before 'if'
46 | cout << (E[i] == '\0' ? '' : E[i])
| ^
| ;
47 | if (i < O.length()) i++;
| ~~
|
s218292923 | p03760 | C++ | #include <stdio.h>
int main()
{
char a[50],b[50],c[100],m,k,i,s;
scanf("%s",a);
scanf("%s",b);
k=strlen(a);
m=strlen(b);
s = k > m ? k : m;
printf("%c%c",a[0],b[0]);
for(i=1;i<=s;i++)
{
c[2*i-1]=a[i];
c[2*i]=b[i];
}
for(i=1;i<=2*s;i++)
printf("%c",c[i]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:7: error: 'strlen' was not declared in this scope
7 | k=strlen(a);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <cstring>
2 | int main()
|
s630108333 | p03760 | C++ | #include <stdio.h>
int main()
{
char a[50],b[50],c[100],m,k,i,s;
scanf("%s%s",a,b);
k=strlen(a);
m=strlen(b);
s = k > m ? k : m;
printf("%c%c",a[0],b[0]);
for(i=1;i<=s;i++)
{
c[2*i-1]=a[i];
c[2*i]=b[i];
}
for(i=1;i<=2*s;i++)
printf("%c",c[i]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:7: error: 'strlen' was not declared in this scope
6 | k=strlen(a);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <cstring>
2 | int main()
|
s533901452 | p03760 | C++ | // BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH
// AUTHOR:: MOHAMMAD FAISAL
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
string s;
cin >> s;
string t;
cin >> t;
int lenS = s.length();
int lenT - t.length();
for(int i=0;i<min(lenS,lenT);i++)
{
cout<<s[i]<<t[i];
}
if(lenS > lenT)
cout<<s[lenS-1];
if(len S < lenT)
cout<<t[lenT-1];
return 0;
} | a.cc: In function 'int main()':
a.cc:16:12: error: expected initializer before '-' token
16 | int lenT - t.length();
| ^
a.cc:18:26: error: 'lenT' was not declared in this scope; did you mean 'lenS'?
18 | for(int i=0;i<min(lenS,lenT);i++)
| ^~~~
| lenS
a.cc:22:13: error: 'lenT' was not declared in this scope; did you mean 'lenS'?
22 | if(lenS > lenT)
| ^~~~
| lenS
a.cc:24:6: error: 'len' was not declared in this scope; did you mean 'lenS'?
24 | if(len S < lenT)
| ^~~
| lenS
a.cc:24:9: error: expected ')' before 'S'
24 | if(len S < lenT)
| ~ ^~
| )
a.cc:25:13: error: 'lenT' was not declared in this scope; did you mean 'lenS'?
25 | cout<<t[lenT-1];
| ^~~~
| lenS
|
s571421692 | p03760 | C | #include <stdio.h>
#include <string.h>
int main(void){
char O[51],E[51];
int i,size;
scanf("%s",O);
scanf("%s",E);
size = strlen(O) + strlen(E);
char ans[size];
if(strlen(O) - strlen(E) == 0){
for(i=0;i<strlen(E);i++){
printf("%c",O[i]);
printf("%c",E[i]);
}
}else{
for(i=0;i<strlen(E):i++){
printf("%c",O[i]);
printf("%c",E[i]);
}
printf("%c",o[strlen(O) - 1]);
}
printf("\n");
return 0;
} | main.c: In function 'main':
main.c:17:28: error: expected ';' before ':' token
17 | for(i=0;i<strlen(E):i++){
| ^
| ;
main.c:21:21: error: 'o' undeclared (first use in this function)
21 | printf("%c",o[strlen(O) - 1]);
| ^
main.c:21:21: note: each undeclared identifier is reported only once for each function it appears in
|
s443568022 | p03760 | 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 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(){
string a,b,c,i;
cin >> a >> b;
for(i=0; i<b.size(); i++){
c.pb (a.at(i));
c.pb (b.at(i));
}
if(a.size() != b.size()) c.pb(a.at(i+1));
cout << c << endl;
}
| a.cc: In function 'int main()':
a.cc:205:9: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
205 | for(i=0; i<b.size(); i++){
| ^
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
817 | operator=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
828 | operator=(const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
840 | operator=(_CharT __c)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
858 | operator=(basic_string&& __str)
| ^~~~~~~~
a.cc:205:13: error: no match for 'operator<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
205 | for(i=0; i<b.size(); i++){
| ~^~~~~~~~~
| | |
| | std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181:
/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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
205 | for(i=0; i<b.size(); i++){
| ^
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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
205 | for(i=0; i<b.size(); i++){
| ^
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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
205 | for(i=0; i<b.size(); i++){
| ^
/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:205:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
205 | for(i=0; i<b.size(); i++){
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/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_vi |
s298994518 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
int main() {
string a,b,c;
cin >> a >> b;
for(int i=0; i<b.size(); i++){
c.pb (a.at(i));
c.pb(b.at(i));
}
if(a.size() != b.size()) c.pb(a.at(i+1));
cout << c << endl;
}
| a.cc: In function 'int main()':
a.cc:11:38: error: 'i' was not declared in this scope
11 | if(a.size() != b.size()) c.pb(a.at(i+1));
| ^
|
s391771732 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;cin>>s>>t;
for(int i=0;i<t.size();i++){
cout<<s.at(i)<<t.at(i);
}
if(s.at(i)>t.at(i)) cout<<s.at(s.size())<<endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
8 | if(s.at(i)>t.at(i)) cout<<s.at(s.size())<<endl;
| ^
|
s435628245 | p03760 | C++ | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char O[50];
char E[50];
char temp[100];
gets(O);
gets(E);
int lo=strlen(O),i,j,c;
int le=strlen(E);
c=lo+le;
for(i=0,j=0; i<c; i++,j++){
temp[i]=O[j];
temp[i+1]=E[j];
i++;
}
temp[i]='\0';
printf("%s\n",temp);
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(O);
| ^~~~
| getw
|
s429627535 | p03760 | C++ | #include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char O[50];
char E[50];
char temp[100];
gets(O);
gets(E);
int lo=strlen(O),i,j,c;
int le=strlen(E);
c=lo+le;
for(i=0,j=0; i<c; i++,j++){
temp[i]=O[j];
temp[i+1]=E[j];
i++;
}
temp[i]='\0';
printf("%s",temp);
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(O);
| ^~~~
| getw
|
s769909934 | p03760 | C++ | #include<stdio.h>
int main()
{
char A[50], B[50],c[100];
int i,j;
gets(A);
gets(B);
for(i=0,j=0;j<50 i++,j++)
{
c[i] = A[j];
c[i+1] = B[j];
i++;
}
puts(c);
}
| a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(A);
| ^~~~
| getw
a.cc:10:21: error: expected ';' before 'i'
10 | for(i=0,j=0;j<50 i++,j++)
| ^~
| ;
|
s598610766 | p03760 | C | #include<stdio.h>
int main()
{
char A[50], B[50],c[100];
int i,j;
gets(A);
gets(B);
for(i=0,j=0;j<50 i++,j++)
{
c[i] = A[j];
c[i+1] = B[j];
i++;
}
puts(c);
}
| main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(A);
| ^~~~
| fgets
main.c:10:21: error: expected ';' before 'i'
10 | for(i=0,j=0;j<50 i++,j++)
| ^~
| ;
|
s311181429 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int i,x,y,z=2,sum=0;
char a[50],b[50];
gets(a);
gets(b);
x=strlen(a);
y=strlen(b);
for(i=0;i<x+y;i++)
{
if(z%2==0)
{
if(sum<x)
{
cout<<a[sum];
}
else
{
cout<<a[sum-x];
}
}
else
{
if(sum<y)
{
cout<<b[sum];
}
else
{
cout<<b[sum-y];
sum++;
}
sum++;
}
z++;
}
cout<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(a);
| ^~~~
| getw
|
s246374252 | p03760 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int64_t minn(int64_t a,int64_t b){
if(a >= b) return b;
else return a;
}
int main(){
string O,E;
cin >> O>>E;
for(int i = 0;i < (O.size()+E.size()+1)/2;i++){
if(E.size() = O.size() - 1 && i == (O.size()+E.size()+1)/2 -1 ){
cout <<O[i];
}
else cout << O[i] << E[i];
}
}
| a.cc: In function 'int main()':
a.cc:12:17: error: lvalue required as left operand of assignment
12 | if(E.size() = O.size() - 1 && i == (O.size()+E.size()+1)/2 -1 ){
| ~~~~~~^~
|
s315349159 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string O,E;
vector<vector<int>> v(N,vector(2));
cin>>O>>E;
if(O.size()==E.size()){
for(int i=0;i<E.size();i++){
cout<<O[i]<<E[i];
}
}else{
for(int i=0;i<E.size();i++){
cout<<O[i]<<E[i];
}
cout<<O[O.size()-1]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:5:25: error: 'N' was not declared in this scope
5 | vector<vector<int>> v(N,vector(2));
| ^
a.cc:5:35: error: class template argument deduction failed:
5 | vector<vector<int>> v(N,vector(2));
| ^
a.cc:5:35: error: no matching function for call to 'vector(int)'
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: couldn't deduce template parameter '_Tp'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: couldn't deduce template parameter '_Tp'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:428:11: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>'
2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 1 provided
|
s010761162 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int O,E;
vector<vector<int>> v(N,vector(2));
cin>>O>>E;
if(O.size()==E.size()){
for(int i=0;i<E.size();i++){
cout<<O[i]<<E[i];
}
}else{
for(int i=0;i<E.size();i++){
cout<<O[i]<<E[i];
}
cout<<O[O.size()-1]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:5:25: error: 'N' was not declared in this scope
5 | vector<vector<int>> v(N,vector(2));
| ^
a.cc:5:35: error: class template argument deduction failed:
5 | vector<vector<int>> v(N,vector(2));
| ^
a.cc:5:35: error: no matching function for call to 'vector(int)'
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: couldn't deduce template parameter '_Tp'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: template argument deduction/substitution failed:
a.cc:5:35: note: couldn't deduce template parameter '_Tp'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:428:11: note: template argument deduction/substitution failed:
a.cc:5:35: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
5 | vector<vector<int>> v(N,vector(2));
| ^
/usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>'
2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 1 provided
a.cc:7:8: error: request for member 'size' in 'O', which is of non-class type 'int'
7 | if(O.size()==E.size()){
| ^~~~
a.cc:7:18: error: request for member 'size' in 'E', which is of non-class type 'int'
7 | if(O.size()==E.size()){
| ^~~~
a.cc:8:21: error: request for member 'size' in 'E', which is of non-class type 'int'
8 | for(int i=0;i<E.size();i++){
| ^~~~
a.cc:9:14: error: invalid types 'int[int]' for array subscript
9 | cout<<O[i]<<E[i];
| ^
a.cc:9:20: error: invalid types 'int[int]' for array subscript
9 | cout<<O[i]<<E[i];
| ^
a.cc:12:21: error: request for member 'size' in 'E', which is of non-class type 'int'
12 | for(int i=0;i<E.size();i++){
| ^~~~
a.cc:13:14: error: invalid types 'int[int]' for array subscript
13 | cout<<O[i]<<E[i];
| ^
a.cc:13:20: error: invalid types 'int[int]' for array subscript
13 | cout<<O[i]<<E[i];
| ^
a.cc:15:15: error: request for member 'size' in 'O', which is of non-class type 'int'
15 | cout<<O[O.size()-1]<<endl;
| ^~~~
|
s846211656 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string o,e;
cin>>o>>e;
for(int i=0;i<e.size();i++){
cout<<o.at(i)<<e.at(i);
}
if(o.size()-e.size()-==1){
int sz=o.size()-1;
cout<<o.at(sz);
}
cout<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:25: error: expected primary-expression before '=' token
10 | if(o.size()-e.size()-==1){
| ^
|
s033100018 | p03760 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string s,t;
cin>>s>>t;
for(int i=0;i<s.length();i++)
{
cout<<s[i];
if(i<t.length())
cout<<t[i]
}
return 0;
} | a.cc: In function 'int main()':
a.cc:15:35: error: expected ';' before '}' token
15 | cout<<t[i]
| ^
| ;
16 | }
| ~
|
s510213004 | p03760 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string s,t;
cin>>s>>t;
for(int i=0;i<s.length();i++)
{
cout<<s[i];
if(i<t.length())
cout<<t[i]
}
return 0;
} | a.cc: In function 'int main()':
a.cc:15:35: error: expected ';' before '}' token
15 | cout<<t[i]
| ^
| ;
16 | }
| ~
|
s090191495 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
string O,E;
cin >> O >> E;
N = O.size();
M = E.size();
if(N > M){
for (int i=0; i < N-1; i++ ){
cout << O.at(i) << E.at(i);
}
cout << E.at(M-1) << endl;
}
if(N < M){
for (int i=0; i < M-1; i++ ){
cout << O.at(i) << E.at(i);
}
cout << O.at(N-1) << endl;
}
else if(N==M){
for (int i=0; i < N; i++ ){
cout << O.at(i) << E.at(i);
}
cout << endl;
}
}
| a.cc:25:4: error: extended character is not valid in an identifier
25 | }
| ^
a.cc:25:4: error: extended character is not valid in an identifier
a.cc:25:4: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:25:4: error: '\U00003000\U00003000\U00003000' was not declared in this scope
25 | }
| ^~~~~~
|
s782415143 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
string O,E;
cin >> O >> E;
N = O.size();
M = E.size();
if(N > M){
for (int i=0; i < N-1; i++ ){
cout << O.at(i) << E.at(i);
}
cout << E.at(M-1) << endl;
}
if(N < M){
for (int i=0; i < M-1; i++ ){
cout << O.at(i) << E.at(i);
}
cout << O.at(N-1) << endl;
}
else if(N==M){
for (int i=0; i < N; i++ ){
cout << O.at(i) << E.at(i);
}
cout << endl;
}
}
| a.cc:25:4: error: extended character is not valid in an identifier
25 | }
| ^
a.cc:25:4: error: extended character is not valid in an identifier
a.cc:25:4: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:25:4: error: '\U00003000\U00003000\U00003000' was not declared in this scope
25 | }
| ^~~~~~
|
s923240116 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string O;
cin >> O;
string E;
cin >> E;
int A=O.size()
int B=E.size()
if(A>B){
for(int i=0; i<B; i++){
cout << O.at(i) << E.at(i);
}
cout<<O.at(A);
}
else{
for(int i=0; i<B; i++){
cout << O.at(i) << E.at(i);
}
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'int'
11 | int B=E.size()
| ^~~
a.cc:20:1: error: 'else' without a previous 'if'
20 | else{
| ^~~~
a.cc:21:20: error: 'B' was not declared in this scope
21 | for(int i=0; i<B; i++){
| ^
|
s318170417 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
string O,E;
cin >> O >> E;
O.size() = N;
E.size() = M;
for (int i=0; i < N; i++ ){
for(int j=0; i < M; j++){
cout << O.at(i) << E.at(j);
}
}
} | a.cc: In function 'int main()':
a.cc:8:9: error: lvalue required as left operand of assignment
8 | O.size() = N;
| ~~~~~~^~
a.cc:9:9: error: lvalue required as left operand of assignment
9 | E.size() = M;
| ~~~~~~^~
|
s360161213 | p03760 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
string a,b;
cin>>a>>b;
if(a.size()==b.size()){
rep(i,a.size())
cout<<a.at(i)<<b.at(i);
}
else{
rep(i,b.size())
cout<<a.at(i)<<b.at(i);
cout<<a.at(a.size-1);
}
} | a.cc: In function 'int main()':
a.cc:18:18: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
18 | cout<<a.at(a.size-1);
| ~~^~~~
| ()
|
s406200710 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a,b;
cin >> a >> b;
for (i=0;i<b.size();i++){
cout << a[i] << b[i];
}
if (a.size()>b.size()){
cout << a[a.size()-1];
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:7:8: error: 'i' was not declared in this scope
7 | for (i=0;i<b.size();i++){
| ^
|
s750312366 | p03760 | C++ | #include<cstdio>
#include<isotream>
#include<cstring>
using namespace std;
int a[60],b[60];
int main ()
{
scanf("%s",&a);
scanf("%s",&b);
for(int i=0;i<=50;i++){
if(a[i]!=0)cout<<a[i];
if(b[i]!=0)cout<<b[i];
}
return 0;
} | a.cc:2:9: fatal error: isotream: No such file or directory
2 | #include<isotream>
| ^~~~~~~~~~
compilation terminated.
|
s608124283 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string o,e;
cin>>o>>e;
int oLen=o.size(),eLen=e.size();
if(oLen==eLen) {
for (i=0; i < oLen; i++) {
cout<<o[i]<<e[i];
}
} else {
for (i,i < eLen; i++) {
cout<<o[i]<<e[i];
}
cout<<o[o.size()-1];
}
cout<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:10: error: 'i' was not declared in this scope
12 | for (i=0; i < oLen; i++) {
| ^
a.cc:16:10: error: 'i' was not declared in this scope
16 | for (i,i < eLen; i++) {
| ^
a.cc:16:25: error: expected ';' before ')' token
16 | for (i,i < eLen; i++) {
| ^
| ;
|
s874563018 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string e;
string o;
int i, mx;
cin >> o:
cin >> e;
if (o.size()==e.size()) {
for (i=0; i < o.size(); i++) {
cout << o[i] << e[i];
}
} else {
i=0;
while (i!=e.size()) {
cout << o[i] << e[i];
i++;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:13: error: found ':' in nested-name-specifier, expected '::'
8 | cin >> o:
| ^
| ::
a.cc:8:12: error: 'o' is not a class, namespace, or enumeration
8 | cin >> o:
| ^
|
s370671890 | p03760 | C++ | #include<iostream>
#include<cstdio>
#include<string.h>
using namespace std;
int main()
{
char a[51];
char b[51];
gets(a);
gets(b);
int len1=strlen(a);
int len2=strlen(b);
if(len1>len2)
{
for(int i=0;i<len2;i++)
{
cout<<a[i]<<b[i];
}
for(int i=len2;i<len1;i++)
{
cout<<a[i];
}
cout<<endl;
}
else
{
for(int i=0;i<len1;i++)
{
cout<<a[i]<<b[i];
}
cout<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s797192734 | p03760 | C++ | #include<iostream>
#include<cstdio>
#include<string.h>
using namespace std;
int main()
{
char a[51];
char b[51];
gets(a);
gets(b);
int len1=strlen(a);
int len2=strlen(b);
if(len1>len2)
{
for(int i=0;i<len2;i++)
{
cout<<a[i]<<b[i];
}
for(int i=len2;i<len1;i++)
{
cout<<a[i];
}
cout<<endl;
}
else
{
for(int i=0;i<len1;i++)
{
cout<<a[i]<<b[i];
}
cout<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s130172884 | p03760 | C++ | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char a[51];
char b[51];
gets(a);
gets(b);
int len1=strlen(a);
int len2=strlen(b);
if(len1>len2)
{
for(int i=0;i<len2;i++)
{
cout<<a[i]<<b[i];
}
for(int i=len2;i<len1;i++)
{
cout<<a[i];
}
cout<<endl;
}
else
{
for(int i=0;i<len1;i++)
{
cout<<a[i]<<b[i];
}
cout<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s150366867 | p03760 | C++ | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char a[51];
char b[51];
gets(a);
gets(b);
int len1=strlen(a);
int len2=strlen(b);
if(len1>len2)
{
for(int i=0;i<len2;i++)
{
cout<<a[i]<<b[i];
}
for(int i=len2;i<len1;i++)
{
cout<<a[i];
}
cout<<endl;
}
else
{
for(int i=0;i<len1;i++)
{
cout<<a[i]<<b[i];
}
cout<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s869881214 | p03760 | C++ | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
char a[51];
char b[51];
gets(a);
gets(b);
int len1=strlen(a);
int len2=strlen(b);
if(len1>len2)
{
for(int i=0;i<len2;i++)
{
cout<<a[i]<<b[i];
}
for(int i=len2;i<len1;i++)
{
cout<<a[i];
}
cout<<endl;
}
else
{
for(int i=0;i<len1;i++)
{
cout<<a[i]<<b[i];
}
cout<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(a);
| ^~~~
| getw
|
s408652200 | p03760 | C++ | #include<iostream>
#include<string>
string a,b;
int i;
int main()
{
std::cin>a>>b;
for(;i<a.size()+b.size();i++)
if(i%2)puts(a[i/2]);
else puts(b[i/2]);
} | a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
4 | string a,b;
| ^~~~~~
| stdin
a.cc: In function 'int main()':
a.cc:9:14: error: 'a' was not declared in this scope
9 | std::cin>a>>b;
| ^
a.cc:9:17: error: 'b' was not declared in this scope
9 | std::cin>a>>b;
| ^
|
s373570109 | p03760 | C++ | #include<iostream>
#include<string>
string a,b;
int i;
int main()
{
std::cin>a>>b;
for(;i<a.size()+b.size();i++)
if(i%2)puts(a[i/2]);
else puts(b[i/2]);
} | a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
4 | string a,b;
| ^~~~~~
| stdin
a.cc: In function 'int main()':
a.cc:9:14: error: 'a' was not declared in this scope
9 | std::cin>a>>b;
| ^
a.cc:9:17: error: 'b' was not declared in this scope
9 | std::cin>a>>b;
| ^
|
s387821198 | p03760 | C++ | #include<iosteam>
#include<string>
string a,b;
int i;
int main()
{
std::cin>a>>b;
for(;i<a.size()+b.size();i++)
if(i%2)puts(a[i/2]);
else puts(b[i/2]);
} | a.cc:1:9: fatal error: iosteam: No such file or directory
1 | #include<iosteam>
| ^~~~~~~~~
compilation terminated.
|
s077962084 | p03760 | C++ | // --https://kenkoooo.com/atcoder/#/table/soma62jp
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
string O,E;
cin >> O >> E;
for (int i = 0; i < O.length(); i++) {
cout << O[i];
if(E.length()-1 > i){
cout << E[i];
}
}
cout << endl;
return 0;
| a.cc: In function 'int main(int, char**)':
a.cc:20:18: error: expected '}' at end of input
20 | return 0;
| ^
a.cc:5:34: note: to match this '{'
5 | int main(int argc, char* argv[]) {
| ^
|
s380474583 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a,b;
cin>>a>>b;
for(int i=0;i<a.size();i++)
cout<<a.at(i)<<b.at(i);
if(i==b.size())
cout <<a.at(i);
}
| a.cc: In function 'int main()':
a.cc:9:6: error: 'i' was not declared in this scope
9 | if(i==b.size())
| ^
|
s262318862 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a,b;
cin>>a>>b;
for(int i=0;i<a.size();i++)
cout<<a.at(i)<<b.at(i);
if(i==b.size())
cout <<a.at(i);
}
| a.cc: In function 'int main()':
a.cc:9:6: error: 'i' was not declared in this scope
9 | if(i==b.size())
| ^
|
s388850445 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a,b;
cin>>a>>b;
for(int i=0;i<a.size();i++)
cout<<a.at(i)<<b.at(i);
if(a.size()==i+1 && b.size()+1==a.size())
cout <<a.at(i);
}
| a.cc: In function 'int main()':
a.cc:9:16: error: 'i' was not declared in this scope
9 | if(a.size()==i+1 && b.size()+1==a.size())
| ^
|
s670243849 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a,b;
cin>>a>>b;
for(int i=0;i<a.size();i++)
cout<<a.at(i);
cout<<b.at(i);
if(a.size()==i+1 && b.size()+1==a.size())
cout <<a.at(i);
} | a.cc: In function 'int main()':
a.cc:9:14: error: 'i' was not declared in this scope
9 | cout<<b.at(i);
| ^
|
s493324162 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string o;
string e;
cin >> o >> e;
for (int i = 0; i < o.size(); ++i) {
cout << o[i];
if (i < e.size()) cout << e[i];
}
cout << endl;@
} | a.cc:13:16: error: stray '@' in program
13 | cout << endl;@
| ^
|
s077808929 | p03760 | C | #include<stdio.h>
int main() {
char G[51], K[51];
scanf_s("%s%s", K, G);
for (int i = 0; i < sizeof(K); i++) {
printf("%c%c", K[i], G[i]);
}
return 0;
} | main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
5 | scanf_s("%s%s", K, G);
| ^~~~~~~
| scanf
|
s254109421 | p03760 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i <= (n); i++)
#define repi(i,a,b) for (int i = (a); i < (b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
int main() {
string E, O; cin >> E >> O;
rep(i,E.size()) {
cout << E[i];
if(i<O.size()) cout << o[i];
}
return 0;
} | a.cc: In function 'int main()':
a.cc:21:28: error: 'o' was not declared in this scope
21 | if(i<O.size()) cout << o[i];
| ^
|
s993687692 | p03760 | C++ | #include <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}
const int MOD =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
fac[0]=fac[1]=1;
finv[0]=finv[1]=1;
inv[1]=1;
for(int i=2;i<MAX;i++){
fac[i]=fac[i-1]*i%MOD;
inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
finv[i]=finv[i-1]*inv[i]%MOD;
}
}
ll COM(int n,int k){
if(n<k) return 0;
if(n<0||k<0)return 0;
return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s020215598 | p03760 | C++ | #include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;
const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};
#define p_queue(i) priority_queue<i>
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>>
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >>
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>())
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a)
#define vlb(a,k) (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a)
#define vub(a,k) (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
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; }
vector<string> split(const string &str, char sep){
vector<string> v;
stringstream ss(str);
string buffer;
while( getline(ss, buffer, sep) ) {
v.push_back(buffer);
}
return v;
}
//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}
//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}
//ll nHr(int n,int r){ret nCr(n+r-1,r);}
///////////////////////////////////////////////////////////////////////////
int main(){
string o,e;
cin >> o >> e;
rep(i,0,min(sz(o),sz(e)))cout << o[i] << e[i];
xif(sz(o) > sz(e))cout << o[sz(o)-1] << endl;
else cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:92:5: error: 'xif' was not declared in this scope
92 | xif(sz(o) > sz(e))cout << o[sz(o)-1] << endl;
| ^~~
a.cc:93:5: error: 'else' without a previous 'if'
93 | else cout << endl;
| ^~~~
|
s524023373 | p03760 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,s,e) for (int i=s;i<(e);i++)
#define All(v) (v).begin(),(v).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = 999999999;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
string O;
string E;
cin >> O >> E;
REP(i,max(O.size(),E.size()){
cout << O[i] << E[i];
}
cout << endl;
return 0;
} | a.cc:26:2: error: unterminated argument list invoking macro "REP"
26 | }
| ^
a.cc: In function 'int main()':
a.cc:20:5: error: 'REP' was not declared in this scope
20 | REP(i,max(O.size(),E.size()){
| ^~~
a.cc:20:8: error: expected '}' at end of input
20 | REP(i,max(O.size(),E.size()){
| ^
a.cc:13:11: note: to match this '{'
13 | int main(){
| ^
|
s299154788 | p03760 | C++ | #include<iostream>
using std;
int main(){
string o,e;cin>>o>>e;
for(int i=0;i<min(o.size(),e.size());i++){
cout<<o[i]<<e[i];
}
if(o.size()>e.size())cout<<o.back();
cout<<endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'std'
2 | using std;
| ^~~
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
4 | string o,e;cin>>o>>e;
| ^~~~~~
a.cc:4:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:4:20: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | string o,e;cin>>o>>e;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:4:25: error: 'o' was not declared in this scope
4 | string o,e;cin>>o>>e;
| ^
a.cc:4:28: error: 'e' was not declared in this scope
4 | string o,e;cin>>o>>e;
| ^
a.cc:5:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
5 | for(int i=0;i<min(o.size(),e.size());i++){
| ^~~
| std::min
In file included from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
a.cc:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | cout<<o[i]<<e[i];
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | if(o.size()>e.size())cout<<o.back();
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:9:9: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cout<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s214144896 | p03760 | C++ | import Foundation
let o=readLine()!
let e=readLine()!
var res=""
for i in 0..<max(o.count, e.count){
res+=String(o[o.index(o.startIndex, offsetBy: i)])
if i<e.count{
res+=String(e[e.index(e.startIndex, offsetBy: i)])
}
}
print(res)
| a.cc:8:10: error: too many decimal points in number
8 | for i in 0..<max(o.count, e.count){
| ^~~
a.cc:1:1: error: 'import' does not name a type
1 | import Foundation
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:15:6: error: expected constructor, destructor, or type conversion before '(' token
15 | print(res)
| ^
|
s641844931 | p03760 | Java | import util.java.*;
public class Main {
static Scanner scanner = new Scanner(System.in);
public static void main(String[]$) {
String[] a = new String[] {scanner.next(), scanner.next()};
int length = a[0].length() + a[1].length();
for (int i = 0; i < length; i++) {
System.out.print(a[(i + 1) % 2].charAt(i / 2));
}
System.out.println();
}
} | Main.java:4: error: cannot find symbol
static Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:1: error: package util.java does not exist
import util.java.*;
^
Main.java:4: error: cannot find symbol
static Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
3 errors
|
s986069630 | p03760 | Java | import util.java.*;
public class Main {
static Scanner scanner = new Scanner(System.in);
public static void main(String[]$) {
String[] a = new String[] {scanner.next(), scanner.next()};
int length = a[0].length() + a[1].length();
for (int i = 0; i < length; i++) {
System.out.print(a[(i + 1) % 2].charAt(i / 2));
}
System.out.println();
}
} | Main.java:4: error: cannot find symbol
static Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:1: error: package util.java does not exist
import util.java.*;
^
Main.java:4: error: cannot find symbol
static Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
3 errors
|
s477790178 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string O,E;
cin>>O;
cin>>E;
int o==0;
int e==0;
for(int i=0;i<O.size()+E.size();i++){
if(i%2==0){
cout<<O.at(o);
o++;
}
else{
cout<<E.at(e);
e++;
}
}
} | a.cc: In function 'int main()':
a.cc:7:8: error: expected initializer before '==' token
7 | int o==0;
| ^~
a.cc:8:8: error: expected initializer before '==' token
8 | int e==0;
| ^~
a.cc:12:18: error: 'o' was not declared in this scope
12 | cout<<O.at(o);
| ^
a.cc:17:18: error: 'e' was not declared in this scope
17 | cout<<E.at(e);
| ^
|
s573484247 | p03760 | C++ | using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++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 all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string a,b;
cin>>a>>b;
string ans='a';
if(a.size()==b.size()){
rep(i,a.size()){
cout<<a[i]<<b[i];
}
}
else if(a.size()>b.size()){
rep(i,b.size()){
cout<<a[i]<<b[i];
}
FOR(i,b.size(),a.size()){
cout<<a[i];
}
}
else{
rep(i,a.size()){
cout<<a[i]<<b[i];
FOR(i,a.size(),b.size()){
cout<<b[i];
}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:25:15: error: expected initializer before 'a'
25 | string ans='a';
| ^~~
a.cc:46:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
46 | cout<<ans<<endl;
| ^~~
| abs
a.cc:51:2: error: expected '}' at end of input
51 | }
| ^
a.cc:20:11: note: to match this '{'
20 | int main(){
| ^
|
s723825578 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;cin>>s >>t;
vector<char> ans(s.size()+t.size());
for(int i=0;i<2*s.size();i+=2){
ans.at(i)=s[i/2];
}
for(int i=1;i<2*s.size();i+=2){
ans.at(i)=t[i/2];
}
for(int i=0;i<ans.size();i++){
cout<<ans;
return 0;
}
} | a.cc: In function 'int main()':
a.cc:14:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
14 | cout<<ans;
| ~~~~^~~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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 = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::nullptr_t'
306 | operator<<(nullptr_t)
| |
s542478371 | p03760 | C++ | #include<iostream>
#include<cstring>
using namespace std;
char a[101],b[101];
int blen;
int main()
{
cin>>a>>b;
blen=strlen(b);
for(int i=0;i<l;i++)cout<<a[i]<<b[i];
if(strlen(a)>strlen(b)) cout<<a[l]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:19: error: 'l' was not declared in this scope
10 | for(int i=0;i<l;i++)cout<<a[i]<<b[i];
| ^
a.cc:11:37: error: 'l' was not declared in this scope
11 | if(strlen(a)>strlen(b)) cout<<a[l]<<endl;
| ^
|
s152287126 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
vector<char> ans[a.size()+b.size()];
for(int i=0;i<a.size();i++){
ans[2*i]=a.at(i);
}
for(int i=0;i<b.size();i++){
ans[2*i+1]=b.at(i);
}
for(int i=0;i<a.size()+b.size();i++){
cout<<ans[i];
}
}
| a.cc: In function 'int main()':
a.cc:8:20: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
8 | ans[2*i]=a.at(i);
| ^
In file included from /usr/include/c++/14/vector:72,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:11:22: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
11 | ans[2*i+1]=b.at(i);
| ^
/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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
211 | operator=(const vector<_Tp, _Alloc>& __x)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:14:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
14 | cout<<ans[i];
| ~~~~^~~~~~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' to 'i |
s392602913 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
vector<char> ans[100];
for(int i=0;i<a.size();i++){
ans[2*i]=a.at(i);
}
for(int i=0;i<b.size();i++){
ans[2*i+1]=b.at(i);
}
for(int i=0;i<a.size()+b.size();i++){
cout<<ans[i];
}
}
| a.cc: In function 'int main()':
a.cc:8:20: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
8 | ans[2*i]=a.at(i);
| ^
In file included from /usr/include/c++/14/vector:72,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:11:22: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
11 | ans[2*i+1]=b.at(i);
| ^
/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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
211 | operator=(const vector<_Tp, _Alloc>& __x)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:14:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
14 | cout<<ans[i];
| ~~~~^~~~~~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' to 'i |
s958319257 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
vector<char> ans[100];
for(int i=0;i<100;i++){
ans[2*i]=a.at(i);
ans[2*i+1]=b.at(i);
}
for(int i=0;i<a.size()+b.size();i++){
cout<<ans[i];
}
}
| a.cc: In function 'int main()':
a.cc:8:20: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
8 | ans[2*i]=a.at(i);
| ^
In file included from /usr/include/c++/14/vector:72,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:9:22: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
9 | ans[2*i+1]=b.at(i);
| ^
/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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
211 | operator=(const vector<_Tp, _Alloc>& __x)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:12:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
12 | cout<<ans[i];
| ~~~~^~~~~~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' to 'in |
s070347318 | p03760 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
vector<char> ans[100];
for(int i=0;i<100;i++){
ans[2*i]=a.at(i);
ans[2*i+1]=b.at(i);
}
for(int i=0;i<a.size()+b.size();i++){
cout<<ans[i];
}
}
| a.cc: In function 'int main()':
a.cc:9:20: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
9 | ans[2*i]=a.at(i);
| ^
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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:10:22: error: no match for 'operator=' (operand types are 'std::vector<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
10 | ans[2*i+1]=b.at(i);
| ^
/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 = char; _Alloc = std::allocator<char>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<char>&'
211 | operator=(const vector<_Tp, _Alloc>& __x)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<char>&&'
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 = char; _Alloc = std::allocator<char>]'
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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::initializer_list<char>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:13:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
13 | cout<<ans[i];
| ~~~~^~~~~~~~
| | |
| | std::vector<char>
| 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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<char>' 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 | |
s011287097 | p03760 | C++ | #include<iostream>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
vector<char> ans[100];
for(int i=0;i<100;i++){
ans[2*i]=a.at(i);
ans[2*i+1]=b.at(i);
}
for(int i=0;i<a.size()+b.size();i++){
cout<<ans[i];
}
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector<char> ans[100];
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <vector>
2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'char'
6 | vector<char> ans[100];
| ^~~~
a.cc:8:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | ans[2*i]=a.at(i);
| ^~~
| abs
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | cout<<ans[i];
| ^~~
| abs
|
s540103789 | p03760 | C++ | #include <bits/stdc++.h>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begin(), v.end()
#define INF 1e9
using namespace std;
/**
* calculate GCD(greatest common divisor)
* @param a
* @param b
* @return
*/
unsigned euclidean_gcd(unsigned a, unsigned b) {
if (a < b) return euclidean_gcd(b, a);
unsigned r;
while ((r = a % b)) {
a = b;
b = r;
}
return b;
}
/**
* change minimum
* @tparam T
* @param a
* @param b
* @return bool
*/
template<class T>
inline bool changeMinimum(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
/**
* change maximum
* @tparam T
* @param a
* @param b
* @return bool
*/
template<class T>
inline bool changeMaximum(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
/**
* output answer
* @tparam T
* @param answer
* @return
*/
template<typename T>
T output(T answer) {
cout << answer << endl;
return 0;
}
/** ----from here ---------------------------------------------------------- */
int main() {
string O, E;
cin << O << E;
int M;
bool f = false;
if (O.length() == E.length()) {
M = O.length();
} else {
M = O.length() - 1;
f = true;
}
for (int i = 0; i < M; ++i) {
cout << O[i];
cout << E[i];
}
if (f) { cout << O[M]; }
cout << endl;
} | a.cc: In function 'int main()':
a.cc:81:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
81 | cin << O << E;
| ~~~ ^~ ~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::istream {aka std::basic_istream<char>}
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:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/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:81:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
81 | cin << O << E;
| ^~~
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: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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin << O << E;
| ^
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin << O << E;
| ^
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin << O << E;
| ^
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin << O << E;
| ^
/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:81:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin << O << E;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostre |
s637309576 | p03760 | C++ | #include <bits/stdc++.h>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begin(), v.end()
#define INF 1e9
using namespace std;
/**
* calculate GCD(greatest common divisor)
* @param a
* @param b
* @return
*/
unsigned euclidean_gcd(unsigned a, unsigned b) {
if (a < b) return euclidean_gcd(b, a);
unsigned r;
while ((r = a % b)) {
a = b;
b = r;
}
return b;
}
/**
* change minimum
* @tparam T
* @param a
* @param b
* @return bool
*/
template<class T>
inline bool changeMinimum(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
/**
* change maximum
* @tparam T
* @param a
* @param b
* @return bool
*/
template<class T>
inline bool changeMaximum(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
/**
* output answer
* @tparam T
* @param answer
* @return
*/
template<typename T>
T output(T answer) {
cout << answer << endl;
return 0;
}
/** ----from here ---------------------------------------------------------- */
int main() {
string O,E;
cin<<O<<E;
for (int i = 0; i < O.length(); ++i) {
cout<<O[i];
cout<<E[i];
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:81:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
81 | cin<<O<<E;
| ~~~^~~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::istream {aka std::basic_istream<char>}
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:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/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:81:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
81 | cin<<O<<E;
| ^~~
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: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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin<<O<<E;
| ^
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin<<O<<E;
| ^
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin<<O<<E;
| ^
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
81 | cin<<O<<E;
| ^
/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:81:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
81 | cin<<O<<E;
| ^
/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>& __ou |
s600014997 | p03760 | C++ | #include <iostream>
using namespace std;
int main(){
string E,O;
cin>>E>>O;
for ( int i = 0; i < E.size(); i++){
cout << E [i];
}
if ( i < O.size()){
cout << O[i];
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:10: error: 'i' was not declared in this scope
16 | if ( i < O.size()){
| ^
|
s031844509 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string E,O;
cin>>E>>O;
for ( int i = 0; i < E.size(); i++){
cout << E [i];
if ( i < 0.size() cout << 0[i];
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:14: error: unable to find numeric literal operator 'operator""size'
15 | if ( i < 0.size() cout << 0[i];
| ^~~~~~
a.cc:16:10: error: expected primary-expression before '}' token
16 | }
| ^
a.cc:15:36: error: expected ')' before '}' token
15 | if ( i < 0.size() cout << 0[i];
| ~ ^
| )
16 | }
| ~
a.cc:16:10: error: expected primary-expression before '}' token
16 | }
| ^
|
s678880242 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string O,E;
cin>>O>>E;
std::wstring str1 = LO;
std::wstring str2 = LE;
size_t size1 = str1.length();
size_t size2 = str2.length();
for (int i = 0; i < size1:; i++){
for (int j = 0; j < size2:; j++){
if ( i % 2 = 0 ){
cout<<O<<endl;
}
else if ( j % 2 = 0 ){
cout << 0 <<endl;
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:23: error: 'LO' was not declared in this scope; did you mean 'O'?
10 | std::wstring str1 = LO;
| ^~
| O
a.cc:12:23: error: 'LE' was not declared in this scope; did you mean 'E'?
12 | std::wstring str2 = LE;
| ^~
| E
a.cc:19:21: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
19 | for (int i = 0; i < size1:; i++){
| ^
a.cc:19:30: error: expected ';' before ':' token
19 | for (int i = 0; i < size1:; i++){
| ^
| ;
a.cc:19:36: error: expected ';' before ')' token
19 | for (int i = 0; i < size1:; i++){
| ^
| ;
a.cc:21:23: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
21 | for (int j = 0; j < size2:; j++){
| ^
a.cc:21:32: error: expected ';' before ':' token
21 | for (int j = 0; j < size2:; j++){
| ^
| ;
a.cc:21:38: error: expected ';' before ')' token
21 | for (int j = 0; j < size2:; j++){
| ^
| ;
a.cc:23:16: error: lvalue required as left operand of assignment
23 | if ( i % 2 = 0 ){
| ~~^~~
a.cc:29:21: error: lvalue required as left operand of assignment
29 | else if ( j % 2 = 0 ){
| ~~^~~
|
s713427508 | p03760 | C++ | o=list(input())
e=list(input())+[""]
for x,y in zip(o,e):print(x+y,end="") | a.cc:1:1: error: 'o' does not name a type
1 | o=list(input())
| ^
|
s957228831 | p03760 | C++ | o=list(input())
e=list(input())
for x,y in zip(o,e):print(x+y,end="") | a.cc:1:1: error: 'o' does not name a type
1 | o=list(input())
| ^
|
s804426594 | p03760 | C++ | #include<bits/stdc++>h>
using namespace std;
int main(){
string O,E;cin>>O>>E;
int M=O.size(),N=E.size();
for(int i=0;i<N;i++)cout<<O.at(i)<<E.at(i);
if(M>N)cout<<O.at(M);
cout<<endl;
} | a.cc:1:23: warning: extra tokens at end of #include directive
1 | #include<bits/stdc++>h>
| ^
a.cc:1:9: fatal error: bits/stdc++>: No such file or directory
1 | #include<bits/stdc++>h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s539091770 | p03760 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
int O, M;
cin >> O >> M;
for(int i=0; i<M.size(); i++) {
cout << O[i] << M[i];
}
cout << O[O.size()];
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:20: error: request for member 'size' in 'M', which is of non-class type 'int'
8 | for(int i=0; i<M.size(); i++) {
| ^~~~
a.cc:9:14: error: invalid types 'int[int]' for array subscript
9 | cout << O[i] << M[i];
| ^
a.cc:9:22: error: invalid types 'int[int]' for array subscript
9 | cout << O[i] << M[i];
| ^
a.cc:11:15: error: request for member 'size' in 'O', which is of non-class type 'int'
11 | cout << O[O.size()];
| ^~~~
|
s398852292 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string O,E;
cin >> O >> E;
int a=O.size,b=E.size;
for(int i=0;i<a;i++){
cout<< O.at(i) << E.at(i);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:11: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
6 | int a=O.size,b=E.size;
| ^~~~
a.cc:6:20: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
6 | int a=O.size,b=E.size;
| ^~~~
|
s583384125 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string o, e;
cin >> o >> e;
for(int i = 0; i < e.size() && i < o.sizse(); i++){
cout << o[i] << e[i];
}
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:42: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sizse'; did you mean 'size'?
7 | for(int i = 0; i < e.size() && i < o.sizse(); i++){
| ^~~~~
| size
|
s420201891 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a;
string O,E;
cin >> O >> E;
for(int i=0;i<O.size();++i){
cout << O.at(i);
if(i<E.size()){
cout << O.at(i));
}
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before ')' token
11 | cout << O.at(i));
| ^
| ;
|
s704099339 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a;
string O,E;
cin >> O >> E;
for(int i=0;i<O.size();++i){
cout << O.at(i);
}
if(i<E.size()){
cout << O.at(i));
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:11:10: error: 'i' was not declared in this scope
11 | if(i<E.size()){
| ^
|
s373261301 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string O,E,a;
cin >> O >> E;
a = O.size();
for(int i=0;i<a-1;++i){
cout << O.at(i);
cout << E.at(i);
}
if(O.size()>E.size()){
cout << O.at(a);
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:8:22: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
8 | for(int i=0;i<a-1;++i){
| ~^~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | for(int i=0;i<a-1;++i){
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)'
370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)'
379 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)'
388 | operator-(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: mismatched types 'const std::complex<_Tp>' and 'int'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)'
465 | operator-(const complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
8 | for(int i=0;i<a-1;++i){
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:8:23: note: mismatched types 'const std::valarray<_Tp>' and 'int'
8 | for(int i=0;i<a-1;++i){
| ^
a.cc:13:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::at(std::string&)'
13 | cout << O.at(a);
| ~~~~^~~
In file included 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/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _A |
s058182500 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int j;
string O,E;
cin >> O >> E;
for(int i=0;i<O.size();++i){
if(E.size(i)<E.size()){
cout << O.at(i);
cout << E.at(i);
}
else{
cout <<O.at(i);
}
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
9 | if(E.size(i)<E.size()){
| ~~~~~~^~~
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1076 | size() const _GLIBCXX_NOEXCEPT
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate expects 0 arguments, 1 provided
|
s097822766 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int j;
string O,E;
cin >> O >> E;
for(int i=0;i<O.size();++i){
if(E.size(i)<=E.size()){
cout << O.at(i);
cout << E.at(i);
}
else{
cout <<O.at(i);
}
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
9 | if(E.size(i)<=E.size()){
| ~~~~~~^~~
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1076 | size() const _GLIBCXX_NOEXCEPT
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate expects 0 arguments, 1 provided
|
s335752911 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int j;
string O,S;
cin >> O >> S;
if(O==S){
for(int i=0;i<O.size();++i){
cout << O.at(i);
cout << S.at(i);
}
}
else{
for(int i=0;i=<O.size();++i){
cout << O.at(i);
cout << S.at(i);
j=i;
}
cout << O.at(j+1);
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:15:21: error: expected primary-expression before '<' token
15 | for(int i=0;i=<O.size();++i){
| ^
|
s025140926 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string O,S,j;
cin >> O >> S;
if(O==S){
for(int i=0;i<O.size();++i){
cout << O.at(i);
cout << S.at(i);
}
}
else{
for(int i=0;i<O.size()-1;++i){
cout << O.at(i);
cout << S.at(i);
j=i;
}
cout << O.at(j+1);
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:19:21: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
19 | cout << O.at(j+1);
| ~^~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
19 | cout << O.at(j+1);
| ^
In file included 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/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const _CharT*' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3726 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const _CharT*' and 'int'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
19 | cout << O.at(j+1);
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)'
340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
19 | cout << O.at(j+1);
| ^
/usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const _Tp& |
s356136627 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string O,S;
cin >> O >> S;
if(O==S){
for(int i=0;i<O.size();++i){
cout << O.at(i);
cout << S.at(i);
}
}
else{
for(int i=0;i<O.size()-1;++i){
cout << O.at(i);
cout << S.at(i);
}
cout << O.at(i+1);
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:18:20: error: 'i' was not declared in this scope
18 | cout << O.at(i+1);
| ^
|
s972018558 | p03760 | C++ | using namespace std;
int main(){
strings O,S;
cin >> O >> S;
for(int i=0;i<O.size();++i){
cout<<O.at(i)+S.at(i);
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'strings' was not declared in this scope
4 | strings O,S;
| ^~~~~~~
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin >> O >> S;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:5:12: error: 'O' was not declared in this scope
5 | cin >> O >> S;
| ^
a.cc:5:17: error: 'S' was not declared in this scope
5 | cin >> O >> S;
| ^
a.cc:7:9: error: 'cout' was not declared in this scope
7 | cout<<O.at(i)+S.at(i);
| ^~~~
a.cc:7:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:5: error: 'cout' was not declared in this scope
9 | cout<<endl;
| ^~~~
a.cc:9:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:11: error: 'endl' was not declared in this scope
9 | cout<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s742475039 | p03760 | C++ | using namespace std;
int main(){
string O,S;
cin >> O >> S;
for(int i=0;i<O.size();++i){
cout<<O.at(i)+S.at(i);
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'string' was not declared in this scope
4 | string O,S;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using namespace std;
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin >> O >> S;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:5:12: error: 'O' was not declared in this scope
5 | cin >> O >> S;
| ^
a.cc:5:17: error: 'S' was not declared in this scope
5 | cin >> O >> S;
| ^
a.cc:7:9: error: 'cout' was not declared in this scope
7 | cout<<O.at(i)+S.at(i);
| ^~~~
a.cc:7:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:5: error: 'cout' was not declared in this scope
9 | cout<<endl;
| ^~~~
a.cc:9:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:11: error: 'endl' was not declared in this scope
9 | cout<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s756786137 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long MOD = 998244353;
const long long INF = 1LL << 60;
const int inf = pow(10, 9) + 7;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}
int main()
{
string O, E;
cin >> O >> E;
for (int i = 0; i < N; i++)
{
if (i % 2 == 0) cout << O.at(i / 2);
else cout << E.at(i / 2);
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:19:23: error: 'N' was not declared in this scope
19 | for (int i = 0; i < N; i++)
| ^
|
s021943849 | p03760 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
using namespace std;
string a,b;
int main()
{
cin >> a >> b;
int al = a.length();
int bl = b.length();
for (int i = 0;i < bl;i++)
{
cout << a[i] << b[i];
}
if (a > b) cout << a[l] << endl;
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:30: error: 'l' was not declared in this scope; did you mean 'bl'?
16 | if (a > b) cout << a[l] << endl;
| ^
| bl
|
s027066657 | p03760 | C++ | #include <iostream>
using namespace std;
#include <string>
int main() {
string s1, s2;
cin >> s1 >> s2;
int size = s1.size();
string rslt;
for(int i=1;i<=size;i++){
if(i%2==1) rslt += s1.subset(i-1,1);
else if(i%2==0) rslt += s2.subset(i-1,1);
}
cout << rslt;
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
13 | if(i%2==1) rslt += s1.subset(i-1,1);
| ^~~~~~
| substr
a.cc:14:44: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
14 | else if(i%2==0) rslt += s2.subset(i-1,1);
| ^~~~~~
| substr
|
s348216467 | p03760 | C++ | #include <iostream>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
int size = s1.size();
string rslt;
for(int i=1;i<=size;i++){
if(i%2==1) rslt += s1.subset(i-1,1);
else if(i%==0) rslt += s2.subset(i-1,1);
}
cout << rslt;
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
12 | if(i%2==1) rslt += s1.subset(i-1,1);
| ^~~~~~
| substr
a.cc:13:28: error: expected primary-expression before '=' token
13 | else if(i%==0) rslt += s2.subset(i-1,1);
| ^
a.cc:13:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
13 | else if(i%==0) rslt += s2.subset(i-1,1);
| ^~~~~~
| substr
|
s670333351 | p03760 | C++ | #include <iostream>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
int size = s1.size();
string rslt;
for(i=1;i<=size;i++){
if(i%2==1) rslt += s1.subset(i-1,1);
else if(i%==0) rslt += s2.subset(i-1,1);
}
cout << rslt;
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:13: error: 'i' was not declared in this scope
11 | for(i=1;i<=size;i++){
| ^
a.cc:12:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
12 | if(i%2==1) rslt += s1.subset(i-1,1);
| ^~~~~~
| substr
a.cc:13:28: error: expected primary-expression before '=' token
13 | else if(i%==0) rslt += s2.subset(i-1,1);
| ^
a.cc:13:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
13 | else if(i%==0) rslt += s2.subset(i-1,1);
| ^~~~~~
| substr
|
s456748388 | p03760 | C++ | #include <iostream>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
int size = s1.size();
string rslt;
for(i=1;i<=size;i++){
if(i%2==1) rslt += s1.subset(i-1,1);
else if(i%==0) rslt += s2.subset(i-1,1);
}
cout << rslt;
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:13: error: 'i' was not declared in this scope
11 | for(i=1;i<=size;i++){
| ^
a.cc:12:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
12 | if(i%2==1) rslt += s1.subset(i-1,1);
| ^~~~~~
| substr
a.cc:13:28: error: expected primary-expression before '=' token
13 | else if(i%==0) rslt += s2.subset(i-1,1);
| ^
a.cc:13:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subset'; did you mean 'substr'?
13 | else if(i%==0) rslt += s2.subset(i-1,1);
| ^~~~~~
| substr
|
s658445673 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string o, e, ans(o.size() + e.size());
cin >> o >> e;
int i;
for(i = 0; i < o.size(); i++){
ans.at(2 * i) = o.at(i);
}
for(i = 0; i < e.size(); i++){
ans.at(2 * i + 1) = e.at(i);
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:5:39: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(std::__cxx11::basic_string<char>::size_type)'
5 | string o, e, ans(o.size() + e.size());
| ^
In file included 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,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
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/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = long unsigned int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:5:29: note: cannot convert '(o.std::__cxx11::basic_string<char>::size() + e.std::__cxx11::basic_string<char>::size())' (type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) to type 'const char*'
5 | string o, e, ans(o.size() + e.size());
| ~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char> |
s564021784 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string o, e, ans;
cin >> o >> e;
ans.size() = o.size() + e.size();
int i;
for(i = 0; i < o.size(); i++){
ans.at(2 * i) = o.at(i);
}
for(i = 0; i < e.size(); i++){
ans.at(2 * i + 1) = e.at(i);
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:8:11: error: lvalue required as left operand of assignment
8 | ans.size() = o.size() + e.size();
| ~~~~~~~~^~
|
s734354636 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string o, e, ans;
cin >> o >> e;
ans.size() = o.size() + e.size()
int i;
for(i = 0; i < o.size(); i++){
ans.at(2 * i) = o.at(i);
}
for(i = 0; i < e.size(); i++){
ans.at(2 * i + 1) = e.at(i);
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:8:11: error: lvalue required as left operand of assignment
8 | ans.size() = o.size() + e.size()
| ~~~~~~~~^~
a.cc:11:7: error: 'i' was not declared in this scope
11 | for(i = 0; i < o.size(); i++){
| ^
a.cc:14:7: error: 'i' was not declared in this scope
14 | for(i = 0; i < e.size(); i++){
| ^
|
s425773682 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string O,E,A;
cin >> O >> E;
for (int i;i<O.size()+E.size();i++){
if (i%2=0){
A[i]=O[i/2];
}
else{
A[i]=E[i/2];
}
cout << A;
} | a.cc: In function 'int main()':
a.cc:8:14: error: lvalue required as left operand of assignment
8 | if (i%2=0){
| ~^~
a.cc:15:6: error: expected '}' at end of input
15 | }
| ^
a.cc:4:19: note: to match this '{'
4 | int main(){
| ^
|
s366599537 | p03760 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
int i;
char odd[55],even[55];
gets(odd);
gets(even);
for(i=0;odd[i]!='\0'&&even[i]!='\0';i++){
printf("%c",odd[i]);
printf("%c",even[i]);
}
if(odd[i]!='\0'){
printf("%c",odd[i]);
}
if(even[i]!='\0'){
printf("%c",even[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(odd);
| ^~~~
| getw
|
s101200248 | p03760 | C++ | #include<cstdio>
int main(){
int i;
char odd[55],even[55];
gets(odd);
gets(even);
for(i=0;odd[i]!='\0'&&even[i]!='\0';i++){
printf("%c",odd[i]);
printf("%c",even[i]);
}
if(odd[i]!='\0'){
printf("%c",odd[i]);
}
if(even[i]!='\0'){
printf("%c",even[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(odd);
| ^~~~
| getw
|
s924862595 | p03760 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string o,e;
cin >> o >> e;
for(int i=0; i<o.length()+e.length(); i++) {
if(i%2==0) {
cout << o[i/2];
}
else {
cout << e[i/2];
}
}
| a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s980636265 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main () {
string o,e;
cin >> o >> e;
vector<int>ans;
for(int i=0;i<o.size();i++){
ans.push_back(o[i]);
ans.push_back(e[i]);
}
cout << ans;
}
| a.cc: In function 'int main()':
a.cc:13:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>')
13 | cout << ans;
| ~~~~ ^~ ~~~
| | |
| | std::vector<int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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 = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::nullptr_t'
306 | operator<<(nullptr_t)
| ^~~~~~~~~
/usr/ |
s847288528 | p03760 | C++ | #include<bits/stdc++.h>
using namespace std;
int main () {
string o,e;
cin >> o >> e;
stirng ans;
for(int i=0;i<o.size();i++){
ans.push_back(o[i]);
ans.push_back(e[i]);
}
cout << ans;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'stirng' was not declared in this scope
7 | stirng ans;
| ^~~~~~
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans.push_back(o[i]);
| ^~~
| abs
a.cc:13:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | cout << ans;
| ^~~
| abs
|
s430871036 | p03760 | C | #include<stdio.h>
int main(){
int lenO, lenE;
char o[50], e[50], pas[100];
scanf("%s", o);
scanf("%s", e);
for(lenO=0; o[lenO]!='\0'; lenO++);
for(lenE=0; o[lenE]!='\0'; lenE++);
for(int i=0; i<lenO+lenE; i++){
if(i%2 == 0){
if(o[i/2] !='\0') pas[i] = o[i/2];
else pas[i] = e[i/2];
}
else pas[i] = e[i/2];
}
pas[lenO+lenE] = '\0'
printf("%s",pas);
return 0;
} | main.c: In function 'main':
main.c:19:26: error: expected ';' before 'printf'
19 | pas[lenO+lenE] = '\0'
| ^
| ;
20 |
21 | printf("%s",pas);
| ~~~~~~
|
s807440554 | p03760 | C | #include<stdio.h>
int main(){
int lenO, lenE;
char o[50], e[50], pas[100];
scanf("%s", o);
scanf("%s", e);
for(int i=0; i<100; i++){
if(i%2 == 0 && o[i/2] !='\0') pas[i] = o[i/2];
else if(&& e[i/2] !='\0') pas[i] = e[i/2];
}
printf("%s",pas);
return 0;
}
| main.c: In function 'main':
main.c:11:21: error: expected ')' before '[' token
11 | else if(&& e[i/2] !='\0') pas[i] = e[i/2];
| ~ ^
| )
main.c:11:9: error: label 'e' used but not defined
11 | else if(&& e[i/2] !='\0') pas[i] = e[i/2];
| ^~~~
|
s634216888 | p03760 | C | #include<stdio.h>
int main(){
int lenO, lenE
char o[50], e[50], pas[100];
scanf("%s", o);
scanf("%s", e);
for(int i=0; i<100; i++){
if(i%2 == 1) pas[i] = o[i/2];
else pas[i] = e[i/2];
}
printf("%s",pas);
return 0;
}
| main.c: In function 'main':
main.c:5:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char'
5 | char o[50], e[50], pas[100];
| ^~~~
main.c:6:17: error: 'o' undeclared (first use in this function)
6 | scanf("%s", o);
| ^
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:17: error: 'e' undeclared (first use in this function)
7 | scanf("%s", e);
| ^
main.c:10:22: error: 'pas' undeclared (first use in this function)
10 | if(i%2 == 1) pas[i] = o[i/2];
| ^~~
|
s182275070 | p03760 | Java | class Main {
public static void main(String[] args) {
java.util.Scanner sc = new java.util.Scanner(System.in);
String str1 = sc.next();
String str2 = sc.next();
int l1 = str1.length();
int l2 = str2.length();
for(int i=0; i<l2; i++){
print(str1.charAt(i));
print(str2.charAt(i));
}
if(l1 - l2 == 1){
print(str1.charAt( l1 ) );
}
/* 以下、標準出力用関数 */
static public void print(byte what) { System.out.print(what); System.out.flush(); }
static public void print(boolean what) { System.out.print(what); System.out.flush(); }
static public void print(char what) { System.out.print(what); System.out.flush(); }
static public void print(int what) { System.out.print(what); System.out.flush(); }
static public void print(long what) { System.out.print(what); System.out.flush(); }
static public void print(float what) { System.out.print(what); System.out.flush(); }
static public void print(double what) { System.out.print(what); System.out.flush(); }
static public void print(String what) { System.out.print(what); System.out.flush(); }
static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); }
static public void println() { System.out.println(); }
static public void println(byte what) { System.out.println(what); System.out.flush(); }
static public void println(boolean what) { System.out.println(what); System.out.flush(); }
static public void println(char what) { System.out.println(what); System.out.flush(); }
static public void println(int what) { System.out.println(what); System.out.flush(); }
static public void println(long what) { System.out.println(what); System.out.flush(); }
static public void println(float what) { System.out.println(what); System.out.flush(); }
static public void println(double what) { System.out.println(what); System.out.flush(); }
static public void println(String what) { System.out.println(what); System.out.flush(); }
static public void println(Object... variables) { print(variables); println(); }
static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } }
static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }}
| Main.java:18: error: illegal start of expression
static public void print(byte what) { System.out.print(what); System.out.flush(); }
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.