submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s481631928
|
p04012
|
C++
|
#include<iostream>
#include<map>
#include<string>
using namespace std;
int main(){
map<char,int> mp;
string s;
cin>>s;
for(int i=0;i<s.size;i++){
mp[s.substr(i,1)]++;
}
int total=0;
for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
total+=itr->second;
}
if(total%2==0)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
|
a.cc: In function 'int main()':
a.cc:9:19: 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 '()' ?)
9 | for(int i=0;i<s.size;i++){
| ~~^~~~
| ()
a.cc:10:7: error: no match for 'operator[]' (operand types are 'std::map<char, int>' and 'std::__cxx11::basic_string<char>')
10 | mp[s.substr(i,1)]++;
| ^
In file included from /usr/include/c++/14/map:63,
from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
504 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'const std::map<char, int>::key_type&' {aka 'const char&'}
504 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
524 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'std::map<char, int>::key_type&&' {aka 'char&&'}
524 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
|
s845365506
|
p04012
|
C++
|
#inclue<bits/stdc++.h>
using namespace std;
int main() {
string w;
bool check;
int cnt[26] = { };
cin >> w;
for (auto x : w) {
cnt[x % 26]++;
}
for (int i = 0; i < 26; i++) {
if (cnt[i] % 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
|
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
1 | #inclue<bits/stdc++.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
5 | string w;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | #inclue<bits/stdc++.h>
a.cc:8:9: error: 'cin' was not declared in this scope
8 | cin >> w;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #inclue<bits/stdc++.h>
a.cc:8:16: error: 'w' was not declared in this scope
8 | cin >> w;
| ^
a.cc:14:25: error: 'cout' was not declared in this scope
14 | cout << "No" << endl;
| ^~~~
a.cc:14:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:41: error: 'endl' was not declared in this scope
14 | cout << "No" << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #inclue<bits/stdc++.h>
a.cc:18:9: error: 'cout' was not declared in this scope
18 | cout << "Yes" << endl;
| ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:26: error: 'endl' was not declared in this scope
18 | cout << "Yes" << endl;
| ^~~~
a.cc:18:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s621158464
|
p04012
|
C++
|
<?php
$input = file_get_contents('php://stdin');
$counts = count_chars($input, 1);
echo count(array_unique($counts)) === 1 ? 'Yes' : 'No';
|
a.cc:3:28: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
3 | $input = file_get_contents('php://stdin');
| ^~~~~~~~~~~~~
a.cc:5:43: warning: multi-character character constant [-Wmultichar]
5 | echo count(array_unique($counts)) === 1 ? 'Yes' : 'No';
| ^~~~~
a.cc:5:51: warning: multi-character character constant [-Wmultichar]
5 | echo count(array_unique($counts)) === 1 ? 'Yes' : 'No';
| ^~~~
a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:4:1: error: '$counts' does not name a type; did you mean 'const'?
4 | $counts = count_chars($input, 1);
| ^~~~~~~
| const
a.cc:5:1: error: 'echo' does not name a type
5 | echo count(array_unique($counts)) === 1 ? 'Yes' : 'No';
| ^~~~
|
s729760530
|
p04012
|
C++
|
#include <iostream>
#include <string.h>
int a[30];
string s;
int main(){
cin >> s;
for(int i=0;i<s.size();i++) a[s[i]-'a']++;
for(int i=0;i<30;i++) if(a[i]%2){cout << "No" << endl; return 0;}
cout << "Yes" << endl;
return 0;
}
|
a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
4 | string s;
| ^~~~~~
| stdin
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> s;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:16: error: 's' was not declared in this scope
7 | cin >> s;
| ^
a.cc:9:42: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | for(int i=0;i<30;i++) if(a[i]%2){cout << "No" << endl; return 0;}
| ^~~~
| 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:58: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | for(int i=0;i<30;i++) if(a[i]%2){cout << "No" << endl; return 0;}
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout << "Yes" << 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:11:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << "Yes" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s799287815
|
p04012
|
C++
|
#include <iostream>
int a[30];
string s;
int main(){
cin >> s;
for(int i=0;i<s.size();i++) a[s[i]-'a']++;
for(int i=0;i<30;i++) if(a[i]%2){cout << "No" << endl; return 0;}
cout << "Yes" << endl;
return 0;
}
|
a.cc:3:1: error: 'string' does not name a type; did you mean 'stdin'?
3 | string s;
| ^~~~~~
| stdin
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> s;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:16: error: 's' was not declared in this scope
6 | cin >> s;
| ^
a.cc:8:42: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | for(int i=0;i<30;i++) if(a[i]%2){cout << "No" << endl; return 0;}
| ^~~~
| 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:58: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | for(int i=0;i<30;i++) if(a[i]%2){cout << "No" << endl; return 0;}
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:10:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout << "Yes" << 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:10:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | cout << "Yes" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s177616169
|
p04012
|
C++
|
#include <bits/stdc++.h>
#include <algorithm>
#include <stdio.h>
#include <math.h>
using namespace std;
#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
typedef long long ll;
typedef pair<int,int> P;
typedef pair<P,int> PP;
struct edge {
int to,cost;
edge(int t,int c):to(t),cost(c) {}
};
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};
int ddx[]={1,1,1,0,-1,-1,-1,0},ddy[]={1,0,-1,-1,-1,0,1,1};
ll mypow(ll x,ll n,ll m) { //xのn乗をmで割った余り
if(n==0) return 1;
if(n%2==0) return mypow(x*x%m,n/2,m);
else return x*mypow(x,n-1,m)%m;
}
//-----------------------------------------------------------------------------
string w;
int cnt[26];
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin>>w;
REP(i,w.size()) cnt[s[i]-'a']++;
REP(i,26) {
if(cnt[i]&1) {
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:46:29: error: 's' was not declared in this scope
46 | REP(i,w.size()) cnt[s[i]-'a']++;
| ^
|
s157863588
|
p04012
|
C++
|
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
int main(){
string s;
cin >> s;
int count[26];
fill(count,count+26,0);
for(int i=0;i<s.length();i++) count[s[i]%26]++;
for(int i=0;i<al.length();i++){
if(count[i]%2){
puts("No");
return 0;
}
}
puts("Yes");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:19: error: 'al' was not declared in this scope
12 | for(int i=0;i<al.length();i++){
| ^~
|
s817306137
|
p04012
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int n,m;
double deg;
cin >> n >> m;
if(n>=12){
n-=12;
}
n*=360/12;//30
n+=m/30
m*=360/60;//6
deg=n-m;
if(deg<0){
deg*=-1;
}
cout<<deg;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:12: error: expected ';' before 'm'
14 | n+=m/30
| ^
| ;
15 | m*=360/60;//6
| ~
|
s424773727
|
p04012
|
C++
|
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<array>
#include<vector>
#include<functional>
#include<unordered_map>
#include<map>
#include<numeric>
#include<limits>
#include<utility>
#include<queue>
#include<random>
#include<math.h>
#include "Source.h"
using namespace std;
int main() {
string s;
cin >> s;
while (s.size()%2==0)
{
if (s.find(s.front()) == string::npos)break;
s.erase(s.begin()+s.find(s.front(),1));
s.erase(s.begin());
if (s.size() == 0) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
|
a.cc:16:10: fatal error: Source.h: No such file or directory
16 | #include "Source.h"
| ^~~~~~~~~~
compilation terminated.
|
s557510573
|
p04012
|
C++
|
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
string w;
cin >> w;
int len = w.length();
sort(w, w+len);
for(int i = 0;i < len-1;i+=2){
if(w[i] != w[i+1]) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:14: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
14 | sort(w, w+len);
| ~^~~~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/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:14:15: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
14 | sort(w, w+len);
| ^~~
In file included from /usr/include/c++/14/string:54:
/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:14:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'const _CharT*' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: mismatched types 'const _CharT*' and 'int'
14 | sort(w, w+len);
| ^~~
/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:14:15: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
14 | sort(w, w+len);
| ^~~
|
s188679578
|
p04012
|
C++
|
#include<stdio.h>
#include<string.h>
int main()
{
char s[100];
int a;
gets(s);
a = strlen(s);
if(a%2 == 0)
printf("Yes");
else
printf("No");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s500168420
|
p04012
|
C++
|
#include<stdio.h>
int main()
{
char s[100];
int a;
gets(s);
a = strlen(s);
if(a%2 == 0)
printf("Yes");
else
printf("No");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(s);
| ^~~~
| getw
a.cc:7:9: error: 'strlen' was not declared in this scope
7 | a = strlen(s);
| ^~~~~~
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()
|
s061073449
|
p04012
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int ara[100000];
char ara1[100000];
int main()
{
int i,j,k,a,b,h,ln,v=0;
char ch;
gets(ara1);
ln=strlen(ara1);
for(i=0;i<ln;i++)
{
for(ch='a',j=1;ch<='z';ch++,j++)
{
if(ara1[i]==ch)
{
ara[j]++;
break;
}
}
}
for(i=1;i<=26;i++)
{
if(ara[i]%2!=0)
{
v=1;
break;
}
}
if(v==1)
{
printf("No\n");
}
else
{
printf("Yes\n");
}
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(ara1);
| ^~~~
| getw
|
s825187324
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.next();
char[] ar = a.toCharArray();
loop: for (int i = 0;i < ar.length;i++) {
int y = 0;
for (int m = 0;m < ar.length;m++) {
if(ar[i] == ar[m]) {
y += 1;
}
if(m == ar.length-1) {
if(y % 2 == 1) {
System.out.println("No");
return;
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:17: error: unreachable statement
break loop;
^
1 error
|
s823060730
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.nextLine();
char[] ar = a.toCharArray();
loop: for (int i = 0;i < ar.length;i++) {
int y = 0;
for (int m = 0;m < ar.length;m++) {
if(ar[n] == ar[m]) {
y += 1;
}
if(m == ar[ar.length]) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:10: error: cannot find symbol
if(ar[n] == ar[m]) {
^
symbol: variable n
location: class Main
1 error
|
s466821665
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.nextLine();
char[] ar = a.toCharArray();
loop: for (int i = 0;i < ar.length;i++) {
int y = 0;
for (int m = 0;m < ar.length;m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:10: error: cannot find symbol
if(ar[n].equals(ar[m])) {
^
symbol: variable n
location: class Main
Main.java:10: error: char cannot be dereferenced
if(ar[n].equals(ar[m])) {
^
Main.java:13: error: int cannot be dereferenced
if(m.equals(ar[ar.length])) {
^
3 errors
|
s616031965
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.nextLine();
char[] ar = a.toCharArray();
loop: for (int i = 0;i < ar.length();i++) {
int y = 0;
for (int m = 0;m < ar.length();m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length()])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:7: error: cannot find symbol
loop: for (int i = 0;i < ar.length();i++) {
^
symbol: method length()
location: variable ar of type char[]
Main.java:9: error: cannot find symbol
for (int m = 0;m < ar.length();m++) {
^
symbol: method length()
location: variable ar of type char[]
Main.java:10: error: cannot find symbol
if(ar[n].equals(ar[m])) {
^
symbol: variable n
location: class Main
Main.java:10: error: char cannot be dereferenced
if(ar[n].equals(ar[m])) {
^
Main.java:13: error: cannot find symbol
if(m.equals(ar[ar.length()])) {
^
symbol: method length()
location: variable ar of type char[]
Main.java:13: error: int cannot be dereferenced
if(m.equals(ar[ar.length()])) {
^
6 errors
|
s246897117
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.nextLine();
String[] ar = a.split("");
loop: for (int i = 0;i < ar.length();i++) {
int y = 0;
for (int m = 0;m < ar.length();m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length()])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:7: error: cannot find symbol
loop: for (int i = 0;i < ar.length();i++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:9: error: cannot find symbol
for (int m = 0;m < ar.length();m++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:10: error: cannot find symbol
if(ar[n].equals(ar[m])) {
^
symbol: variable n
location: class Main
Main.java:13: error: cannot find symbol
if(m.equals(ar[ar.length()])) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:13: error: int cannot be dereferenced
if(m.equals(ar[ar.length()])) {
^
5 errors
|
s274588219
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.nextLine();
String[] ar = a.split("");
loop: for (int i = 0;i < ar.length();i++) {
int y = 0;
for (int m = 0;m < ar.length();m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length()])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:7: error: cannot find symbol
loop: for (int i = 0;i < ar.length();i++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:9: error: cannot find symbol
for (int m = 0;m < ar.length();m++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:10: error: cannot find symbol
if(ar[n].equals(ar[m])) {
^
symbol: variable n
location: class Main
Main.java:13: error: cannot find symbol
if(m.equals(ar[ar.length()])) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:13: error: int cannot be dereferenced
if(m.equals(ar[ar.length()])) {
^
5 errors
|
s240882781
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.nextLine();
String[] ar = a.split("");
loop: for(int i = 0;i < ar.length();i++) {
int y = 0;
for(int m = 0;m < ar.length();m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length()])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:7: error: cannot find symbol
loop: for(int i = 0;i < ar.length();i++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:9: error: cannot find symbol
for(int m = 0;m < ar.length();m++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:10: error: cannot find symbol
if(ar[n].equals(ar[m])) {
^
symbol: variable n
location: class Main
Main.java:13: error: cannot find symbol
if(m.equals(ar[ar.length()])) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:13: error: int cannot be dereferenced
if(m.equals(ar[ar.length()])) {
^
5 errors
|
s172871108
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = s.nextLine();
String[] ar = str.split("");
loop: for(int i = 0;i < ar.length();i++) {
int y = 0;
for(int m = 0;m < ar.length();m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length()])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:6: error: cannot find symbol
String[] ar = str.split("");
^
symbol: variable str
location: class Main
Main.java:7: error: cannot find symbol
loop: for(int i = 0;i < ar.length();i++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:9: error: cannot find symbol
for(int m = 0;m < ar.length();m++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:10: error: cannot find symbol
if(ar[n].equals(ar[m])) {
^
symbol: variable n
location: class Main
Main.java:13: error: cannot find symbol
if(m.equals(ar[ar.length()])) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:13: error: int cannot be dereferenced
if(m.equals(ar[ar.length()])) {
^
6 errors
|
s299592894
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = Scanner.nextLine();
String[] ar = str.split("");
loop: for(int i = 0;i < ar.length();i++) {
int y = 0;
for(int m = 0;m < ar.length();m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length()])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:5: error: non-static method nextLine() cannot be referenced from a static context
String a = Scanner.nextLine();
^
Main.java:6: error: cannot find symbol
String[] ar = str.split("");
^
symbol: variable str
location: class Main
Main.java:7: error: cannot find symbol
loop: for(int i = 0;i < ar.length();i++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:9: error: cannot find symbol
for(int m = 0;m < ar.length();m++) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:10: error: cannot find symbol
if(ar[n].equals(ar[m])) {
^
symbol: variable n
location: class Main
Main.java:13: error: cannot find symbol
if(m.equals(ar[ar.length()])) {
^
symbol: method length()
location: variable ar of type String[]
Main.java:13: error: int cannot be dereferenced
if(m.equals(ar[ar.length()])) {
^
7 errors
|
s171776309
|
p04012
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String a = Scanner.nextLine();
String[] ar = str.split("");
loop for(int i = 0;i < ar.length();i++) {
int y = 0;
for(int m = 0;m < ar.length();m++) {
if(ar[n].equals(ar[m])) {
y += 1;
}
if(m.equals(ar[ar.length()])) {
if(y % 2 == 1) {
System.out.println("No");
break loop;
}
}
}
}
System.out.println("Yes");
}
}
|
Main.java:7: error: not a statement
loop for(int i = 0;i < ar.length();i++) {
^
Main.java:7: error: ';' expected
loop for(int i = 0;i < ar.length();i++) {
^
2 errors
|
s501584679
|
p04012
|
C++
|
string abc = "abcdefghijklmnopqrstuvwxyz";
vector<int> cc(abc.length(),0);
string s;
cin >> s;
REP(i,s.length()){
REP(j,abc.length()){
if(s[i] == abc[j]){ cc[j]++; break; }
}
}
bool clear = true;
REP(i,abc.length()){
if(cc[i] % 2 != 0){
clear = false;
break;
}
}
if(clear = false) cout << "No" << endl;
else cout << "Yes" << endl;
|
a.cc:2:1: error: 'string' does not name a type
2 | string abc = "abcdefghijklmnopqrstuvwxyz";
| ^~~~~~
a.cc:3:1: error: 'vector' does not name a type
3 | vector<int> cc(abc.length(),0);
| ^~~~~~
a.cc:4:1: error: 'string' does not name a type
4 | string s;
| ^~~~~~
a.cc:5:1: error: 'cin' does not name a type
5 | cin >> s;
| ^~~
a.cc:6:4: error: expected constructor, destructor, or type conversion before '(' token
6 | REP(i,s.length()){
| ^
a.cc:12:4: error: expected constructor, destructor, or type conversion before '(' token
12 | REP(i,abc.length()){
| ^
a.cc:18:1: error: expected unqualified-id before 'if'
18 | if(clear = false) cout << "No" << endl;
| ^~
a.cc:19:1: error: expected unqualified-id before 'else'
19 | else cout << "Yes" << endl;
| ^~~~
|
s868066900
|
p04012
|
Java
|
package atcoder;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;
public class Main001 {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
FastScanner in = new FastScanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
TaskB solver = new TaskB();
solver.solve(1, in, out);
out.close();
}
static class TaskB {
public void solve(int testNumber, FastScanner in, PrintWriter out) {
char[] c = in.next().toCharArray();
int[] num = new int[26];
for (int i = 0; i < c.length; i++) {
num[c[i] - 'a']++;
}
boolean isBeautiful = true;
for (int i = 0; i < num.length; i++) {
if (num[i] % 2 != 0) {
isBeautiful = false;
break;
}
}
System.out.println(isBeautiful ? "Yes" : "No");
}
}
static class FastScanner {
private BufferedReader in;
private StringTokenizer st;
public FastScanner(InputStream stream) {
in = new BufferedReader(new InputStreamReader(stream));
}
public String next() {
while (st == null || !st.hasMoreTokens()) {
try {
String rl = in.readLine();
if (rl == null) {
return null;
}
st = new StringTokenizer(rl);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return st.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
}
}
|
Main.java:16: error: class Main001 is public, should be declared in a file named Main001.java
public class Main001 {
^
1 error
|
s355244043
|
p04012
|
Java
|
package atcoder;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;
public class Main001 {
public static void main(String[] args) {
InputStream inputStream = System.in;
FastScanner in = new FastScanner(inputStream);
char[] c = in.next().toCharArray();
int[] num = new int[26];
for (int i = 0; i < c.length; i++) {
num[c[i] - 'a']++;
}
boolean isBeautiful = true;
for (int i = 0; i < num.length; i++) {
if (num[i] % 2 != 0) {
isBeautiful = false;
break;
}
}
System.out.println(isBeautiful ? "Yes" : "No");
}
static class FastScanner {
private BufferedReader in;
private StringTokenizer st;
public FastScanner(InputStream stream) {
in = new BufferedReader(new InputStreamReader(stream));
}
public String next() {
while (st == null || !st.hasMoreTokens()) {
try {
String rl = in.readLine();
if (rl == null) {
return null;
}
st = new StringTokenizer(rl);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return st.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
}
}
|
Main.java:16: error: class Main001 is public, should be declared in a file named Main001.java
public class Main001 {
^
1 error
|
s171668958
|
p04012
|
C++
|
// clang-format off
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
// clang-format on
int main() {
int key;
string s;
cin >> s;
int w = s.size();
sort(s, s + w);
for (int i = 1; i < s.size(); i++) {
key = 0;
if (s[i] != s[i - 1]) {
if (key % 2 == 1) {
cout << "NO" << endl;
return 0;
} else if (key % 2 == 0) {
key = 0;
}
} else if (s[i] == s[i - 1]) {
key += 1;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:13: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
12 | sort(s, s + w);
| ~ ^ ~
| | |
| | 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:2:
/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:12:15: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
12 | sort(s, s + w);
| ^
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:12:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'const _CharT*' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: mismatched types 'const _CharT*' and 'int'
12 | sort(s, s + w);
| ^
/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:12:15: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
12 | sort(s, s + w);
| ^
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:12:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
12 | sort(s, s + w);
| ^
/usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const _Tp&)'
349 | operator+(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:349:5: note: template argument deduction/substitution failed:
a.cc:12:15: note: 'std::string' {aka 'std::__cxx11::basic_string<c
|
s972928567
|
p04012
|
C++
|
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
string str;
cin >> str;
int arr[26];
memset(arr,0,sizeof(arr));
for(int i=0;i<str.length();i++)
{
arr[str[i]-97]++;
}
int p=0;
for(int i=0;i<26;i++)
{
if(arr[i]%2!=0)
{
p=1;
break;
}
}
if(p==0)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:3: error: 'memset' was not declared in this scope
13 | memset(arr,0,sizeof(arr));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <algorithm>
+++ |+#include <cstring>
5 | #define ll long long
|
s937962334
|
p04012
|
C++
|
#include <iostream>
#include <math.h>
#include <unordered_map>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::sort;
int main()
{
string w;
string ans = "Yes";
cin >> w;
sort(w.begin(), w.end());
char prev = w[0];
for(int i = 1; i < w.length(); i++) {
// odd
if(i % 2 != 0 && prev != w[i]) {
ans = "No";
break;
} else {
prev = w[i];
}
}
cout << ans << endl;
}
|
a.cc:9:12: error: 'sort' has not been declared in 'std'
9 | using std::sort;
| ^~~~
a.cc: In function 'int main()':
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
17 | sort(w.begin(), w.end());
| ^~~~
| sqrt
|
s106254248
|
p04012
|
Java
|
import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
String w = sc.next();
for (int i = 0 ; i < w.length() ; i++) {
for (int j = 0 ; j < w.length() ; j++) {
if (w.charAt(i) == w.charAt(j)) {
count++;
}
}
if (count % 2 != 0) {
System.out.println("No");
}
}
System.out.println("Yes");
}
}
|
Main.java:10: error: cannot find symbol
count++;
^
symbol: variable count
location: class Main
Main.java:13: error: cannot find symbol
if (count % 2 != 0) {
^
symbol: variable count
location: class Main
2 errors
|
s068084018
|
p04012
|
Java
|
import java.util.*;
public class B_44{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String w = sc.next();
char c = w.charAt(0);
int cc = 0;
for(int i = 0 ; i < w.length() ; i++){
if(c == w.charAt(i)){
cc++;
}
String a = c + "";
if(i == w.length() - 1){
w = w.replaceAll(a , "");
if(cc % 2 != 0){
System.out.println("No");
break;
}
if(w.length() != 0){
c = w.charAt(0);
cc = 1;
i = 0;
} else if(w.length() == 0){
System.out.println("Yes");
break;
}
}
}
sc.close();
}
}
|
Main.java:3: error: class B_44 is public, should be declared in a file named B_44.java
public class B_44{
^
1 error
|
s751833872
|
p04012
|
C++
|
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define WMAX 10000
#define HMAX 10000
//コメントアウトするとdebug()を実行しない
#define DEBUG
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
std::fill( (T*)array, (T*)(array+N), val );
}
typedef pair<int ,int > P;
typedef long long ll;
int A,B,C,N,W,H,ans,dp[HMAX][WMAX];
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
dy[8] = {1,1,0,-1,-1,-1,0,1};
vectore<int > beau;
void solve(){
}
void debug(){
}
void answer(){
cout << ans << "\n";
}
int main(){
cin >> S;
for (int i = 0; i < S.size(); ++i)
{
if(find(beau.begin(), beau.end(),S[i]) != beau.end()){
beau.erase(beau.begin(), beau.end(),S[i]);
}else{
beau.push_back(S[i]);
}
}
if(baeu.empty()){
cout << "Yes\n";
}else{
cout << "No\n";
}
return 0;
}
|
a.cc:32:1: error: 'vectore' does not name a type
32 | vectore<int > beau;
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:50:25: error: 'beau' was not declared in this scope
50 | if(find(beau.begin(), beau.end(),S[i]) != beau.end()){
| ^~~~
a.cc:56:12: error: 'baeu' was not declared in this scope
56 | if(baeu.empty()){
| ^~~~
|
s189608024
|
p04012
|
C++
|
http://abc044.contest.atcoder.j#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PI 4*atan(1.0)
typedef long long ll;
typedef long double ld;
using namespace std;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
int main(){
char s[101];
cin>>s;
int alpha[26]={};
for(int i=0;i<strlen(s);i++)
alpha[s[i]-'a']++;
for(int i=0;i<26;i++){
if(alpha[i]%2){
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;
return 0;
}
|
a.cc:1:1: error: 'http' does not name a type
1 | http://abc044.contest.atcoder.j#include <iostream>
| ^~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/iomanip:41,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/char_traits.h:50,
from /usr/include/c++/14/string:42,
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/iomanip:42:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared
144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type
146 | static _GLIBCXX14_CONSTEXPR std::size_t
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared
150 | find(const char_type* __s, std::size_t __n, const char_type& __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared
153 | move(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared
156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared
159 | assign(char_type* __s, std::size_t __n, char_type __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared
187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
| ^~~
/usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
/usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~
|
|
s261613343
|
p04012
|
C++
|
#include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include <math.h>
#include<algorithm>
// #include <boost/multiprecision/cpp_int.hpp>
#include<functional>
#define int long long
#define inf 1000000007
#define pa pair<int,int>
#define ll long long
#define pal pair<double,int>
#define ppa pair<int,pa>
#define ssa pair<string,int>
#define mp make_pair
#define pb push_back
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)
using namespace std;
//priority_queue<int, vector<int>, greater<int> > que;
class Point{
public:
double x,y;
Point(double x=0,double y=0):x(x),y(y) {}
Point operator + (Point p) {return Point(x+p.x,y+p.y);}
Point operator - (Point p) {return Point(x-p.x,y-p.y);}
Point operator * (double a) {return Point(x*a,y*a);}
Point operator / (double a) {return Point(x/a,y/a);}
double absv() {return sqrt(norm());}
double norm() {return x*x+y*y;}
bool operator < (const Point &p) const{
return x != p.x ? x<p.x: y<p.y;
}
bool operator == (const Point &p) const{
return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
}
};
typedef Point Vector;
struct Segment{
Point p1,p2;
};
double hen(Vector a){
if(fabs(a.x)<EPS && a.y>0) return acos(0);
else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
else if(fabs(a.y)<EPS && a.x>0) return 0.0;
else if(a.y>0) return acos(a.x/a.absv());
else return 2*acos(0)+acos(-a.x/a.absv());
}
int gcd(int v,int b){
if(v>b) return gcd(b,v);
if(v==b) return b;
if(b%v==0) return v;
return gcd(v,b%v);
}
double dot(Vector a,Vector b){
return a.x*b.x+a.y*b.y;
}
double cross(Vector a,Vector b){
return a.x*b.y-a.y*b.x;
}
double distans(double x1,double y1,double x2,double y2){
double rr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
return sqrt(rr);
}
//----------------kokomade tenpure------------
int s[200002]={0};
int rui[200002]={0};
signed main(){
string st;
cin>>st;
for(int i=0;i<st.length();i++){
s[st[i]-'a']++;
}
int bool b=true;
for(int i=0;i<26;i++) if(s[i]%2==1) b=false;
if(b) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
// cout<<ans<<endl;
// printf("%.10f\n",ans[n-1]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:28: error: 'long long' specified with 'bool'
13 | #define int long long
| ^~~~
a.cc:88:9: note: in expansion of macro 'int'
88 | int bool b=true;
| ^~~
|
s337834291
|
p04012
|
C++
|
#include<stdio.h>
#include<iostream>
using namespace std;
int main() {
int i = 0, t = 0, j = 0;
char a[100], b[27] = { 0 };
scanf_s("%s", a,sizeof(a)/sizeof(a[0]));
//cout << "h" << endl;
for (j = 0; j < 26; j++) {
for (i = 0; i < 100; i++) {
//cout << i << " " << a[j] << endl;
if (j == a[i] - 'a')
b[j] = b[j] + 1;
}
}
for (j = 0; j < 26; j++) {
if (b[j] % 2 == 1) {
t++;
}
}
if (t == 0) {
printf("Yes\n");
}
else {
printf("No\n");
}
}
|
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
8 | scanf_s("%s", a,sizeof(a)/sizeof(a[0]));
| ^~~~~~~
| scanf
|
s478612321
|
p04012
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin >> s;
map<char, int> mp;
for (char c : s) {
mp[c]++;
}
cout << all_of(mp.begin(), mp.end(), [](pair<char, int> p){ return p.second % 2 == 0; }) ? "Yes" : "No" << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:109: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
9 | cout << all_of(mp.begin(), mp.end(), [](pair<char, int> p){ return p.second % 2 == 0; }) ? "Yes" : "No" << endl;
| ~~~~~^~~~~~~
|
s509150352
|
p04012
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int c[26]={};
bool f=true;
string w;cin>>w;
int i;
for(i=0;i<w.size();i++) c[s[i]-'a']++;
for(i=0;i<26;i++) f&=(c[i]%2==0);
cout << (f?"Yes":"No") << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:29: error: 's' was not declared in this scope
8 | for(i=0;i<w.size();i++) c[s[i]-'a']++;
| ^
|
s462183739
|
p04012
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int c[26]={};
bool f=true;
string w;cin>>w;
int i;
for(i=0;i<w.size();i++) c[s[i]-'a']++;
for(i=0;i<26;i++) f&=(c[i]%2==0);
cout << (f:"Yes":"No") << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:29: error: 's' was not declared in this scope
8 | for(i=0;i<w.size();i++) c[s[i]-'a']++;
| ^
a.cc:10:13: error: expected ')' before ':' token
10 | cout << (f:"Yes":"No") << endl;
| ~ ^
| )
|
s482582034
|
p04012
|
Java
|
import java.util.*;
class Main{
public static void main(String[] args){
int[] alpha = int[26];
Scanner sc = new Scanner(System.in);
String bun = sc.next();
char[] block = bun.toCharArray();
for(int i = 0;i<bun.length();i++){
alpha[(int)block[i]-61] +=1;
}
int even = 0;
for(int i = 0;i<26;i++){
if(aipha[i]%2 !=0){
even = 1;
}
}
if(even == 0){System.out.println("Yes");}else{System.out.println("No");}
}
}
|
Main.java:5: error: ']' expected
int[] alpha = int[26];
^
1 error
|
s579745430
|
p04012
|
Java
|
import java.util.*;
class Main{
public static void main(String[] args){
int alpha[] = int[26];
Scanner sc = new Scanner(System.in);
String bun = sc.next();
char[] block = bun.toCharArray();
for(int i = 0;i<bun.length();i++){
alpha[(int)block[i]-61] +=1;
}
int even = 0;
for(int i = 0;i<26;i++){
if(aipha[i]%2 !=0){
even = 1;
}
}
if(even == 0){System.out.println("Yes");}else{System.out.println("No");}
}
}
|
Main.java:5: error: ']' expected
int alpha[] = int[26];
^
1 error
|
s931564120
|
p04012
|
Java
|
import java.util.*;
class Main{
public static void main(String[] args){
int alpha[] = int[26];
Scanner sc = new Scanner(System.in);
String bun = sc.next();
char[] block = bun.toCharArray();
for(int i = 0;i<bun.length();i++){
alpha[(int)block[i]-61] +=1;
}
int even = 0;
for(int i = 0;i<26;i++){
if(aipha[i]%2 !=0){
even = 1;
}
}
if(even == 0){System.out.println("Yes")}else{System.out.println("No")}
}
}
|
Main.java:5: error: ']' expected
int alpha[] = int[26];
^
Main.java:21: error: ';' expected
if(even == 0){System.out.println("Yes")}else{System.out.println("No")}
^
Main.java:21: error: ';' expected
if(even == 0){System.out.println("Yes")}else{System.out.println("No")}
^
3 errors
|
s030691632
|
p04012
|
C++
|
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string w;
w.reserve(100);
cin >> w;
sort(w.begin(), w.end());
char ch{w.at(0};
int32_t count{ 0 };
for (auto i{ 1 }; i < w.size(); ++i) {
if (ch != w[i]) {
if (count & 1 == 1)
break;
count = 0;
ch = w[i];
}
++count;
}
if (count & 1 == 1)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
|
a.cc: In function 'int main()':
a.cc:16:23: error: expected ')' before '}' token
16 | char ch{w.at(0};
| ~ ^
| )
|
s152880758
|
p04012
|
C
|
#include <stdio.h>
int main(){
char s[100];
scanf("%s",s);
int length;
length=(int)strlen(s);
int i,j;
int count[length]=1;
for(i=0;i<length;i++){
for(j=1;j<length;j++){
if(s[i]==s[j]) count[i]=count[i]+1;
}
}
int g;
int h=length;
for(g=0;g<length;g++){
if(count[length]%2==0){
h++;
if(h==length)printf("YES\n");
}else{
printf("NO\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:7:13: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | length=(int)strlen(s);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 |
main.c:7:13: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
7 | length=(int)strlen(s);
| ^~~~~~
main.c:7:13: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:9:19: error: variable-sized object may not be initialized except with an empty initializer
9 | int count[length]=1;
| ^
main.c:25:1: error: expected declaration or statement at end of input
25 | }
| ^
|
s675702611
|
p04012
|
C
|
#include <stdio.h>
int main(){
char s[100];
scanf("%s",s);
int length;
length=(int)strlen(s);
int i,j;
int count[length]=1;
for(i=0;i<length;i++){
for(j=1;j<length;j++){
if(s[i]==s[j]) count[i]=count[i]+1;
}
}
int g;
if(for(g=0;g<length;g++){count[length]%2==0}){printf("YES\n");}
else{printf("NO\n");}
return 0;
}
|
main.c: In function 'main':
main.c:7:13: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | length=(int)strlen(s);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 |
main.c:7:13: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
7 | length=(int)strlen(s);
| ^~~~~~
main.c:7:13: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:9:19: error: variable-sized object may not be initialized except with an empty initializer
9 | int count[length]=1;
| ^
main.c:16:4: error: expected expression before 'for'
16 | if(for(g=0;g<length;g++){count[length]%2==0}){printf("YES\n");}
| ^~~
|
s979872415
|
p04012
|
C
|
#include <stdio.h>
int main(){
char s[100];
scanf("%s",s);
int length;
length=(char)strlen(s);
int i,j;
int count[length]=1;
for(i=0;i<length;i++){
for(j=1;j<length;j++){
if(s[i]==s[j]) count[i]=count[i]+1;
}
}
int g;
if(for(g=0;g<length;g++){count[length]%2==0}){printf("YES\n");}
else{printf("NO\n");}
return 0;
}
|
main.c: In function 'main':
main.c:7:14: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | length=(char)strlen(s);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 |
main.c:7:14: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
7 | length=(char)strlen(s);
| ^~~~~~
main.c:7:14: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:9:19: error: variable-sized object may not be initialized except with an empty initializer
9 | int count[length]=1;
| ^
main.c:16:4: error: expected expression before 'for'
16 | if(for(g=0;g<length;g++){count[length]%2==0}){printf("YES\n");}
| ^~~
|
s634820532
|
p04012
|
C++
|
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
char t[110];
int end, cnt=1, flag=1;
int main()
{
scanf("%s", t);
end = strlen(t);
sort(t, t+end);
for(int i=end-1; i>=1; i--)
{
if(t[i]==t[i-1]) cnt++;
else
{
if(cnt%2) break;
cnt = 1;
}
}
if(cnt%2) printf("No\n");
else printf("Yes\n");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:9: error: reference to 'end' is ambiguous
13 | end = strlen(t);
| ^~~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
from /usr/include/c++/14/bits/stl_algo.h:59,
from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/initializer_list:99:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
a.cc:7:5: note: 'int end'
7 | int end, cnt=1, flag=1;
| ^~~
a.cc:14:19: error: reference to 'end' is ambiguous
14 | sort(t, t+end);
| ^~~
/usr/include/c++/14/initializer_list:99:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
a.cc:7:5: note: 'int end'
7 | int end, cnt=1, flag=1;
| ^~~
a.cc:16:19: error: reference to 'end' is ambiguous
16 | for(int i=end-1; i>=1; i--)
| ^~~
/usr/include/c++/14/initializer_list:99:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
a.cc:7:5: note: 'int end'
7 | int end, cnt=1, flag=1;
| ^~~
|
s033813013
|
p04012
|
C++
|
#include<iostream>
#include<cmath>
#include<ctype.h>
#include<vector>
#include<cstdlib>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<time.h>
#define ll long long
#define LL long long
#define ULL unsigned long long
#define ull unsigned long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
const ll INF = -10000000000;
using namespace std;
int tmp[100] = {};
int main()
{
char w[50];
cin >> w;
for (int i = 0; i < strlen(w); i++){
tmp[w[i] - 97]++;
}
int flag=0;
for (int i = 0; i < 25; i++){
if (tmp[i] % 2 != 0){
flag = 1;
break;
}
}
if (flag == 0) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:33:29: error: 'strlen' was not declared in this scope
33 | for (int i = 0; i < strlen(w); i++){
| ^~~~~~
a.cc:13:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
12 | #include<set>
+++ |+#include <cstring>
13 | #include<time.h>
|
s861426182
|
p04012
|
C++
|
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
//System.out.println(s);
char[] c_array = new char[256];
for (int i = 0;i < s.length();i++) {
//System.out.println(s.charAt(i));
c_array[(int)s.charAt(i)]++;
}
int flag = 0;
for (int i = 0;i < 256;i++) {
if (c_array[i] % 2 != 0) {
flag = 1;
break;
}
}
if (flag == 1)
System.out.println("no");
else
System.out.println("yes");
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public class Main {
| ^~~~~~
|
s740509468
|
p04012
|
C++
|
#include<stdio.h>
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int solve(int l,char w[]){
if (l == 0)return 0;
while (1){
int s=-1;
for (int i = 0; i < l; i++){
if (w[i]>1){
char c = w[i];
int n = 0;
for (int j = i; j < l; j++){
if (w[j] == c){
n++;
w[j] = 1;
}
}
if (n == 1 || n % 2 == 1)return 1;
}
if (s == -1)return 0;
}
}
}
int main(){
char w[101];
for (int i = 0; i < 101; i++)w[i] = 0;
cin >> w;
int l = strlen(w);
int res = solve(l,w);
if (res == 0)printf("Yes\n");
else (res == 1)printf("No\n");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:45:24: error: expected ';' before 'printf'
45 | else (res == 1)printf("No\n");
| ^~~~~~
| ;
|
s340110172
|
p04012
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
char s[101];
while(gets(s))
{
int len = strlen(s);
map<char, int> charMap;
for(int i=0; i<len; i++) charMap[s[i]]++;
bool beautiful = true;
for(int i=97; i<=122; i++)
{
if(charMap[(char) i] % 2!=0)
{
beautiful = false;
break;
}
}
if(beautiful) cout << "Yes\n";
else cout << "No\n";
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | while(gets(s))
| ^~~~
| getw
|
s855235134
|
p04012
|
C++
|
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <math.h>
#include <cmath>
using namespace std;
int main(){
int N,K,X,Y;
int s[100];
int i =0;
int c[26]
for(int i=0;i<26;i++){
c[i] = 0;
}
int wrong = 0;
while(cin >> s[i]){
i++;
}
for(int j=0;j<i;j++){
if(s[j] == 'a' ){
c[0]++;
}else if(s[j] == 'b'){
c[1]++;
}else if(s[j] == 'b'){
c[1]++;
}else if(s[j] == 'c'){
c[2]++;
}else if(s[j] == 'd'){
c[3]++;
}else if(s[j] == 'e'){
c[4]++;
}else if(s[j] == 'f'){
c[5]++;
}else if(s[j] == 'g'){
c[6]++;
}else if(s[j] == 'h'){
c[7]++;
}else if(s[j] == 'i'){
c[8]++;
}else if(s[j] == 'j'){
c[9]++;
}else if(s[j] == 'k'){
c[10]++;
}else if(s[j] == 'l'){
c[11]++;
}else if(s[j] == 'm'){
c[12]++;
}else if(s[j] == 'n'){
c[13]++;
}else if(s[j] == 'o'){
c[14]++;
}else if(s[j] == 'p'){
c[15]++;
}else if(s[j] == 'q'){
c[16]++;
}else if(s[j] == 'r'){
c[17]++;
}else if(s[j] == 's'){
c[18]++;
}else if(s[j] == 't'){
c[19]++;
}else if(s[j] == 'u'){
c[20]++;
}else if(s[j] == 'v'){
c[21]++;
}else if(s[j] == 'w'){
c[22]++;
}else if(s[j] == 'x'){
c[23]++;
}else if(s[j] == 'y'){
c[24]++;
}else if(s[j] == 'z'){
c[25]++;
}
}
for(int k=0;k<26;k++){
if(c[k] % 2 == 1){
wrong++;
}
}
if(wrong == 0){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:29:4: error: expected initializer before 'for'
29 | for(int i=0;i<26;i++){
| ^~~
a.cc:29:24: error: expected ';' before ')' token
29 | for(int i=0;i<26;i++){
| ^
| ;
a.cc:38:4: error: 'c' was not declared in this scope
38 | c[0]++;
| ^
a.cc:40:4: error: 'c' was not declared in this scope
40 | c[1]++;
| ^
a.cc:42:4: error: 'c' was not declared in this scope
42 | c[1]++;
| ^
a.cc:44:4: error: 'c' was not declared in this scope
44 | c[2]++;
| ^
a.cc:46:4: error: 'c' was not declared in this scope
46 | c[3]++;
| ^
a.cc:48:4: error: 'c' was not declared in this scope
48 | c[4]++;
| ^
a.cc:50:4: error: 'c' was not declared in this scope
50 | c[5]++;
| ^
a.cc:52:4: error: 'c' was not declared in this scope
52 | c[6]++;
| ^
a.cc:54:4: error: 'c' was not declared in this scope
54 | c[7]++;
| ^
a.cc:56:4: error: 'c' was not declared in this scope
56 | c[8]++;
| ^
a.cc:58:4: error: 'c' was not declared in this scope
58 | c[9]++;
| ^
a.cc:60:4: error: 'c' was not declared in this scope
60 | c[10]++;
| ^
a.cc:62:4: error: 'c' was not declared in this scope
62 | c[11]++;
| ^
a.cc:64:4: error: 'c' was not declared in this scope
64 | c[12]++;
| ^
a.cc:66:4: error: 'c' was not declared in this scope
66 | c[13]++;
| ^
a.cc:68:4: error: 'c' was not declared in this scope
68 | c[14]++;
| ^
a.cc:70:4: error: 'c' was not declared in this scope
70 | c[15]++;
| ^
a.cc:72:4: error: 'c' was not declared in this scope
72 | c[16]++;
| ^
a.cc:74:4: error: 'c' was not declared in this scope
74 | c[17]++;
| ^
a.cc:76:4: error: 'c' was not declared in this scope
76 | c[18]++;
| ^
a.cc:78:4: error: 'c' was not declared in this scope
78 | c[19]++;
| ^
a.cc:80:4: error: 'c' was not declared in this scope
80 | c[20]++;
| ^
a.cc:82:4: error: 'c' was not declared in this scope
82 | c[21]++;
| ^
a.cc:84:4: error: 'c' was not declared in this scope
84 | c[22]++;
| ^
a.cc:86:4: error: 'c' was not declared in this scope
86 | c[23]++;
| ^
a.cc:88:4: error: 'c' was not declared in this scope
88 | c[24]++;
| ^
a.cc:90:4: error: 'c' was not declared in this scope
90 | c[25]++;
| ^
a.cc:94:7: error: 'c' was not declared in this scope
94 | if(c[k] % 2 == 1){
| ^
|
s376843978
|
p04012
|
C
|
#include <stdio.h>
int main(void) {
char w[101],q['z'-'a'];
scanf("%s",w);
int i;
for (i=0;w[i] != '\0';i++) {
q[w[i]-'a']++;
}
for (i=0;i<('z'-'a');i++) {
if (q[i]%2) {
puts("No");
return 0;
}
}
puts("Yes");
retun 0;
}
|
main.c: In function 'main':
main.c:17:17: error: 'retun' undeclared (first use in this function)
17 | retun 0;
| ^~~~~
main.c:17:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:22: error: expected ';' before numeric constant
17 | retun 0;
| ^~
| ;
|
s552904151
|
p04012
|
Java
|
import java.util.Scanner;
class Main {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
String n = sc.next();
if(n.length() % 2 == 1){
System.out.println("no");
System.exit(0);
}else{
boolean b = true;
String s = "abcdefghijklmnopqrstuvwxyz";
for(int i =0;i<26;i++){
int count = 0;
String target = String.valueOf(s.charAt(i));
for(int j=0;j<n.length();j++){
String s = n.charAt(j);
if(target.equals(s)){ count++; }
}
if(count %2 == 1){b=false;}
}
if(b){System.out.println("Yes");}
}
}
}
|
Main.java:16: error: variable s is already defined in method main(String...)
String s = n.charAt(j);
^
Main.java:16: error: incompatible types: char cannot be converted to String
String s = n.charAt(j);
^
2 errors
|
s076960751
|
p04012
|
C++
|
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string a;
cin >> a;
int b;
b=a.size();
char w[b];
for(int q=0;q<b;q++){
w[q]=a[q];
}
sort(w,w+b);
int c,i;
c=b/2;
int OK;
OK=0;
for(i=0;i<b;i=i+2){
if(w[i]==w[i+1]) OK++;
}
if(OK==c) cout << "Yes" << endl;
if(OK!=c) cout << "No" << endl;
|
a.cc: In function 'int main()':
a.cc:28:40: error: expected '}' at end of input
28 | if(OK!=c) cout << "No" << endl;
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s656898502
|
p04012
|
C++
|
#include<iostream>
#include<
using namespace std;
int main(){
string s;
cin>>s;
int char[26]={0};
for(int i=0;s[i]!='/0';i++){
if(char[s[i]-97]==0)
char[s[i]-97]=1;
else char[s[i]-97]=0;
}
for(int i=0;i<n;i++){
if (char[i]=='1'){cout<<"No";return 0;}
}
cout<<"Yes";
}
|
a.cc:2:10: error: missing terminating > character
2 | #include<
| ^
a.cc:2:9: error: empty filename in #include
2 | #include<
| ^
a.cc:9:19: warning: multi-character character constant [-Wmultichar]
9 | for(int i=0;s[i]!='/0';i++){
| ^~~~
a.cc: In function 'int main()':
a.cc:8:10: error: expected identifier before numeric constant
8 | int char[26]={0};
| ^~
a.cc:8:10: error: expected ']' before numeric constant
8 | int char[26]={0};
| ^~
| ]
a.cc:8:1: error: two or more data types in declaration of 'structured binding'
8 | int char[26]={0};
| ^~~
a.cc:8:9: error: empty structured binding declaration
8 | int char[26]={0};
| ^
a.cc:10:8: error: expected unqualified-id before '[' token
10 | if(char[s[i]-97]==0)
| ^
a.cc:11:7: error: expected ']' before '[' token
11 | char[s[i]-97]=1;
| ^
| ]
a.cc:11:5: error: structured binding declaration cannot have type 'char'
11 | char[s[i]-97]=1;
| ^
a.cc:11:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:11:5: error: cannot decompose non-array non-class type 'int'
a.cc:12:12: error: expected ']' before '[' token
12 | else char[s[i]-97]=0;
| ^
| ]
a.cc:12:10: error: structured binding declaration cannot have type 'char'
12 | else char[s[i]-97]=0;
| ^
a.cc:12:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:12:10: error: cannot decompose non-array non-class type 'int'
a.cc:15:15: error: 'n' was not declared in this scope
15 | for(int i=0;i<n;i++){
| ^
a.cc:16:9: error: expected unqualified-id before '[' token
16 | if (char[i]=='1'){cout<<"No";return 0;}
| ^
|
s740836510
|
p04012
|
C++
|
#include<iostream>
#include<
using namespace std;
int main(){
string s;
cin>>s;
int char[26]={0};
for(int i=0;s[i]!='/0';i++){
if(char[s[i]-97]==0)
char[s[i]-97]=1;
else char[s[i]-97]=0;
}
for(int i=0;i<n;i++){
if (char[i]='1'){cout<<"No";return 0;}
}
cout<<"Yes";
}
|
a.cc:2:10: error: missing terminating > character
2 | #include<
| ^
a.cc:2:9: error: empty filename in #include
2 | #include<
| ^
a.cc:9:19: warning: multi-character character constant [-Wmultichar]
9 | for(int i=0;s[i]!='/0';i++){
| ^~~~
a.cc: In function 'int main()':
a.cc:8:10: error: expected identifier before numeric constant
8 | int char[26]={0};
| ^~
a.cc:8:10: error: expected ']' before numeric constant
8 | int char[26]={0};
| ^~
| ]
a.cc:8:1: error: two or more data types in declaration of 'structured binding'
8 | int char[26]={0};
| ^~~
a.cc:8:9: error: empty structured binding declaration
8 | int char[26]={0};
| ^
a.cc:10:8: error: expected unqualified-id before '[' token
10 | if(char[s[i]-97]==0)
| ^
a.cc:11:7: error: expected ']' before '[' token
11 | char[s[i]-97]=1;
| ^
| ]
a.cc:11:5: error: structured binding declaration cannot have type 'char'
11 | char[s[i]-97]=1;
| ^
a.cc:11:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:11:5: error: cannot decompose non-array non-class type 'int'
a.cc:12:12: error: expected ']' before '[' token
12 | else char[s[i]-97]=0;
| ^
| ]
a.cc:12:10: error: structured binding declaration cannot have type 'char'
12 | else char[s[i]-97]=0;
| ^
a.cc:12:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:12:10: error: cannot decompose non-array non-class type 'int'
a.cc:15:15: error: 'n' was not declared in this scope
15 | for(int i=0;i<n;i++){
| ^
a.cc:16:9: error: expected unqualified-id before '[' token
16 | if (char[i]='1'){cout<<"No";return 0;}
| ^
|
s551380554
|
p04012
|
C++
|
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <cctype>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
#include <list>
#include <cassert>
using namespace std;
int main(){
string s;
cin>>s;
int cnt[26]={};
for(int i=0;i<n;i++){
cnt[s[i]-'a']++;
}
for(int i=0;i<26;i++){
if(cnt[i]%2){
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;
}
|
a.cc: In function 'int main()':
a.cc:29:23: error: 'n' was not declared in this scope
29 | for(int i=0;i<n;i++){
| ^
|
s520217850
|
p04013
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define INF 1000000007
int main(){
ll n, A;
cin >> n >> A;
vector < ll > cards ( n + 1 );
for ( ll i = 1; i <= n; i++ )
cin >> cards[i];
int dp [ 50 ][ 2500 ];
dp [ 0 ][ 0 ] = 0;
for( int k = 1; k < n + 1; k++ )
for( int i = k - 1; i >= 0; i-- )
for( int j = 0; j <= 50 * i; j++ )
dp [ i + 1][ j + cards[ k ] ] += dp [ i ][ j ];
ll ans = 0;
for( int i = 1; i < =n; i++ )
ans += dp[ i ][ i*A ];
cout << ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:29: error: expected primary-expression before '=' token
21 | for( int i = 1; i < =n; i++ )
| ^
|
s950742381
|
p04013
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define INF 1000000007
int main(){
ll n, A;
cin >> n >> A;
vector < ll > cards ( n + 1 );
for ( ll i = 1; i <= n; i++ )
cin >> cards[i];
int dp [ n + 1 ][ (n + 1) * A ];
dp [ 0 ][ 0 ] = 0;
for( int k = 1; k < n + 1; k++ )
for( int i = k - 1; i >= 0; i-- )
for( int j = 0; j <= A * i; j++ )
dp [ i + 1][ j + cards[ k ] ] += dp [ i ][ j ];
ll ans = 0;
for( int i = 1; i < =n; i++ )
ans += dp[ i ][ i*A ];
cout << ans;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define INF 1000000007
int main(){
ll n, A;
cin >> n >> A;
vector < ll > cards ( n + 1 );
for ( ll i = 1; i <= n; i++ )
cin >> cards[i];
int dp [ n + 1 ][ (n + 1) * A ];
dp [ 0 ][ 0 ] = 0;
for( int k = 1; k < n + 1; k++ )
for( int i = k - 1; i >= 0; i-- )
for( int j = 0; j <= A * i; j++ )
dp [ i + 1][ j + cards[ k ] ] += dp [ i ][ j ];
ll ans = 0;
for( int i = 1; i <= n; i++ )
ans += dp[ i ][ i*A ];
cout << ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:29: error: expected primary-expression before '=' token
21 | for( int i = 1; i < =n; i++ )
| ^
a.cc: At global scope:
a.cc:34:5: error: redefinition of 'int main()'
34 | int main(){
| ^~~~
a.cc:8:9: note: 'int main()' previously defined here
8 | int main(){
| ^~~~
|
s523877823
|
p04013
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define INF 1000000007
int main(){
ll n, A;
cin >> n >> A;
vector < ll > cards ( n + 1 );
for ( ll i = 1; i <= n; i++ )
cin >> cards[i];
int dp [ n + 1 ][ (n + 1) * A ];
dp [ 0 ][ 0 ] = 0;
for( int k = 1; k < n + 1; k++ )
for( int i = k - 1; i >= 0; i-- )
for( int j = 0; j <= A * i; j++ )
dp [ i + 1][ j + cards[ k ] ] += dp [ i ][ j ];
ll ans = 0;
for( int i = 1; i < =n; i++ )
ans += dp[ i ][ i*A ];
cout << ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:29: error: expected primary-expression before '=' token
21 | for( int i = 1; i < =n; i++ )
| ^
|
s086377364
|
p04013
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
private static final FastIn in = new FastIn();
private static final PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) {
var sol = new Solver();
sol.solve();
out.close();
}
private static final class Solver {
public void solve() {
var n = in.nextInt(), a = in.nextInt();
int[] x = new int[n];
for (int i = 0; i < n; ++i) x[i] = in.nextInt();
int[][][] dp = new int[n + 1][n + 1][5000];
dp[0][0][0] = 1;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
for (int k = 0; k < 5000; ++k) {
if (dp[i][j][k] == 0) continue;
dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
dp[i + 1][j][k] += dp[i][j][k];
}
}
}
long ans = 0;
for (int i = 1; i <= n; ++i) ans += dp[n][i][a * i];
out.println(ans);
}
}
private static final class FastIn {
private BufferedReader br;
private StringTokenizer st;
public FastIn() {
br = new BufferedReader(new InputStreamReader(System.in), 1 << 20);
st = null;
}
public String next() {
while (st == null || !st.hasMoreTokens()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return st.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
}
}
|
Main.java:20: error: 'var' is not allowed in a compound declaration
var n = in.nextInt(), a = in.nextInt();
^
1 error
|
s085129243
|
p04013
|
C++
|
#include<bits/stdc++.h>
using namespace std;
const int nax = 55;
int main()
{
using ll = long long;
int n, a;
cin >> n >> a;
vector<int> x(n);
for(int& i: x) cin >> i;
vector<vector<ll>> dp(nax, vector<ll>(nax*nax));
dp[0][0] = 1;
for(int i = 1; i <= n; i++) {
for(int j = i; j >= 0; j--) {
for(int k = 0; k < nax*nax; k++) {
if(k + x[i] < 100) {
dp[j+1][k+x[i]] += dp[j][k];
}
}
}
}
ll ans = 0;
for (int i = 1; i <= n; i++) {
ans += dp[i][i * a];
deb(i, a, i*a, dp[i][i*a]);
}
cout << ans << endl;
}
|
a.cc: In function 'int main()':
a.cc:29:17: error: 'deb' was not declared in this scope
29 | deb(i, a, i*a, dp[i][i*a]);
| ^~~
|
s742762027
|
p04013
|
Java
|
//package cf;
import java.awt.event.MouseAdapter;
import java.io.*;
import java.util.*;
public class C_tak_card {
static int p=1000000007;
public static void main(String[] args) throws Exception{
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(java.io.FileDescriptor.out), "ASCII"), 512);
FastReader sc=new FastReader();
// long k = sc.nextLong();
int n = sc.nextInt();
int a=sc.nextInt();
int ar[]=new int[n];
String inp[]=sc.nextLine().split(" ");
for(int i=0;i<n;i++)
{
ar[i]=Integer.parseInt(inp[i]);
}
int max_sum=n*a+1;
long dp[][][]=new long[n+1][n+1][max_sum];
for(int i=0;i<=n;i++) {
dp[i][0][0]=1;
}
List<Integer> l1=new ArrayList<>();
for(int i=1;i<=n;i++)
{
for(int k=1;k<=n;k++)
{
for(int j=1;j<=max_sum-1;j++)
{
if(j-ar[i-1]>=0&&dp[i-1][k-1][j-ar[i-1]]>0)
{
if(j==ar[i-1])
{
dp[i][k][j]=dp[i-1][k][j]+dp[i-1][k-1][j-ar[i-1]];
}
else
{
dp[i][k][j]=dp[i-1][k][j]+dp[i-1][k-1][j-ar[i-1]];
}
}
dp[i][k][j]=Math.max(dp[i][k][j],dp[i-1][k][j]);
}
}
}
for(int i=1;i<=n;i++)
{
c+=dp[n][i][i*a];
}
System.out.println(c);
// out.write(sb.toString());
out.flush();
}
static long c=0;
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
|
Main.java:6: error: class C_tak_card is public, should be declared in a file named C_tak_card.java
public class C_tak_card {
^
1 error
|
s589625988
|
p04013
|
C++
|
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n,a;
cin>>n>>a;
int b[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int dp[5000][5000]={0};
dp[0][0]=1;
for(int i=1;i<=n;i++)
{
for(int j=i-1;j>=0;j--)
{
for(int k=0;k<=2500;k++)
{
dp[j][k+b[i]]+=dp[j][k];
}
}
}
ll ans=0;
for(int i=1;i<=n;i++)
{
ans+=dp[i][a*i];
}
cout<<ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:15: error: invalid types 'int[int]' for array subscript
13 | cin>>a[i];
| ^
|
s253435263
|
p04013
|
C++
|
d
|
a.cc:1:1: error: 'd' does not name a type
1 | d
| ^
|
s848673283
|
p04013
|
C++
|
#include<iostream>
using namespace std;
long long dp[51][2560] = {0};
int main(){
int N, A;
cin >> N >> A;
dp[0][0] = 1
for (int i = 1; i <= N; i ++){
int x;
cin >> x;
for (int j = i - 1; j >= 0; j --){
for (int k = 0; k <= 2501; k ++){
dp[j + 1][k + x] += dp[j][k];
}
}
}
long long totalWays = 0;
for (int i = 1; i <= N; i ++){
totalWays += dp[i][i * A];
}
cout << totalsWays << '\n';
}
|
a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before 'for'
10 | dp[0][0] = 1
| ^
| ;
11 | for (int i = 1; i <= N; i ++){
| ~~~
a.cc:11:19: error: 'i' was not declared in this scope
11 | for (int i = 1; i <= N; i ++){
| ^
a.cc:27:11: error: 'totalsWays' was not declared in this scope; did you mean 'totalWays'?
27 | cout << totalsWays << '\n';
| ^~~~~~~~~~
| totalWays
|
s449079580
|
p04013
|
C++
|
#include<iostream>
using namespace std;
long long dp[51][2560] = {0}
int main(){
int N, A;
cin >> N >> A;
dp[0][0] = 1
for (int i = 1; i <= N; i ++){
int x;
cin >> x;
for (int j = i - 1; j >= 0; j --){
for (int k = 0; k <= 2501; k ++){
dp[j + 1][k + x] += dp[j][k];
}
}
}
long long totalWays = 0;
for (int i = 1; i <= N; i ++){
totalWays += dp[i][i * A];
}
cout << totalsWays << '\n';
}
|
a.cc:6:1: error: expected ',' or ';' before 'int'
6 | int main(){
| ^~~
|
s791207696
|
p04013
|
C++
|
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
typedef short int sh;
const ll inf=0x3f3f3f3f;
const int MAX=1<<6;
const int mod=1e9+7;
ll dp[MAX][MAX];
int num[MAX],n,a;
ll Dp(int st,int cnt,int sum)
{
if(dp[st][sum]!=-1)
return dp[st][sum];
dp[st][sum]=0;
if(cnt&&(double)sum/cnt==a)
{
dp[st][sum]++;
}
for(int i=st;i<n&&(double)(sum+num[i])/(cnt+1)<=a;i++)
{
dp[st][sum]+=Dp(i+1,cnt+1,sum+num[i]);
}
return dp[st][sum];
}
int main()
{
while(scanf("%d%d",&n,&a)!=EOF)
{
for(int i=0;i<n;i++)
{
scanf("%d",&num[i]);
}
sort(num,num+n);
memset(dp,-1,sizeof(dp));
printf("%lld\n",Dp(0,0,0));
}
return 0;
}
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
typedef short int sh;
const ll inf=0x3f3f3f3f;
const int MAX=1<<6;
const int mod=1e9+7;
ll dp[MAX][MAX];
int num[MAX],n,a;
ll Dp(int st,int cnt,int sum)
{
if(dp[st][sum]!=-1)
return dp[st][sum];
dp[st][sum]=0;
if(cnt&&(double)sum/cnt==a)
{
dp[st][sum]++;
}
for(int i=st;i<n&&(double)(sum+num[i])/(cnt+1)<=a;i++)
{
dp[st][sum]+=Dp(i+1,cnt+1,sum+num[i]);
}
return dp[st][sum];
}
int main()
{
while(scanf("%d%d",&n,&a)!=EOF)
{
for(int i=0;i<n;i++)
{
scanf("%d",&num[i]);
}
sort(num,num+n);
memset(dp,-1,sizeof(dp));
printf("%lld\n",Dp(0,0,0));
}
return 0;
}
|
a.cc:66:10: error: redefinition of 'const ll inf'
66 | const ll inf=0x3f3f3f3f;
| ^~~
a.cc:15:10: note: 'const ll inf' previously defined here
15 | const ll inf=0x3f3f3f3f;
| ^~~
a.cc:67:11: error: redefinition of 'const int MAX'
67 | const int MAX=1<<6;
| ^~~
a.cc:16:11: note: 'const int MAX' previously defined here
16 | const int MAX=1<<6;
| ^~~
a.cc:68:11: error: redefinition of 'const int mod'
68 | const int mod=1e9+7;
| ^~~
a.cc:17:11: note: 'const int mod' previously defined here
17 | const int mod=1e9+7;
| ^~~
a.cc:70:4: error: redefinition of 'll dp [64][64]'
70 | ll dp[MAX][MAX];
| ^~
a.cc:19:4: note: 'll dp [64][64]' previously declared here
19 | ll dp[MAX][MAX];
| ^~
a.cc:71:5: error: redefinition of 'int num [64]'
71 | int num[MAX],n,a;
| ^~~
a.cc:20:5: note: 'int num [64]' previously declared here
20 | int num[MAX],n,a;
| ^~~
a.cc:71:14: error: redefinition of 'int n'
71 | int num[MAX],n,a;
| ^
a.cc:20:14: note: 'int n' previously declared here
20 | int num[MAX],n,a;
| ^
a.cc:71:16: error: redefinition of 'int a'
71 | int num[MAX],n,a;
| ^
a.cc:20:16: note: 'int a' previously declared here
20 | int num[MAX],n,a;
| ^
a.cc:73:4: error: redefinition of 'll Dp(int, int, int)'
73 | ll Dp(int st,int cnt,int sum)
| ^~
a.cc:22:4: note: 'll Dp(int, int, int)' previously defined here
22 | ll Dp(int st,int cnt,int sum)
| ^~
a.cc:89:5: error: redefinition of 'int main()'
89 | int main()
| ^~~~
a.cc:38:5: note: 'int main()' previously defined here
38 | int main()
| ^~~~
|
s243900631
|
p04013
|
C
|
#include<iostream>
using namespace std;
void sort(int x[], int N){
for(int i=0; i<N-1; i++){
for(int j=i+1; j<N; j++){
if(x[j] < x[i]){
int temp = x[i];
x[i] = x[j];
x[j] = temp;
}
}
}
}
long long ways[51][51][2501] = {0};
int main(){
int N, A;
cin >> N >> A;
int x[N];
for(int i=0; i<N; i++){
cin >> x[i];
}
ways[0][0][0]=1;
for(int beforePos=1; beforePos<=N; beforePos++){
for(int chooseNum=beforePos; chooseNum>=0; chooseNum--){
for(int value=A*N+1; value>=0; value--){
ways[beforePos][chooseNum][value]+=ways[beforePos-1][chooseNum][value];
if(value>=x[beforePos-1] && chooseNum>=1){
ways[beforePos][chooseNum][value]+=ways[beforePos-1][chooseNum-1][value-x[beforePos-1]];
}
}
}
}
long long totalWays=0;
for(int chooseNum=1; chooseNum<=N; chooseNum++){
totalWays += ways[N][chooseNum][chooseNum*A];
}
cout << totalWays << '\n';
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s982410995
|
p04013
|
C++
|
using namespace std;
using ll = long long;
int N, A;
int x[111];
ll dp[111][111][5555];
int main() {
cin >> N >> A;
for (int i = 0; i < N; i++) cin >> x[i];
dp[0][0][0] = 1;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
for (int k = 0; k <= 5000; k++) {
// 選ばない
dp[i+1][j][k] += dp[i][j][k];
// 選ぶ
if (k >= x[i]) {
dp[i+1][j+1][k] += dp[i][j][k-x[i]];
}
}
}
}
ll ans = 0;
for (int j = 1; j <= N; j++) {
ans += dp[N][j][j*A];
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:4: error: 'cin' was not declared in this scope
10 | cin >> N >> A;
| ^~~
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:31:4: error: 'cout' was not declared in this scope
31 | cout << ans << endl;
| ^~~~
a.cc:31:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:19: error: 'endl' was not declared in this scope
31 | cout << ans << 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;
|
s671736355
|
p04013
|
C++
|
using namespace std;
using ll = long long;
int N, A;
int x[111];
ll dp[111][111][5555];
int main() {
cin >> N >> A;
for (int i = 0; i < N; i++) cin >> x[i];
dp[0][0][0] = 1;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
for (int k = 0; k <= 5000; k++) {
// 選ばない
dp[i+1][j][k] += dp[i][j][k];
// 選ぶ
if (k >= x[i]) {
dp[i+1][j+1][k] += dp[i][j][k-x[i]];
}
}
}
}
ll ans = 0;
for (int j = 1; j <= N; j++) {
ans += dp[N][j][j*A];
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:4: error: 'cin' was not declared in this scope
10 | cin >> N >> A;
| ^~~
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:31:4: error: 'cout' was not declared in this scope
31 | cout << ans << endl;
| ^~~~
a.cc:31:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:19: error: 'endl' was not declared in this scope
31 | cout << ans << 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;
|
s299271289
|
p04013
|
C++
|
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const long long INF=1e9+5;
const string alp="abcdefghijklmnopqrstuvwxyg"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYG";
typedef long long ll;
int main() {
int N,A;
cin>>N>>A;
vector<int> x(N);
rep(i,N) cin>>x[i];
ll count;
for(int tmp=0;tmp<(1<<N);tmp++){
bitset<N> s(tmp);
ll sum;
ll ans=0;
rep(i,N){
count=0;
sum=0;
if(s.test(i)){
sum+=x[i];
count++;
}
}
if(sum/count==A){
ans++;
}
}
cout<<ans<<endl;
}
|
a.cc: In function 'int main()':
a.cc:17:13: error: the value of 'N' is not usable in a constant expression
17 | bitset<N> s(tmp);
| ^
a.cc:11:7: note: 'int N' is not const
11 | int N,A;
| ^
a.cc:17:13: note: in template argument for type 'long unsigned int'
17 | bitset<N> s(tmp);
| ^
a.cc:24:12: error: request for member 'test' in 's', which is of non-class type 'int'
24 | if(s.test(i)){
| ^~~~
a.cc:33:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
33 | cout<<ans<<endl;
| ^~~
| abs
|
s435637441
|
p04013
|
C++
|
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const long long INF=1e9+5;
const string alp="abcdefghijklmnopqrstuvwxyg"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYG";
typedef long long ll;
int main() {
ll N,A;
cin>>N>>A;
vector<ll> x(N);
rep(i,N) cin>>x[i];
ll count;
for(ll tmp=0;tmp<(1<<N);tmp++){
bitset<N> s(tmp);
ll sum;
ll ans=0;
rep(i,N){
count=0;
sum=0;
if(s.test(i)){
sum+=x[i];
count++;
}
}
if(sum/count==A){
ans++;
}
}
cout<<ans<<endl;
}
|
a.cc: In function 'int main()':
a.cc:17:13: error: the value of 'N' is not usable in a constant expression
17 | bitset<N> s(tmp);
| ^
a.cc:11:6: note: 'll N' is not const
11 | ll N,A;
| ^
a.cc:17:13: note: in template argument for type 'long unsigned int'
17 | bitset<N> s(tmp);
| ^
a.cc:24:12: error: request for member 'test' in 's', which is of non-class type 'int'
24 | if(s.test(i)){
| ^~~~
a.cc:33:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
33 | cout<<ans<<endl;
| ^~~
| abs
|
s455849542
|
p04013
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
long long dp[55][3000][55];
int n,a;
cin>>n>>a;
vector<int> x(n);
for(int i=0;i<n;i++) cin>>x[i];
memset(dp,0,sizeof(dp));
dp[0][0][0]=1;
for(int i=0;i<n;i++){
for(int s=0;s<=n*a;s++){
for(int k=0;k<=n;k++){
if(dp[i][s][k]==0) continue;
dp[i+1][s][k]+=dp[i][s][k];
dp[i+1][s+x[i]][k+1]+=dp[i][s][k];
}
}
}
long long res=0;
for(int k=1;k<=n;k++) res+=dp[n][a*k][k];
cout<<res<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:3: error: 'memset' was not declared in this scope
11 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<vector>
+++ |+#include <cstring>
3 | using namespace std;
|
s703362662
|
p04013
|
C++
|
#include<iostream>
using namespace std;
int main(){
long long dp[55][3000][55];
int n,a;
cin>>n>>a;
vector<int> x(n);
for(int i=0;i<n;i++) cin>>x[i];
memset(dp,0,sizeof(dp));
dp[0][0][0]=1;
for(int i=0;i<n;i++){
for(int s=0;s<=n*a;s++){
for(int k=0;k<=n;k++){
if(dp[i][s][k]==0) continue;
dp[i+1][s][k]+=dp[i][s][k];
dp[i+1][s+x[i]][k+1]+=dp[i][s][k];
}
}
}
long long res=0;
for(int k=1;k<=n;k++) res+=dp[n][a*k][k];
cout<<res<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
7 | vector<int> x(n);
| ^~~~~~
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:7:10: error: expected primary-expression before 'int'
7 | vector<int> x(n);
| ^~~
a.cc:8:29: error: 'x' was not declared in this scope
8 | for(int i=0;i<n;i++) cin>>x[i];
| ^
a.cc:10:3: error: 'memset' was not declared in this scope
10 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | using namespace std;
a.cc:17:20: error: 'x' was not declared in this scope
17 | dp[i+1][s+x[i]][k+1]+=dp[i][s][k];
| ^
|
s021946329
|
p04013
|
C++
|
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int counts = 0;
int sum_l(vector<int> li, int size) {
int sum = 0;
for (int i = 0; i< size; i++) {
sum +=li[i];
}
return sum;
}
void agg(vector<int> car, int avg,int size ){
if(size>=2) {
if ( sum(car, size)/size== avg){
counts+=1;
}
vector<int> temp1(size-1);
for(int i = 0; i<size-1;i++) {
temp1.push_back(car[i]);
}
agg(temp1, avg, size-1);
}else {
if (car[0] == avg){
counts += 1;
}
}
}
int main(){
int A, N;
vector<int> card(A);
cin >> A >> N;
for(int i=0; i<A;i++) {
cin >> card[i];
}
for (int test = 0; test< A; test++) {
vector<int> temp(A-test);
for(int i=0; i<A; i++) {
temp.push_back(card[i]);
}
agg(temp, N, temp.size());
}
cout << counts << endl;
}
|
a.cc: In function 'void agg(std::vector<int>, int, int)':
a.cc:19:14: error: 'sum' was not declared in this scope
19 | if ( sum(car, size)/size== avg){
| ^~~
|
s545165569
|
p04013
|
C++
|
using namespace std;
int counts = 0;
int sum(vector<int> li, int size) {
int sum = 0;
for (int i = 0; i< size; i++) {
sum +=li[i];
}
return sum;
}
void agg(vector<int> car, int avg,int size ){
if(size>=2) {
if ( sum(car, size)/size== avg){
counts+=1;
}
vector<int> temp1(size-1);
for(int i = 0; i<size-1;i++) {
temp1.push_back(car[i]);
}
agg(temp1, avg, size-1);
}else {
if (car[0] == avg){
counts += 1;
}
}
}
int main(){
int A, N;
vector<int> card(A);
cin >> A >> N;
for(int i=0; i<A;i++) {
cin >> card[i];
}
for (int test = 0; test< A; test++) {
vector<int> temp(A-test);
for(int i=0; i<A; i++) {
temp.push_back(card[i]);
}
agg(temp, N, temp.size());
}
cout << counts << endl;
}
|
a.cc:5:9: error: 'vector' was not declared in this scope
5 | int sum(vector<int> li, int size) {
| ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
+++ |+#include <vector>
1 | using namespace std;
a.cc:5:16: error: expected primary-expression before 'int'
5 | int sum(vector<int> li, int size) {
| ^~~
a.cc:5:25: error: expected primary-expression before 'int'
5 | int sum(vector<int> li, int size) {
| ^~~
a.cc:5:33: error: expression list treated as compound expression in initializer [-fpermissive]
5 | int sum(vector<int> li, int size) {
| ^
a.cc:13:6: error: variable or field 'agg' declared void
13 | void agg(vector<int> car, int avg,int size ){
| ^~~
a.cc:13:10: error: 'vector' was not declared in this scope
13 | void agg(vector<int> car, int avg,int size ){
| ^~~~~~
a.cc:13:10: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:13:17: error: expected primary-expression before 'int'
13 | void agg(vector<int> car, int avg,int size ){
| ^~~
a.cc:13:27: error: expected primary-expression before 'int'
13 | void agg(vector<int> car, int avg,int size ){
| ^~~
a.cc:13:35: error: expected primary-expression before 'int'
13 | void agg(vector<int> car, int avg,int size ){
| ^~~
a.cc: In function 'int main()':
a.cc:33:5: error: 'vector' was not declared in this scope
33 | vector<int> card(A);
| ^~~~~~
a.cc:33:5: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:33:12: error: expected primary-expression before 'int'
33 | vector<int> card(A);
| ^~~
a.cc:35:5: error: 'cin' was not declared in this scope
35 | cin >> A >> N;
| ^~~
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:37:16: error: 'card' was not declared in this scope
37 | cin >> card[i];
| ^~~~
a.cc:40:16: error: expected primary-expression before 'int'
40 | vector<int> temp(A-test);
| ^~~
a.cc:42:13: error: 'temp' was not declared in this scope
42 | temp.push_back(card[i]);
| ^~~~
a.cc:42:28: error: 'card' was not declared in this scope
42 | temp.push_back(card[i]);
| ^~~~
a.cc:44:13: error: 'temp' was not declared in this scope
44 | agg(temp, N, temp.size());
| ^~~~
a.cc:44:9: error: 'agg' was not declared in this scope
44 | agg(temp, N, temp.size());
| ^~~
a.cc:47:5: error: 'cout' was not declared in this scope
47 | cout << counts << endl;
| ^~~~
a.cc:47:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:47:23: error: 'endl' was not declared in this scope
47 | cout << counts << 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;
|
s252393553
|
p04013
|
C++
|
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
#include <iomanip>
#include <map>
#include <math.h>
#include <list>
#include <deque>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll MOD = 1000000007;
ll INF = 1LL << 60;
#define int long long
int N, A;
vector<int> x;
int dp[55][55][2555]; // dp[インデックス][枚数][合計] = 総数
int rec(int idx, int mai, int sum) {
// 全部調べ終わる
if (idx >= N) {
return ((mai * A) == sum) && (sum != 0);
}
// 計算済み
if (dp[idx][mai][sum] != -1) {
return dp[idx][mai][sum];
}
int ret = 0;
// index枚目のカードを選ぶ
int yes = rec(idx + 1, mai + 1, sum + x[idx]);
// index枚目のカードを選ばない
int no = rec(idx + 1, mai, sum);
ret += yes + no;
return dp[idx][mai][sum] = ret;
}
signed main() {
cin >> N >> A;
x.resize(N);
for (int i = 0; i < N; i++) {
cin >> x[i];
}
memset(dp, -1, sizeof(dp));
int ans = rec(0, 0, 0);
cout << ans << endl;
return 0;
}
|
a.cc:17:1: error: 'll' does not name a type
17 | ll MOD = 1000000007;
| ^~
a.cc:18:1: error: 'll' does not name a type
18 | ll INF = 1LL << 60;
| ^~
a.cc: In function 'int main()':
a.cc:55:3: error: 'memset' was not declared in this scope
55 | memset(dp, -1, sizeof(dp));
| ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
12 | #include <list>
+++ |+#include <cstring>
13 | #include <deque>
|
s620359360
|
p04013
|
C++
|
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long double PI = (acos(-1));
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
#define scll(x) scanf("%lld",&x)
static const int MAX = 50*50;
int main(){
int n, a, ans = 0,sum; sc(n), sc(a);
vector<int> x(n);
vector<vector<ll> > dp(n+1, vector<int>(2*MAX+1,0));
rep(i, 0, n) sc(x[i]), x[i] -= a;
dp[0][MAX] = 1;
rep(i, 1, n+1){
rep(j, 0, 2*MAX+1){
if (j-x[i-1]<0 || j-x[i-1]>2*MAX){
dp[i][j] = dp[i-1][j];
}else{
dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i-1]];
}
}
}
cout << dp[n][MAX] - 1 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:55: error: no matching function for call to 'std::vector<std::vector<long long int> >::vector(int, std::vector<int>)'
13 | vector<vector<ll> > dp(n+1, vector<int>(2*MAX+1,0));
| ^
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 _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed:
a.cc:13:55: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>')
13 | vector<vector<ll> > dp(n+1, vector<int>(2*MAX+1,0));
| ^
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >]'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<long long int> >'
678 | vector(initializer_list<value_type> __l,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<long long int> >]'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<std::vector<long long int> >&&'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >; std::false_type = std::false_type]'
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, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >; std::true_type = std::true_type]'
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, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<long long int> >]'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<long long int> >&'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; value_type = std::vector<long long int>; allocator_type = std::allocator<std::vector<long long int> >]'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:47: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<long long int> >::value_type&' {aka 'const std::vector<long long int>&'}
569 | vector(size_type __n, const value_type& __value,
| ~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<long long int> >]'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<long long int> >::allocator_type&' {aka 'const std::allocator<std::vector<long long int> >&'}
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; allocator_type = std::allocator<std::vector<long long int> >]'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >]'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided
|
s428928261
|
p04013
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int64_t N,A;
cin>>N>>A;
vector<int64_t>X(N);
for(int64_t i=0;i<N;i++){
int64_t x; cin>>x;
x-=A;
X.at(i)=x;
}vector<vector<int64_t>>dp(N+1,vector<int64_t>(5001,0));
dp[0][2500]=1;
for(int64_t i=1;i<=N;i++){
for(int64_t j=2500-50*i; j<=2500+50*i;j++)
dp[i][j]=dp[i-1][j]+dp[i-1][j-X.at(i-1)]
}cout<<dp[N][2500]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:47: error: expected ';' before '}' token
15 | dp[i][j]=dp[i-1][j]+dp[i-1][j-X.at(i-1)]
| ^
| ;
16 | }cout<<dp[N][2500]<<endl;
| ~
|
s858845245
|
p04013
|
C++
|
https://atcoder.jp/contests/abc044/score#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <math.h>
#include <algorithm>
#include <deque>
#include <climits>
using namespace std;
#define ll long long
#define ve vector
#define umap unordered_map
int main() {
int n, a;
cin>>n>>a;
ve<int> x(55);
ve<ve<ll> > dp(55,ve<ll>(5555));
for(int i=1;i<=n;i++) cin>>x[i];
dp[0][0]=1;
int sum=0;
for(int i=1;i<=n;i++) {
for(int j=i-1;j>=0;j--) {
for(int k=sum;k>=0;k--) {
dp[j+1][k+x[i]] += dp[j][k];
}
}
sum += x[i];
}
ll ans=0;
for(int i=1;i<=n;i++) ans+=dp[i][i*a];
cout<<ans<<endl;
}
|
a.cc:1:1: error: 'https' does not name a type
1 | https://atcoder.jp/contests/abc044/score#include <iostream>
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _Li
|
s266718410
|
p04013
|
C++
|
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl
int main(){
int n,a;
cin >> n >> a;
int x[n];
REP(i,n)cin >> x[i];
ll count = 0;
COUT(1<<n);
for(int bit=1;bit<(1<<n);bit++){
int ans = 0;
for(int i=0;i<n;i++){
if(bit&(1<<i)){
ans += x[i];
}
}
double num = __builtin_popcount(bit);
if((ans/num)==a)count++;
}
COUT(count);
return 0;
|
a.cc: In function 'int main()':
a.cc:33:14: error: expected '}' at end of input
33 | return 0;
| ^
a.cc:15:11: note: to match this '{'
15 | int main(){
| ^
|
s581845171
|
p04013
|
C++
|
n,a=map(int,input().split())
x=list(map(int,input().split()))
xsum=max(max(x),a)*n
dp=[[[0]*(xsum+1) for i in range(n+1)] for ii in range(n+1)]
dp[0][0][0]=1
for j in range(1,n+1):
for k in range(0,n+1):
for s in range(0,xsum+1):
if s<x[j-1] :
dp[j][k][s]=dp[j-1][k][s]
elif s>=x[j-1] and k>=1:
dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j-1]]
else:
dp[j][k][s]=0
dsum=0
for k in range(1,n+1):
dsum=dsum+dp[n][k][k*a]
print(dsum)
|
a.cc:1:1: error: 'n' does not name a type
1 | n,a=map(int,input().split())
| ^
|
s534352539
|
p04013
|
C++
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
int64_t test(int N, int A, int X[]);
int main(void) {
char *p;
char str[256];
int *X;
int N,A;
int i,cnt=0;
p = fgets(str, 256, stdin);
for(i=0;i<256;i++){
if(str[i] == ' ') {
str[i] = '\0';
N = atoi(p);
A = atoi(&str[i+1]);
break;
}
}
X = malloc(sizeof(int) * N);
p = fgets(str, 256, stdin);
for(i=0;i<256;i++){
if(str[i] == ' '){
str[i] = '\0';
X[cnt++] = atoi(p);
p = &str[i+1];
}else if(str[i] < '0' || str[i] > '9') {
break;
}
}
X[cnt] = atoi(p);
printf("%ld\n", test(N,A,X));
free(X);
return 0;
}
int64_t test(int N, int A, int X[]) {
int j,t;
int64_t **dp;
int64_t sum = 0;
int tmax;
int Xm = A;
int *Y = malloc(sizeof(int) * N);
for(j=0;j<N;j++){
Y[j] = X[j] - A;
if(Xm < X[j]) Xm = X[j];
}
tmax = 2 * N * Xm;
dp = calloc(1,sizeof(int64_t*) * (N+1) + (sizeof(int64_t) * ((2 * (N+1)*Xm*(N+1)) + 1)));
for(j=0;j<=N;j++){
dp[j] = (int64_t*)(((char*)dp) + (sizeof(int64_t*)*(N+1)) + (sizeof(int64_t) * j *(N+1)* 2 * Xm));
}
dp[0][N * Xm] = 1;
for(j=1;j<=N;j++){
for(t=0;t<=tmax;t++){
if((t-Y[j-1] < 0) || ((t-Y[j-1]) > tmax)){
dp[j][t] = dp[j-1][t];
} else if((0 <= (t-Y[j-1])) && ((t-Y[j-1]) <= tmax)){
dp[j][t] = dp[j-1][t] + dp[j-1][t-Y[j-1]];
}
}
}
sum = dp[N][N*Xm] - 1;
free(Y);
free(dp);
return sum;
}
|
a.cc: In function 'int main()':
a.cc:25:15: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
25 | X = malloc(sizeof(int) * N);
| ~~~~~~^~~~~~~~~~~~~~~~~
| |
| void*
a.cc: In function 'int64_t test(int, int, int*)':
a.cc:52:20: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
52 | int *Y = malloc(sizeof(int) * N);
| ~~~~~~^~~~~~~~~~~~~~~~~
| |
| void*
a.cc:58:16: error: invalid conversion from 'void*' to 'int64_t**' {aka 'long int**'} [-fpermissive]
58 | dp = calloc(1,sizeof(int64_t*) * (N+1) + (sizeof(int64_t) * ((2 * (N+1)*Xm*(N+1)) + 1)));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void*
|
s343863548
|
p04013
|
C++
|
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
ll n,a;
cin>>n>>a;
a*=n;
vector<vvll> dp(n+1,vvll(n+1,vll(a+1)));
dp[0][0][0]=1;
rep(i,n){
rep(j,n){
for(int u=0;u<=a;u++){
dp[i+1][j][u]=dp[i][j][u];
if(x[i]<=u) dp[i+1][j][u]+=dp[i][j-1][u-x[i]];
}
}
}
ll ans=0;
a/=n;
for(int i=1;i<=n;i++){
ans+=dp[n][i][i*a];
}
COUT(ans);
}
|
a.cc: In function 'int main()':
a.cc:53:12: error: 'x' was not declared in this scope
53 | if(x[i]<=u) dp[i+1][j][u]+=dp[i][j-1][u-x[i]];
| ^
|
s755809510
|
p04013
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,S,A;
long long int X=0;
cin>>N>>A;
vector<int>x(N);
for(int i=0;i<N;i++)cin>>x.at(i);
for(int i=0;true;i++){
bitset<50>s(i)
if(s.test(N))break;
S=0;
for(int j=0;j<N;j++)if(s.test(j))S+=x.at(j);
if(S==s.count()*A)X++;
}
cout<<X<<endl;
}
|
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'if'
11 | if(s.test(N))break;
| ^~
|
s728382159
|
p04013
|
C++
|
#include<iostream>
#include<cstring>
#include<queue>
#include<algorithm>
#include<cstdio>
using namespace std;
int dp[60][60][51*51+5];
int main(){
memset(dp,0,sizeof dp);
int n,a,arr[60];
cin>>n>>a;
for(int i=0;i<n;i++){
scanf("%d",arr+i);
dp[n][1][arr[i]]++;
}
for(int i=1;i<=n;i++){
for(int j=i;j>=0;j--){
for(int p=a*n+1;p>=0;a--){
dp[i][j][k]+=dp[i-1][j][k];
if(k>=x[i-1] && j>=1) dp[i][j][k]+=dp[i-1][j-1][k-x[i-1]];
}
}
}
long long ans=0;
for(int i=1;i<=n;i++) ans+=dp[n][i][a*i];
printf("%d",ans);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:42: error: 'k' was not declared in this scope
19 | dp[i][j][k]+=dp[i-1][j][k];
| ^
a.cc:20:23: error: 'x' was not declared in this scope
20 | if(k>=x[i-1] && j>=1) dp[i][j][k]+=dp[i-1][j-1][k-x[i-1]];
| ^
|
s145115071
|
p04013
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
long long N,A,x;
long long dp[300][8000],ans;
int main()
{
dp[0][0]=1;
cin>>N>A;
for(int i=1;i<=N;i++)
{
cin>>x;
for(int j=i;j>0;j--)
{
for(int k=A*N;k>=x;k--)
{
dp[j][k]+=dp[j-1][k-x];
}
}
}
for(int i=1;i<=N;i++)
{
ans+=dp[i][i*A];
}
cout<<ans<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long long int')
9 | cin>>N>A;
| ~~~~~~^~
| | |
| | long long int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:9:11: note: candidate: 'operator>(int, long long int)' (built-in)
9 | cin>>N>A;
| ~~~~~~^~
a.cc:9:11: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | cin>>N>A;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | cin>>N>A;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | cin>>N>A;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | cin>>N>A;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
9 | cin>>N>A;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | cin>>N>A;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | cin>>N>A;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int'
9 | cin>>N>A;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
9 | cin>>N>A;
| ^
/usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
9 | cin>>N>A;
| ^
/usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3942 | operator>(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
9 | cin>>N>A;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2619 | operator>(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
9 | cin>>N>A;
| ^
|
s773683527
|
p04013
|
C++
|
#include<bits/stdc++.h>
using namespace std;
long erase(long A,int n,int k){
return A%((long)pow(10,n-k);
}
int f(long A,int n){
int i,j,cnt,m=n;
long sum=0;
int a[n];
for(i=0;i<n;i++){
a[n-i-1]=(A/(int)pow(10,i))%10;
}
for(i=0;i<n;i++){
cnt=0;
sum+=pow(10,n-i-1)*a[i];
for(j=1;j<=i-1;j++){
cnt+=(int)pow(10,i-j)*a[j];
}
sum+=cnt*(int)pow(2,n-i-1);
}
for(i=0;i<n;i++){
sum+=f(erase(A,n));
n--;
}
return sum;
}
int main(){
int i,j,cnt;
string s;
cin>>s;
int a[s.size()];
for(i=0;i<s.size();i++){
a[i]=s[i]-'0';
}
long A=0;
for(i=0;i<s.size();i++){
A+=(int)pow(10,s.size()-i-1)*a[i];
}
cout<<f(A,s.size());
}
|
a.cc: In function 'long int erase(long int, int, int)':
a.cc:5:30: error: expected ')' before ';' token
5 | return A%((long)pow(10,n-k);
| ~ ^
| )
a.cc: In function 'int f(long int, int)':
a.cc:24:17: error: too few arguments to function 'long int erase(long int, int, int)'
24 | sum+=f(erase(A,n));
| ~~~~~^~~~~
a.cc:4:6: note: declared here
4 | long erase(long A,int n,int k){
| ^~~~~
|
s927919044
|
p04013
|
Java
|
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
int N, A;
cin >> N >> A;
vector<int> X(N);
rep(i, N) {
cin >> X[i];
X[i] -= A;
}
int MAX = 105 * 50;
vector<vector<ll> > dp(N, vector<ll>(MAX));
rep(i, N) {
if(i == 0) {
dp[i][MAX/2+X[i]] += 1;
dp[i][MAX/2] += 1;
} else {
rep(j, MAX) {
if(j+X[i] >= 0 && j+X[i] < MAX)
dp[i][j+X[i]] += dp[i-1][j];
dp[i][j] += dp[i-1][j];
}
}
}
cout << dp[N-1][MAX/2]-1 << endl;
return 0;
}
|
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
^
Main.java:3: error: illegal character: '#'
#define ll long long
^
Main.java:3: error: class, interface, enum, or record expected
#define ll long long
^
Main.java:4: error: illegal character: '#'
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
^
Main.java:4: error: class, interface, enum, or record expected
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
^
Main.java:4: error: class, interface, enum, or record expected
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
^
Main.java:5: error: illegal character: '#'
#define rep(i,n) REP(i,0,n)
^
Main.java:6: error: illegal character: '#'
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
^
Main.java:6: error: class, interface, enum, or record expected
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
^
Main.java:6: error: class, interface, enum, or record expected
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
^
Main.java:7: error: illegal character: '#'
#define rrep(i,n) RREP(i,n-1,0)
^
Main.java:8: error: illegal character: '#'
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
^
Main.java:8: error: class, interface, enum, or record expected
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
^
Main.java:8: error: class, interface, enum, or record expected
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
^
Main.java:9: error: illegal character: '#'
#define repl(i,n) REPL(i,0,n)
^
Main.java:10: error: illegal character: '#'
#define all(v) v.begin(), v.end()
^
Main.java:12: error: class, interface, enum, or record expected
const ll longinf = 1LL<<60;
^
Main.java:13: error: class, interface, enum, or record expected
const ll mod = 1e9+7;
^
Main.java:17: error: not a statement
cin >> N >> A;
^
Main.java:18: error: not a statement
vector<int> X(N);
^
Main.java:20: error: not a statement
cin >> X[i];
^
Main.java:24: error: not a statement
vector<vector<ll> > dp(N, vector<ll>(MAX));
^
Main.java:24: error: not a statement
vector<vector<ll> > dp(N, vector<ll>(MAX));
^
Main.java:24: error: not a statement
vector<vector<ll> > dp(N, vector<ll>(MAX));
^
Main.java:37: error: not a statement
cout << dp[N-1][MAX/2]-1 << endl;
^
Main.java:15: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
(use --enable-preview to enable unnamed classes)
Main.java:18: error: ';' expected
vector<int> X(N);
^
Main.java:18: error: ';' expected
vector<int> X(N);
^
Main.java:19: error: ';' expected
rep(i, N) {
^
Main.java:24: error: ';' expected
vector<vector<ll> > dp(N, vector<ll>(MAX));
^
Main.java:24: error: ';' expected
vector<vector<ll> > dp(N, vector<ll>(MAX));
^
Main.java:24: error: ';' expected
vector<vector<ll> > dp(N, vector<ll>(MAX));
^
Main.java:24: error: ';' expected
vector<vector<ll> > dp(N, vector<ll>(MAX));
^
Main.java:25: error: ';' expected
rep(i, N) {
^
Main.java:30: error: ';' expected
rep(j, MAX) {
^
36 errors
|
s316525055
|
p04013
|
C++
|
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if(a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
void print(const std::vector<int> &v) {
std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
std::cout << std::endl;
}
ll dp[51][51][3010];
// dp[i][j][k]
// i枚目までのカードでj枚えらんで合計がkである組み合わせ
//遷移の仕方は
// dp[i+1][j][k] = dp[i][j][k]
// dp[i+1][j+1][k+x[i]] = dp[i][j][k]
int main() {
int N, A;
cin >> N >> A;
vector<int> x(N);
int avg_cnt = 0;
ll ans = 0LL;
REP(i, N) { cin >> x[i]; }
dp[0][0][0] = 1;
REP(i, N) {
REP(j, N) {
REP(k, 2500) {
dp[i + 1][j][k] += dp[i][j][k];
dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
}
}
}
ll ans = 0;
for(int i = 1; i <= N; i++) {
ans += dp[N][i][i * A]
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:57:8: error: redeclaration of 'll ans'
57 | ll ans = 0;
| ^~~
a.cc:46:8: note: 'll ans' previously declared here
46 | ll ans = 0LL;
| ^~~
a.cc:59:31: error: expected ';' before '}' token
59 | ans += dp[N][i][i * A]
| ^
| ;
60 | }
| ~
|
s060152908
|
p04013
|
C++
|
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define bFor(i,a,b) for(i=a;i>=b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define mod 1000000007
#define endl "\n"
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}while(0)
long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}
ll modinv(ll a) {
ll b=mod,u=1,v=0,t;
while(b){
t=a/b;
a-=t*b; swap(a,b);
u-=t*v; swap(u,v);
}
return (u+mod)%mod;
}
ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}
ll modncr(ll n,ll r){
ll i,plus=1;
rep(i,r){
plus=(plus*(n-i))%mod;
plus=moddevide(plus,i+1);
}
return plus;
}
ll modncrlistp[200000],modncrlistm[200000];
ll modncrs(ll n,ll r){
ll i,j;
if(modncrlistp[n]==0){
for(i=n;i>=0;i--){
if(modncrlistp[i])break;
}
if(i<0){
modncrlistp[0]=1;
rep1(i,n+1){
modncrlistp[i]=(modncrlistp[i-1]*i)%mod;
}
}else{
For(j,i+1,n+1){
modncrlistp[j]=(modncrlistp[j-1]*j)%mod;
}
}
}
if(modncrlistm[n]==0){
for(i=n;i>=0;i--){
if(modncrlistm[i])break;
}
if(i<0){
modncrlistm[0]=1;
rep1(i,n+1){
modncrlistm[i]=(modncrlistm[i-1]*modinv(i))%mod;
}
}else{
For(j,i+1,n+1)modncrlistm[j]=(modncrlistm[j-1]*modinv(j))%mod;
}
}
return (((modncrlistp[n]*modncrlistm[r])%mod)*modncrlistm[n-r])%mod;
}
ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll countdigits(ll n){
ll ans=0;
while(n){n/=10;ans++;}
return ans;
}
ll sumdigits(ll n){
ll ans=0;
while(n){ans+=n%10;n/=10;}
return ans;
}
vec eratosthenes(ll N){
ll i;
vec ch(N+1,1),p;
ch[0]=ch[1]=0;
rep(i,N+1){
if(ch[i]){
p.push_back(i);
for(ll j=2;i*j<=N;j++){
ch[i*j]=0;
}
}
}
return ch;
}
int main(){
ll i,j,N,M,a,b,ans=0;
cin>>N>>M;
vec v(N);
rep(i,N){
cin>>v[i];
v[i]-=M;
}
map mp<datas,ll>;
set<ll> se;
queue<ll> que;
se.insert(0);
mp[datas(-1,0)]=1;
rep(j,N){
for(auto i:se){
if(!mp[datas(j-1,i+v[j])])que.push(i+v[j]);
mp[datas(j,i+v[j])]=mp[datas(j-1,i+v[j])]+mp[datas(j-1,i)];
mp[datas(j,i)]=max(mp[datas(j-1,i)],mp[datas(j,i)]);
}
while(!que.empty()){
se.insert(que.front());que.pop();
}
}
cout<<mp[datas(N-1,0)]-1<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:118:9: error: expected initializer before '<' token
118 | map mp<datas,ll>;
| ^
a.cc:122:3: error: 'mp' was not declared in this scope
122 | mp[datas(-1,0)]=1;
| ^~
|
s062415189
|
p04013
|
C++
|
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
using namespace std;
template<class T>
void in(vector<T>& V) {
for (auto itr = V.begin(); itr != V.end(); itr++)cin >> *itr;
return;
}
template<class T>
void out(vector<T>& V) {
for (T& itr : V)cout << itr << endl;
return;
}
vector<int> xa,xb;
vector < vector<long long >> suma;
vector<vector<long long>> sumb; //[枚数][和]
int N, A;
int main() {
cin >> N >> A;
suma.resize(26, vector<int>(25 * 50 + 1, 0));
sumb.resize(26,vector<int>(25*50+1,0));
xa.resize(N/2);
in(xa);
xb.resize(N - N / 2);
in(xb);
//for (int codeb = 0; codeb < (1 << (N - N / 2)); codeb++) {
// int nn = 0, SS = 0;
// for (int n = 0; n < N - N / 2; n++) {
// if ((codeb >> n) & 1) {
// nn++;
// SS += xb[n];
// }
// }
// sumb[nn][SS]++;
//}
//for (int codea = 0; codea < (1 << (N / 2)); codea++) {
// int n = 0, S = 0;
// for (int c = 0; c < N / 2; c++) {
// if ((codea >> c) & 1) {
// n++;
// S += xa[c];
// }
// }
// suma[n][S]++;
//}
suma[0][0] = 1;
for (int n = 0; n < N / 2; n++) {
for (int pn = n; pn >= 0; pn--) {
for (int S = xa[n]; S <= 25 * 50; S++) {
suma[pn + 1][S] += suma[pn][S - xa[n]];
}
}
}
sumb[0][0] = 1;
for (int n = 0; n < N - N / 2; n++) {
for (int pn = n; pn >= 0; pn--) {
for (int S = xb[n]; S <= 25 * 50; S++) {
sumb[pn + 1][S] += sumb[pn][S - xb[n]];
}
}
}
long long ans = 0;
for (int n = 0; n <= N / 2; n++) {
for (int S = 0; S <= 25 * 50; S++) {
for (int nn = 0; nn <= N - N / 2; nn++) {
int SS = A * (n + nn) - S;
if (SS < 0)continue;
ans += suma[n][S] * sumb[nn][SS];
}
}
}
cout << ans-1 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:39:20: error: no matching function for call to 'std::vector<std::vector<long long int> >::resize(int, std::vector<int>)'
39 | suma.resize(26, vector<int>(25 * 50 + 1, 0));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1013:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int]'
1013 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1013:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1034:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type, const value_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; value_type = std::vector<long long int>]'
1034 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1034:54: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<long long int> >::value_type&' {aka 'const std::vector<long long int>&'}
1034 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
a.cc:40:20: error: no matching function for call to 'std::vector<std::vector<long long int> >::resize(int, std::vector<int>)'
40 | sumb.resize(26,vector<int>(25*50+1,0));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1013:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int]'
1013 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1013:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1034:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type, const value_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; value_type = std::vector<long long int>]'
1034 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1034:54: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<long long int> >::value_type&' {aka 'const std::vector<long long int>&'}
1034 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
|
s182441120
|
p04013
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N,A;
cin>>N>>A;
vector<int> x(N);
rep(i,N) {
cin>>x[i];
x[i] -= A;
}
vector<vector<uint64_t>> dp(N,vector<uint64_t>(100));
//dp[i][50-j]は、x[0]~x[i]からうまく選んで合計がj(-49~+49)になるようなパターンの合計。
//ans = dp[N-1][50];(j=0のとき)
rep(i,50){
for(int j=-49;j<=49;j++){
dp[i][
cout<<dp[N-1][50]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:26: error: expected ']' before ';' token
19 | cout<<dp[N-1][50]<<endl;
| ^
| ]
a.cc:18:12: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long unsigned int> >, std::vector<long unsigned int> >::value_type' {aka 'std::vector<long unsigned int>'} and 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'})
18 | dp[i][
| ^
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:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>; reference = long unsigned int&; size_type = long unsigned int]'
1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::vector<long unsigned int>::size_type' {aka 'long unsigned int'}
1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>; const_reference = const long unsigned int&; size_type = long unsigned int]'
1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::vector<long unsigned int>::size_type' {aka 'long unsigned int'}
1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:16:12: note: to match this '{'
16 | rep(i,50){
| ^
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s045956761
|
p04013
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
long long dp[N+1][N+1][N*A+1];
int main(){
long long N, A;
cin >> N >> A;
vector<long long> x(N+1);
for(int i = 0; i < N; i++){
cin >> x[i+1];
}
// dp[j][k][s] := (x_1 ... x_j から k 枚選んで合計 s にするような選び方の総数)
dp[0][0][0] = 1;
for(long long j = 0; j < N+1; j++){
for(long long k = 0; k < N+1; k++){
for(long long s = 0; s < N*A+1; s++){
if(j >= 1 && s < x[j]){ // j枚目を選ばないで 合計s
dp[j][k][s] = dp[j-1][k][s];
}else if(j >= 1 && k >= 1 && s >= x[j]){ // j枚目を選ばないで合計s と j枚目を選んで合計s
dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-x[j]];
}
}
}
}
long long ans = 0;
for(int k = 1; k < N+1; k++){
ans += dp[N][k][k*A];
}
cout << ans << endl;
return 0;
}
|
a.cc:7:14: error: 'N' was not declared in this scope
7 | long long dp[N+1][N+1][N*A+1];
| ^
a.cc:7:19: error: 'N' was not declared in this scope
7 | long long dp[N+1][N+1][N*A+1];
| ^
a.cc:7:24: error: 'N' was not declared in this scope
7 | long long dp[N+1][N+1][N*A+1];
| ^
a.cc:7:26: error: 'A' was not declared in this scope
7 | long long dp[N+1][N+1][N*A+1];
| ^
a.cc: In function 'int main()':
a.cc:19:5: error: 'dp' was not declared in this scope
19 | dp[0][0][0] = 1;
| ^~
|
s101221396
|
p04013
|
C++
|
#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int n, a;
vector<int> arr;
ll dp[51][2507][51];
int answer(int cnt, int curr, int total){
if(cnt == n){
if(total == 0) return 0;
int k = curr / total;
if(k * total == curr && k == a) return 1;
return 0;
}
if(dp[cnt][curr][total] != 0) return dp[cnt][curr][total];
/*if(total != 0){
double avg = curr / total;
if(avg > (double)a && avg <= arr[curr]) return;
}*/
//if(total != 0 && curr / total < a) return;
return dp[cnt][curr][total] = answer(cnt+1, curr, total) + answer(cnt+1, curr+arr[cnt], total+1);
}
int main() {
// your code goes here
//int n, a;
cin >> n >> a;
arr.resize(n);
for(int i=0; i<n; i++) cin >> arr[i];
sort(arr.begin(), arr.end());
ans = answer(0, 0, 0);
cout << ans << endl;
}
|
a.cc:6:1: error: 'll' does not name a type
6 | ll dp[51][2507][51];
| ^~
a.cc: In function 'int answer(int, int, int)':
a.cc:14:8: error: 'dp' was not declared in this scope; did you mean 'dup'?
14 | if(dp[cnt][curr][total] != 0) return dp[cnt][curr][total];
| ^~
| dup
a.cc:20:12: error: 'dp' was not declared in this scope; did you mean 'dup'?
20 | return dp[cnt][curr][total] = answer(cnt+1, curr, total) + answer(cnt+1, curr+arr[cnt], total+1);
| ^~
| dup
|
s435816498
|
p04013
|
C++
|
#include<iostream>
using namespace std;
typedef long long ll;
const int N = 55;
int n, A;
int a[N];
ll mem[N][N][N * N];
ll dp(int i, int cnt, int sum) {
if (i == n) {
if (cnt == 0)return 0;
if ((sum / cnt == A) && (sum % cnt == 0))return 1;
return 0;
}
ll& ret = mem[i][cnt][sum];
if (ret != -1)return ret;
return ret = dp(i + 1, cnt, sum) + dp(i + 1, cnt + 1, sum + a[i]);
}
int main() {
cin >> n >> A;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
memset(mem, -1, sizeof mem);
cout << dp(0, 0, 0) << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:32:9: error: 'memset' was not declared in this scope
32 | memset(mem, -1, sizeof mem);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s648275790
|
p04013
|
C++
|
#include<cstdio>
using namespace std;
typedef long long ll;
const int N = 55;
int n, A;
int a[N];
ll mem[N][N][N * N];
ll dp(int i, int cnt, int sum) {
if (i == n) {
if (cnt == 0)return 0;
if ((sum / cnt == A) && (sum % cnt == 0))return 1;
return 0;
}
ll& ret = mem[i][cnt][sum];
if (ret != -1)return ret;
return ret = dp(i + 1, cnt, sum) + dp(i + 1, cnt + 1, sum + a[i]);
}
int main() {
scanf("%d %d", &n, &A);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
memset(mem, -1, sizeof mem);
printf("%lld\n", dp(0, 0, 0));
return 0;
}
|
a.cc: In function 'int main()':
a.cc:35:9: error: 'memset' was not declared in this scope
35 | memset(mem, -1, sizeof mem);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 | using namespace std;
|
s815687220
|
p04013
|
C++
|
#include<cstdio>
using namespace std;
typedef long long ll;
const int N = 55;
int n, A;
int a[N];
ll mem[N][N][N * N];
ll dp(int i, int cnt, int sum) {
if (i == n) {
if (cnt == 0)return 0;
if ((sum / cnt == A) && (sum % cnt == 0))return 1;
return 0;
}
ll& ret = mem[i][cnt][sum];
if (ret != -1)return ret;
return ret = dp(i + 1, cnt, sum) + dp(i + 1, cnt + 1, sum + a[i]);
}
int main() {
scanf_s("%d %d", &n, &A);
for (int i = 0; i < n; i++) {
scanf_s("%d", &a[i]);
}
memset(mem, -1, sizeof mem);
printf("%lld\n", dp(0, 0, 0));
return 0;
}
|
a.cc: In function 'int main()':
a.cc:29:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
29 | scanf_s("%d %d", &n, &A);
| ^~~~~~~
| scanf
a.cc:35:9: error: 'memset' was not declared in this scope
35 | memset(mem, -1, sizeof mem);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 | using namespace std;
|
s717148576
|
p04013
|
C++
|
#include<cstdio>
using namespace std;
typedef long long ll;
const int N = 55;
int n, A;
int a[N];
ll mem[N][N][N * N];
ll dp(int i, int cnt, int sum) {
if (i == n) {
if (cnt == 0)return 0;
if ((sum / cnt == A) && (sum % cnt == 0))return 1;
return 0;
}
ll& ret = mem[i][cnt][sum];
cout << mem[i][cnt][sum] << endl;
if (ret != -1)return ret;
return ret = dp(i + 1, cnt, sum) + dp(i + 1, cnt + 1, sum + a[i]);
}
int main() {
scanf_s("%d %d", &n, &A);
for (int i = 0; i < n; i++) {
scanf_s("%d", &a[i]);
}
memset(mem, -1, sizeof mem);
printf("%lld\n", dp(0, 0, 0));
return 0;
}
|
a.cc: In function 'll dp(int, int, int)':
a.cc:22:9: error: 'cout' was not declared in this scope
22 | cout << mem[i][cnt][sum] << endl;
| ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<cstdio>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:22:37: error: 'endl' was not declared in this scope
22 | cout << mem[i][cnt][sum] << endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<cstdio>
+++ |+#include <ostream>
2 | using namespace std;
a.cc: In function 'int main()':
a.cc:30:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
30 | scanf_s("%d %d", &n, &A);
| ^~~~~~~
| scanf
a.cc:36:9: error: 'memset' was not declared in this scope
36 | memset(mem, -1, sizeof mem);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 | using namespace std;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.