submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s234778610 | p04000 | C++ | #include<map>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define REP(i,e,s) for(register int i=e; i<=s; i++)
#define DREP(i,e,s) for(register int i=e; i>=s; i--)
#define ll long long
#define DE(...) fprintf(stderr,__VA_ARGS__)
#define DEBUG(a) DE("DEBUG: %d\n",a)
#define... | a.cc: In function 'int main()':
a.cc:34:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
34 | REP(i,1,n) {
| ^
a.cc:8:37: note: in definition of macro 'REP'
8 | #define REP(i,e,s) for(register int i=e; i<=s; i++)
| ... |
s548120301 | p04000 | C++ | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l... | a.cc: In function 'int main()':
a.cc:69:12: error: expected '}' at end of input
69 | return 0;
| ^
a.cc:43:12: note: to match this '{'
43 | int main() {
| ^
|
s730198162 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
map<pair<int,int>,int>mp;
int h,w,n,cnt[10];
int main(){
cin>>h>>w>>n;
while(n--){
int x,y;cin>>x>>y;
for(int i=max(1,x-2);i<=min(h-2,x);i++)for(int j=max(1,y-2);j<=min(w-2,y);j++)mp[pair<int,int>(i,j)]++;
}
map<pair<int,int>,int>::tera ter;ter=... | a.cc: In function 'int main()':
a.cc:12:33: error: 'tera' is not a member of 'std::map<std::pair<int, int>, int>'
12 | map<pair<int,int>,int>::tera ter;ter=mp.begin();
| ^~~~
a.cc:12:42: error: 'ter' was not declared in this scope
12 | map<pair<int,int>,int>::... |
s290901427 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
map<pair<int,int>,int>mp;
int h,w,n,cnt[10];
int main(){
cin>>h>>w>>n;
while(n--){
int x,y;cin>>x>>y;
for(int i=max(1,x-2);i<=min(h-2,x);i++)for(int j=max(1,y-2);j<=min(w-2,y);j++)mp[pair<int,int>(i,j)]++;
}
map<pair<int,int>,int>::tera ter;ter=... | a.cc: In function 'int main()':
a.cc:12:33: error: 'tera' is not a member of 'std::map<std::pair<int, int>, int>'
12 | map<pair<int,int>,int>::tera ter;ter=mp.begin();
| ^~~~
a.cc:12:42: error: 'ter' was not declared in this scope
12 | map<pair<int,int>,int>::... |
s499212156 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
map<pair<int,int>,int>mp;
int h,w,n,cnt[10];
int main(){
cin>>h>>w>>n;
while(n--){
int x,y;cin>>x>>y;
for(int i=max(1,x-2);i<=min(h-2,x);i++)for(int j=max(1,y-2);j<=min(w-2,y);j++)mp[pair<int,int>(i,j)]++;
}
map<pair<int,int>,int>::tera ter;ter=... | a.cc: In function 'int main()':
a.cc:12:33: error: 'tera' is not a member of 'std::map<std::pair<int, int>, int>'
12 | map<pair<int,int>,int>::tera ter;ter=mp.begin();
| ^~~~
a.cc:12:42: error: 'ter' was not declared in this scope
12 | map<pair<int,int>,int>::... |
s103875521 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
map<pair<int,int>,int>mp;
int h,w,n,cnt[10];
int main(){
cin>>h>>w>>n;
while(n--){
int x,y;cin>>x>>y;
for(int i=max(1,x-2);i<=min(h-2,x);i++)for(int j=max(1,y-2);j<=min(w-2,y);j++)mp[pair<int,int>(i,j)]++;
}
map<pair<int,int>,int>::tera ter;ter=... | a.cc: In function 'int main()':
a.cc:12:33: error: 'tera' is not a member of 'std::map<std::pair<int, int>, int>'
12 | map<pair<int,int>,int>::tera ter;ter=mp.begin();
| ^~~~
a.cc:12:42: error: 'ter' was not declared in this scope
12 | map<pair<int,int>,int>::... |
s965992393 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
int H,W,N,a,b;
set< pair<int,int> > brd;
int dem[15];
signed main(){
cin>>H>>W>>N;
dem[0]=(H-2)*(W-2);
while(N--)
{
cin>>a>>b;
a--;b--;
brd.insert({a,b});
for(int x=max((int)0,a-2);x<=min(H-3,a);x++)
{
for(int y=max((int)0,b-2);y<=min... | a.cc:40:17: error: 'a' does not name a type
40 | a--;b--;
| ^
a.cc:40:21: error: 'b' does not name a type
40 | a--;b--;
| ^
a.cc:41:17: error: 'brd' does not name a type
41 | brd.insert({a,b});
| ... |
s497477215 | p04000 | C++ | #include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <ios>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
using namespace std;
typedef long long ll;
#define mp make_pair... | a.cc: In function 'int main()':
a.cc:59:9: error: conflicting declaration 'int tmp [5][5]'
59 | int tmp[5][5];
| ^~~
a.cc:41:9: note: previous declaration as 'int tmp'
41 | int tmp;
| ^~~
|
s382076508 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<long, long> P;
int binary_search(vector<P> &tmp, long long x, long long y_up, long long y_down){
int ok = (int)tmp.size();
int ng = -1;
while (abs(ok - ng) > 1){
int mid = (ok + ng) / 2;
if (tmp[mid].first >= x) ok = mid;
el... | a.cc: In function 'int binary_search(std::vector<std::pair<long int, long int> >&, long long int, long long int, long long int)':
a.cc:32:32: error: 'y_donw' was not declared in this scope; did you mean 'y_down'?
32 | if (tmp[mid].second >= y_donw + 1) ok4 = mid;
| ^~~~~~... |
s952687540 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<long, long> P;
int binary_search(vector<P> &tmp, long long &x, long long &y_up, long long &y_down){
int ok = (int)tmp.size();
int ng = -1;
while (abs(ok - ng) > 1){
int mid = (ok + ng) / 2;
if (tmp[mid].first >= x) ok = mid;
... | a.cc: In function 'int main()':
a.cc:40:36: error: no matching function for call to 'binary_search(std::vector<std::pair<long int, long int> >&, long long int, long long int, long long int)'
40 | ss += binary_search(tmp, x + i, y + j, y + j + 2);
| ~~~~~~~~~~~~~^~~~~~~~~~~... |
s483496514 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<long, long> P;
int binary_search(vector<P> &tmp, long long &x, long long &y_up, long long &y_down){
int ok = (int)tmp.size();
int ng = -1;
while (abs(ok - ng) > 1){
int mid = (ok + ng) / 2;
if (tmp[mid].first >= x) ok = mid;
... | a.cc: In function 'int main()':
a.cc:39:36: error: no matching function for call to 'binary_search(std::vector<std::pair<long int, long int> >&, long long int, long long int, long long int)'
39 | ss += binary_search(tmp, x + i, y + j, y + j + 2);
| ~~~~~~~~~~~~~^~~~~~~~~~~... |
s697832843 | p04000 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int main(void) {
int num, a, b, i, k = 0, sum = 0;
long long H, W, ss;
cin >> H >> W >> num;
ss = (H - 2) * (W - 2);
vector<pair<int, int>> list(9 * num);
vector<int> ans(10, 0);
map<pair<int, int>, int> mp;
pair<int, int> p;
for (i = ... | a.cc: In function 'int main()':
a.cc:17:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
17 | scanf_s("%d%d", &a, &b);
| ^~~~~~~
| scanf
|
s981887124 | p04000 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
long long int H, W, N;
cin >> H >> W >> N;
map<pair<long long int, long long int>, long long int>MLL;
for( int i = 0; i < N; i++ ) {
long long int a, b;
cin >> a >> b... | a.cc: In function 'int main()':
a.cc:11:9: error: 'map' was not declared in this scope
11 | map<pair<long long int, long long int>, long long int>MLL;
| ^~~
a.cc:7:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
6 | #include <string.h>
... |
s994077991 | p04000 | C++ | #include <iostream>
#include <map>
#include <utility>
using namespace std;
int main(){
long H,W,N;
scanf("%ld",&H);
scanf("%ld",&W);
scanf("%ld",&N);
std::map<pair<int, int>, long> m;
// Create grid mappings
for(long h=1 ; h<=H-2 ; h++){
for(long w=1 ; w<=W-2 ; w++){
m[make_pair(h,w)] = 0;
}
}
lo... | a.cc: In function 'int main()':
a.cc:40:25: error: 'class std::map<std::pair<int, int>, long int>' has no member named 'second'
40 | count[m.second]++;
| ^~~~~~
|
s318638241 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
namespace std {
template <>
class hash<pair<int64_t, int64_t>> {
public:
size_t operator()(const pair<int64_t, int64_t>& d) const {
return hash<int64_t>()(d.first) + hash<int64_t>()(d.second);
}
};
} // namespace std
int64_t main() {
ios_base::sync_with_stdio... | a.cc:15:1: error: '::main' must return 'int'
15 | int64_t main() {
| ^~~~~~~
|
s588650663 | p04000 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
const int maxn=1000007,p1=100007,p2=10007;
int vis[1000010];
long long cou[12];
int n,bux[9]={-2,-2,-2,-1,-1,-1,0,0,0},buy[9]={-1,-2,0,-1,-2,0,-1,-2,0};
long long h,w;
char ch;
inline int get_num(){
int num=0;ch=getchar();
whi... | a.cc: In function 'void work(int, int)':
a.cc:28:30: error: reference to 'hash' is ambiguous
28 | node=hash(nowx,nowy);
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
... |
s333894329 | p04000 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
const int maxn=1000007,p1=100007,p2=10007;
int vis[1000010];
long long cou[12];
int n,bux[9]={-2,-2,-2,-1,-1,-1,0,0,0},buy[9]={-1,-2,0,-1,-2,0,-1,-2,0};
long long h,w;
char ch;
inline int get_num(){
int num=0;ch=getchar();
whi... | a.cc: In function 'void work(int, int)':
a.cc:27:30: error: reference to 'hash' is ambiguous
27 | node=hash(nowx,nowy);
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
... |
s992645754 | p04000 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
using namespace std;
const int maxn=1000007,p1=100007,p2=10007;
int vis[1000010];
long long cou[12];
int n,bux[9]={-2,-2,-2,-1,-1,-1,0,0,0},buy[9]={-1,-2,0,-1,-2,0,-1,-2,0};
long long h,w;
char ch;... | a.cc: In function 'void work(int, int)':
a.cc:30:30: error: reference to 'hash' is ambiguous
30 | node=hash(nowx,nowy);
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
... |
s303315996 | p04000 | C++ | #include<iostream>
#include<cstdio>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
const long long hash=456123;
long long hashx[10000007];
long long ans[10000007];
int dx[9]={-2,-2,-2,-1,-1,-1,0,0,0};
int dy[9]={-2,-1,0,-2,-1,0,-2,-1,0};
int tot;
int main()
{
long long H,W,... | a.cc: In function 'int main()':
a.cc:29:50: error: reference to 'hash' is ambiguous
29 | hashx[tot++] =xx*hash+yy;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/bas... |
s710250422 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
const long long hash=456123;
long long hashx[10000007];
long long ans[10000007];
int dx[9]={-2,-2,-2,-1,-1,-1,0,0,0};
int dy[9]={-2,-1,0,-2,-1,0,-2,-1,0};
int tot;
int main()
{
long long H,W,N;
cin>>H>>W>>N;
long long ans0=(H-2)*(W-2);
for(int i=0;i<N;i++)
{
int x,y;
... | a.cc: In function 'int main()':
a.cc:24:50: error: reference to 'hash' is ambiguous
24 | hashx[tot++] =xx*hash+yy;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/bas... |
s832810955 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
a,b,H,W;
int64_t cnt[10];
map<pair<int64_t, int64_t>, int64_t> mp;
int N,i,j,k;
int64_t sm;
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(0);
// ifstream in("input.txt");
// cin.rdbuf(in.rdbuf());
cin>>H>>W>>N;
for(i=0;i<N;i++){
cin>>a>>b;
... | a.cc:4:2: error: 'a' does not name a type
4 | a,b,H,W;
| ^
a.cc: In function 'int main()':
a.cc:16:8: error: 'H' was not declared in this scope
16 | cin>>H>>W>>N;
| ^
a.cc:16:11: error: 'W' was not declared in this scope
16 | cin>>H>>W>>N;
| ^
a.cc:18:10: error: 'a' wa... |
s415659170 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
ll a,b,H,W;
ll cnt[10];
map<pair<ll, ll>, ll> mp;
int N,i,j,k;
ll sm;
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(0);
// ifstream in("input.txt");
// cin.rdbuf(in.rdbuf());
cin>>H>>W>>N;
for(i=0;i<N;i++){
cin>>a>>b;
a--;b--;
for(j=-... | a.cc:4:1: error: 'll' does not name a type
4 | ll a,b,H,W;
| ^~
a.cc:5:1: error: 'll' does not name a type
5 | ll cnt[10];
| ^~
a.cc:6:10: error: 'll' was not declared in this scope
6 | map<pair<ll, ll>, ll> mp;
| ^~
a.cc:6:14: error: 'll' was not declared in this scope
6 | ma... |
s606975016 | p04000 | C++ | //
// Created by Tzyark on 2018/9/18.
//
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int H, W, N, a, b;
ll ans[10];
vector<pair<int, int>> vec;
int main() {
cin >> H >> W >> N;
for (int n = 0; n < N; n++) {
cin >> a >> b;
for (int i = 0; i < 3; i++) {
... | a.cc: In function 'int main()':
a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'short'?
23 | sort(vec.begin(), vec.end());
| ^~~~
| short
|
s489605471 | p04000 | C++ | #include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{//这里快读快写有30多行,我就省略了.
using namespace std;
const int yuzu=1e5;
typedef pair<int,int> pii;
map<pii,int> mp;
int h=read(),w=read(),n=read(),cnt[10];
int main(){
int i,j;
for (;n--;){
int x=read(),y=read();
for (i=max(1,x-2);i<=min(h-2,x);++i){
for... | a.cc:7:11: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
7 | int h=read(),w=read(),n=read(),cnt[10];
| ~~~~^~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
from /usr/include/signal.h:328,
from /usr/include/c++/14/csign... |
s348561090 | p04000 | C++ | /* goes here */
#include<bits/stdc++.h> //1
using namespace std; //2
typedef signed long long ll; //3
#define INF 0x3f3f3f3f //4
vector<pair<long long, long long>> rekkyo; //1
#define int ll //2
bool isvalid (ll i, ll j, ll h, ll w) { //3
if(i<0 || h<=i || j<0 || w<=j){ //4
return false; //1
} return... | a.cc: In function 'int main()':
a.cc:56:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
56 | char* ukuku09 = "Ukunichia"; Satanichia = (int)ukuku09; //3
| ^~~~~~~~~~~
a.cc:57:13: error: expected ';' at end of input
57 | return 0
| ... |
s361988476 | p04000 | C++ | /* goes here */
#include<bits/stdc++.h> //1
using namespace std; //2
typedef signed long long ll; //3
#define INF 0x3f3f3f3f //4
vector<pair<long long, long long>> rekkyo; //1
#define int ll //2
bool isvalid (ll i, ll j, ll h, ll w) { //3
if(i<0 || h<=i || j<0 || w<=j){ //4
return false; //1
} return... | a.cc: In function 'int main()':
a.cc:53:21: error: 'i' was not declared in this scope
53 | Ans[0]-=Ans[i]; //4
| ^
a.cc:56:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
56 | char* ukuku09 = "Ukunichia"; Satanichia = (int)ukuku09; //... |
s851801893 | p04000 | C++ | /* goes here */
#include<bits/stdc++.h> //1
using namespace std; //2
typedef signed long long ll; //3
#define INF 0x3f3f3f3f //4
vector<pair<long long, long long>> rekkyo; //1
#define int ll //2
bool isvalid (ll i, ll j, ll h, ll w) { //3
if(i<0 || h<=i || j<0 || w<=j){ //4
return false; //1
} return... | a.cc: In function 'int main()':
a.cc:44:54: error: no matching function for call to 'std::map<std::pair<long long int, long long int>, long long int>::insert(std::pair<long long int, long long int>&)'
44 | if (taplis.find(i) == taplis.end()) taplis.insert( //3
| ~~~~... |
s685359991 | p04000 | C++ | /* goes here */
#include<bits/stdc++.h> //1
using namespace std; //2
typedef signed long long ll; //3
#define INF 0x3f3f3f3f //4
vector<pair<long long, long long>> rekkyo; //1
#define int ll //2
bool isvalid (ll i, ll j, ll h, ll w) { //3
if(i<0 || h<=i || j<0 || w<=j){ //4
return false; //1
} return... | a.cc: In function 'int main()':
a.cc:38:11: error: found ':' in nested-name-specifier, expected '::'
38 | for(i : rekkyo){ //1
| ^
| ::
a.cc:38:9: error: 'i' is not a class, namespace, or enumeration
38 | for(i : rekkyo){ //1
| ^
a.cc:40:21: error: expected ';... |
s650726177 | p04000 | C++ | /* goes here */
#include<bits/stdc++.h> //1
using namespace std; //2
typedef signed long long ll; //3
#define INF 0x3f3f3f3f //4
vector<pair<long long, long long>> rekkyo; //1
#define int ll; //2
bool isvalid (ll i, ll j, ll h, ll w) { //3
if(i<0 || h<=i || j<0 || w<=j){ //4
return false; //1
} retur... | a.cc: In function 'int main()':
a.cc:7:13: error: declaration does not declare anything [-fpermissive]
7 | #define int ll; //2
| ^~
a.cc:13:5: note: in expansion of macro 'int'
13 | int H,W,N; //4
| ^~~
a.cc:13:9: error: 'H' was not declared in this scope
13 | int H,W,N;... |
s469827723 | p04000 | C++ | #include <iostream>
#include <cstdint>
#include <unordered_map>
#include <algorithm>
#include <array>
std::uint_fast64_t make_key(const std::int_fast64_t y, const std::int_fast64_t x) {
return (static_cast<std::uint_fast64_t>(y) << 32u) | static_cast<std::uint_fast64_t>(x);
}
int main() {
std::int_fast64_t h, w, ... | a.cc: In function 'int main()':
a.cc:30:41: error: 'accumulate' is not a member of 'std'
30 | results[0] = (h - 2) * (w - 2) - std::accumulate(results.begin() + 1, results.end(), 0, [](const std::int_fast64_t sum, const std::int_fast64_t x) { return sum + x; });
| ^~~~... |
s622986844 | p04000 | C++ | #include<cstdio>
#include<map>
using namespace std;
#define LL long long
LL H,W,N;
LL ans[10];
LL dx[]={-2,-2,-2,-1,-1,-1,0,0,0};
LL dy[]={-2,-1,0,-2,-1,0,-2,-1,0};
map<LL,LL> m;
void slove(LL x,LL y)
{
LL a,b;
LL id;
for(int i=0;i<9;i++){
a=x+dx[i];
b=y+dy[i];
if(a<1 || b<1 || a>H-2... | a.cc: In function 'int main()':
a.cc:41:9: error: 'cout' was not declared in this scope
41 | cout<<ans[i]<<endl;
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<map>
+++ |+#include <iostream>
3... |
s089480202 | p04000 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1000000000;
const ll LINF = (ll) 4000000000000000000;
const ll MOD = (ll) 1000000007;
const double PI = acos(1.0);
const int limit = 100010;
#define R... | a.cc: In function 'int main()':
a.cc:36:30: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = pos; _Tp = bool; _Hash = std::hash<pos>; _Pred = std::equal_to<pos>; _Alloc = std::allocator<std::pair<const pos, bool> >]'
36 | unordered_map<pos, bool> m... |
s301522715 | p04000 | C++ | // ConsoleApplication56.cpp : アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<cstring>
#include<algorithm>
#include<cmath>
#include<string>
#include<iostream>
#include<vector>
#include<utility>
using namespace std;
int main()
{
int ans[10] = {};
long long int i, j, k, l, m, n, s,H,W,N;
long long int sum... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s896483915 | p04000 | C | import static java.util.function.Function.*;
import static java.util.stream.Collectors.*;
import java.util.*;
public class Main {
public void main(Scanner sc) {
int h = sc.nextInt();
int w = sc.nextInt();
int n = sc.nextInt();
Map<String, Integer> map = new HashMap<>();
for... | main.c:1:7: error: expected ';' before 'static'
1 | import static java.util.function.Function.*;
| ^~~~~~~
| ;
main.c:1:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import static java.util.function.Function.*;
| ^
main.c:2:7: er... |
s426932038 | p04000 | C++ | #include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;
const long Max_h = 1000000000;
const long Max_w = 1000000000;
const int Max_n = 100000;
long a[Max_n]; // y
long b[Max_n]; // x
pair<long,long> p[Max_n];
int main()
{
int index = 0;
long count_array[16] = {0};
lo... | a.cc: In function 'int main()':
a.cc:43:48: error: conversion from 'std::vector<std::pair<long int, long int> >::iterator' to non-scalar type 'std::vector<std::pair<long int, long int>*>' requested
43 | for (vector<pair<long,long>* > itr = p2.begin(); itr != p2.end(); itr++) {
| ... |
s307034195 | p04000 | C++ | #include <iostream>
#include <map>
using namespace std;
typedef long long ll;
int main(){
ll i,j,k;
ll a,b,c;
ll h,w,n;
cin>>h>>w>>n;
map<pair<int,int>,int> cnt;
for(i=0;i<n;i++){
cin>>a>>b;
for(j=-1;j<=1;j++){
for(k=-1;k<=1;k++){
if(a+j>=1 && a+j<=h && b+k>=1 && b+j<=w){
cnt[make_pair(a... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s918294728 | p04000 | C++ | #include <iostream>
#include <map>
using namespace std;
typedef long long ll;
int main(){
ll i,j,k;
ll a,b,c;
ll h,w,n;
cin>>h>>w>>n;
map<pair<int,int>,int> cnt;
for(i=0;i<n;i++){
cin>>a>>b;
for(j=-1;j<=1;j++){
for(k=-1;k<=1;k++){
if(a+j>=1 && a+j<=h && b+k>=1 && b+j<=w){
cnt[make_pair(a+j,b+... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s847750640 | p04000 | C++ | #include <iostream>
#include <map>
using namespace std;
typedef long long ll;
ll i,j,k;
ll a,b,c;
ll h,w,n;
int main(){
cin>>h>>w>>n;
map<pair<int,int>,int> cnt;
for(i=0;i<n;i++){
cin>>a>>b;
for(j=-1;j<=1;j++){
for(k=-1;k<=1;k++){
if(a+j>=1 && a+j<=h && b+k>=1 && b+j<=w){
cnt[make_pair(a+j,b+k)]+... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s026436121 | p04000 | C++ | #include <iostream>
#include <map>
using namespace std;
typedef long long ll;
ll i,j,k;
ll a,b,c;
ll ans=0;
ll h,w,n;
int main(){
cin>>h>>w>>n;
map<pair<int,int>,int> cnt;
for(i=0;i<n;i++){
cin>>a>>b;
for(j=-1;j<=1;j++){
for(k=-1;k<=1;k++){
if(a+j>=1 && a+j<=h && b+k>=1 && b+j<=w){
cnt[make_pair(... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s845546277 | p04000 | C++ | #include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <random>
#include <utility>
#include <cmath>
#include <set>
#include <map>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typ... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s698501405 | p04000 | C++ | #include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <random>
#include <utility>
#include <cmath>
#include <set>
#include <map>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typ... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s089421206 | p04000 | C++ | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
unordered_map<ii, int> MAP, visited;
vi ans(10);
ll h, w;
void visit(ii v) {
if (visited[... | a.cc:12:24: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]'
12 ... |
s445764986 | p04000 | C++ | from collections import Counter
H,W,N = map(int, input().split())
ddx = [0,0,0,1,1,1,-1,-1,-1]
ddy = [-1,0,1,-1,0,1,-1,0,1]
cnt = []
for _ in range(N):
y, x = map(int, input().split())
for dx, dy in zip(ddx, ddy):
yy = y + dy
xx = x + dx
if 1 < xx < W and 1 < yy < H:
cnt.append(yy * W + xx)
cnt = Counter(... | a.cc:18:2: error: invalid preprocessing directive #print
18 | #print(cnt)
| ^~~~~
a.cc:1:1: error: 'from' does not name a type
1 | from collections import Counter
| ^~~~
|
s100451068 | p04000 | C++ | aa | a.cc:1:1: error: 'aa' does not name a type
1 | aa
| ^~
|
s705505528 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
map<pair<int,int>,int>M;
vector<pair<int,int>>vec,vec2;
int H,W,n,a,b;
long long cnt1[10];
void valid(int x,int y){if(x<0 || x>=H-2 || y<0 || y>=W-2){return false;}return true;}
int main(){
cin>>H>>W>>n;
for(int i=0;i<n;i++){
cin>>a>>b;a--;b--;M[make_pair(a,b)]=1;
for(... | a.cc: In function 'void valid(int, int)':
a.cc:7:67: error: return-statement with a value, in function returning 'void' [-fpermissive]
7 | void valid(int x,int y){if(x<0 || x>=H-2 || y<0 || y>=W-2){return false;}return true;}
| ^~~~~
a.cc:7:81:... |
s515917087 | p04000 | C++ | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) if(DEBUG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DEBUG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::_... |
s992726470 | p04000 | C | #include<stdio.h>
#include<stdlib.h>
#define MALLOC(type, n) (type *)malloc((n)*sizeof(type))
#define HASH(A, W, B) (((W%166667)*(A%166667)+B%166667)%166667)
#define TYPELIST unsigned long
struct list{
TYPELIST item;
struct list *next;
};
typedef struct list List;
void KillList(List *list){
if(list!=NULL){
Kil... | main.c: In function 'main':
main.c:32:35: error: expected ';' before 'List'
32 | unsigned long long ans[10]
| ^
| ;
33 | List *table[166667], *lp;
| ~~~~
main.c:36:29: error: 'ans' ... |
s187823231 | p04000 | Java | import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
public class Main {
static long h, w;
static int n;
static int[] a, b;
public static void main(String[] args){
FastScanner sc = new FastScanner();
h = sc.nextInt(); w = sc.nextInt();
n = sc.nextInt();
a = new int[n]; b ... | Main.java:11: error: cannot find symbol
FastScanner sc = new FastScanner();
^
symbol: class FastScanner
location: class Main
Main.java:11: error: cannot find symbol
FastScanner sc = new FastScanner();
^
symbol: class FastScanner
location: class Main
2 errors
|
s188932632 | p04000 | C++ | #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <bitset>
#include <map>
#define INF_LL 9000000000000000000
#define INF 2000000000
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = ... | a.cc: In function 'int main()':
a.cc:73:14: error: expected ';' before '==' token
73 | for(int i==0;i<3;i++){
| ^~
| ;
a.cc:73:14: error: expected primary-expression before '==' token
73 | for(int i==0;i<3;i++){
| ^~
a.cc:73:21: error: expected ')' ... |
s930564871 | p04000 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
typedef long long ll;
using namespace std;
int H, W, N;
int a, b;
set<pair<int, int> > kuro;
ll dp[10];
signed main()
{
cin >> H >> W >> N;
rep(i,10) dp[i] = 0;
dp[0] = (H - 2) * (W - 2);
rep(i,N) {
cin >> a >> b;
for (int x... | a.cc: In function 'int main()':
a.cc:20:31: error: no matching function for call to 'max(int, long long int)'
20 | for (int x=max(1, b-2); x<=b; x++) {
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linu... |
s938522547 | p04000 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
typedef long long ll;
using namespace std;
int H, W, N;
int a, b;
set<pair<int, int> > kuro;
ll dp[10];
signed main()
{
cin >> H >> W >> N;
rep(i,10) dp[i] = 0;
dp[0] = (H - 2) * (W - 2);
rep(i,N) {
cin >> a >> b;
for (int... | a.cc: In function 'int main()':
a.cc:34:20: error: expected unqualified-id before '.' token
34 | set.insert(make_pair(a, b));
| ^
|
s642716255 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
main(){
long long X;
cin >> X;
int N=log10(X)+1;
int M=pow(2,N-1);
int S=0;
for (int i=0;i<M;i++){
int A=X;
int SUM=0;
int L=0;
int j=i;
for (int i2=0;i2<N;i2++){
int L=L+1;
if (j%2==1)... | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:18:26: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
18 | SUM=SUM+A%pow(10,L... |
s118106993 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
main(){
long long X;
cin >> X;
int N=log10(X)+1;
int M=pow(2,N-1);
int S=0;
for (int i=0;i<M;i++){
int A=X;
int SUM=0;
int L=0;
j=i;
for (int i2=0;i2<N;i2++){
L=L+1;
if (j%2==1){
... | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'j' was not declared in this scope
14 | j=i;
| ^
a.cc:18:26: error: invalid operands of types 'int' and '__gnu_cxx::__promote<doub... |
s344234935 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int length,sum = 0,num = 0;
string S,T = "";
cin >> S;
length = S.size()-1;
for(int mask = 0;mask < (1<<length)); mask++){
for(int i=0;i<length;i++){
if(mask & (1<<i)){
for(int j = num;j <= i; j++)T += S.at(j);
... | a.cc: In function 'int main()':
a.cc:11:39: error: expected ';' before ')' token
11 | for(int mask = 0;mask < (1<<length)); mask++){
| ^
| ;
a.cc:11:42: error: 'mask' was not declared in this scope; did you mean 'std::filesyst... |
s171331308 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
string S;
cin >> S;
const int num = S.size() - 1;
int64_t ans = 0;
for (int tmp = 0; tmp < (1 << num); tmp++) {
bitset<num> b(tmp);
int sum = 0;
string T = "";
for (int i = 0; i < num; i++) {
if(b.test(0)){
sum ... | a.cc: In function 'int main()':
a.cc:12:15: error: the value of 'num' is not usable in a constant expression
12 | bitset<num> b(tmp);
| ^
a.cc:7:13: note: 'num' was not initialized with a constant expression
7 | const int num = S.size() - 1;
| ^~~
a.cc:12:15: note: in ... |
s618179094 | p04001 | C | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
int main(){
string s; cin >> s;
int sz = s.size();
ll all_pat = pow(2, sz - 1);
ll ans = 0;
reverse(s.begin(), s.end());
rep(pat, all_pat){
ll d... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s042672511 | p04001 | C | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
int n;
string str;
string copy;
cin >> str;
copy = str;
n = str.length() - 1;//+を入れることができる場所の数
long long total = 0LL;
for (int bit = 0; bit < (1 << n); ++bit)
{
vector<int> S;
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s734221855 | p04001 | C++ | #include <iostream>
#include <bitset>
using namespace std;
int main() {
string str;
cin >> str;
long long ans = 0, tmp;
for (int i = 0;i < pow(2,str.size()-1);i++) {
bitset<9> s(i);
tmp = str[0] - '0';
for (int j = 0;j < str.size()-1;j++) {
if (s.test(j)) {
ans += tmp;
tmp = str[j + 1] - '0';
... | a.cc: In function 'int main()':
a.cc:9:28: error: 'pow' was not declared in this scope
9 | for (int i = 0;i < pow(2,str.size()-1);i++) {
| ^~~
|
s280266444 | p04001 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
#define intt long long
int main() {
std::string S; std::cin >> S;
int N = S.size() - 1;
int ans = 0;
for (int bit = 0; bit < (1 << N); ++bit) {
int total = 0;
for (int i = 0; i < N; ++i) {
total *= 1... | a.cc: In function 'int main()':
a.cc:27:14: error: expected unqualified-id before ':' token
27 | std:::cout << ans << std::endl;
| ^
|
s985443386 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int size = S.size();
long sum = 0;
for (int i = 0; i < size; i++){
for (int j = i + 1; j <= size; j++){
long target = atoi(S.substr(i, j - i).c_str());
int insert_space = 0;
if (i > 1) insert_space += i - ... | a.cc: In function 'int main()':
a.cc:18:4: error: expected '}' at end of input
18 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s157827125 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
cout << A << endl;
} | a.cc: In function 'int main()':
a.cc:11:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>')
11 | cout << A << endl;
| ~~~~ ^~ ~
| | |
| | std::vector<int>
| std::ostream {aka std::basic_ostream<ch... |
s838593949 | p04001 | C++ | #include <iostream>
#include <string>
using namespace std;
long add(const string& numbers, const int& bitsOfPlusPosition);
int main() {
string numbers;
cin >> numbers;
long answer = 0;
for (int bits = 0; bits < (1 << (numbers.size() - 1)); ++bits) {
answer += add(numbers, bits);
}... | /usr/bin/ld: /tmp/cct5qwac.o: in function `main':
a.cc:(.text+0x4b): undefined reference to `add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int const&)'
collect2: error: ld returned 1 exit status
|
s992629836 | p04001 | C++ | #include <iostream>
#include <string>
using namespace std;
long add(const string& numbers, const int& bitsOfPlusPosition);
int main() {
string numbers;
cin >> numbers;
long answer = 0;
for (int bits = 0; bits < (1 << (numbers.size() - 1)); ++bits) {
answer += add(numbers, bits);
}... | a.cc: In function 'long int add(const std::string&, const int&)':
a.cc:24:17: error: 'DECIMAL_BASE' was not declared in this scope; did you mean 'DICIMAL_BASE'?
24 | term *= DECIMAL_BASE;
| ^~~~~~~~~~~~
| DICIMAL_BASE
|
s370870162 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
char s[15];
long long cof[15],n,data[15],pow_10[10],cnt,cou=0;
void gen(long long lv)
{
if(lv==n-1)
{
data[n-1]=1;
/*for(int i=0;i<n-1;i++)
{
printf("%lld ",data[i]);
}
printf("\n");*/
cnt=0;
for(int i=n-1;i>=0;i--)
{
if(data[i]==1)
{
cnt=0;
... | a.cc: In function 'void gen(long long int)':
a.cc:9:17: error: reference to 'data' is ambiguous
9 | data[n-1]=1;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/... |
s265490453 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
char s[15];
long long cof[15],n,data[15],pow_10[10],cnt,cou=0;
void gen(long long lv)
{
if(lv==n-1)
{
data[n-1]=1;
/*for(int i=0;i<n-1;i++)
{
printf("%lld ",data[i]);
}
printf("\n");*/
cnt=0;
for(int i=n-1;i>=0;i--)
{
if(data[i]==1)
{
cnt=0;
... | a.cc: In function 'void gen(long long int)':
a.cc:9:17: error: reference to 'data' is ambiguous
9 | data[n-1]=1;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/... |
s594036666 | p04001 | C++ | #include <bits/stdc++.h>
/* 本当は個別にヘッダファイルを読みだすべき
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#in... | a.cc: In function 'int main()':
a.cc:59:9: error: 's' was not declared in this scope
59 | dfs(s,0,0,0);
| ^
|
s703986595 | p04001 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string a;
int sum=0;
cin >> a;
for(int i=1;i<=a.size()-1;i++){
a.insert(a[i],"+");
sum+=a;
}
cout<<sum<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:8: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
10 | sum+=a;
| ~~~^~~
|
s251118536 | p04001 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
str a;
int sum=0;
cin >> a;
for(int i=1;i<=a.size()-1;i++){
a.insert(a[i],"+");
sum+=a;
}
cout<<sum<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'str' was not declared in this scope; did you mean 'std'?
5 | str a;
| ^~~
| std
a.cc:7:10: error: 'a' was not declared in this scope
7 | cin >> a;
| ^
|
s442442672 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
int sum=0, size, flag=0;
size = S.size();
vector<int> A(size);
for(int i=0;i<size;i++){
A.at(i) = (S.at(i) - '0');
}
for(int tmp=0;tmp < (1 << 9);tmp++){
bitset(10) p(tmp);
p.set(9);
for(int i=0;i<size;i+... | a.cc: In function 'int main()':
a.cc:16:14: error: class template argument deduction failed:
16 | bitset(10) p(tmp);
| ^
a.cc:16:14: error: no matching function for call to 'bitset(int)'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
... |
s919980626 | p04001 | C | #include<bits/stdc++.h>
using namespace std;
int a[15];
int num=1,len;
long long ans=0;
string s;
int main()
{
cin>>s;
len=s.size();
for(int i=0;i<len;i++)
a[i+1]=(s[i]-'0');
for(int i=1;i<len;i++)
num*=2;
for(int i=0;i<num;i++)
{
bool b[15]={0};
int tmp=i;
int k=1;
while(tmp)
b[k++]=tmp%2,tmp/=2;
... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s948246660 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M=0,sum=0,X=1;
cin>>N;
int n=N;
while(!(n/10==0)){
sum++;
n /=10
}
int c=pow(2, sum);
for(int tmp=0;tmp<c;tmp++){
bitset<9> A(tmp);
int s=N;
int t=1;
for(int i=0;i<sum;i++){
if(A.test(i)){
int a=pow(10, ... | a.cc: In function 'int main()':
a.cc:10:11: error: expected ';' before '}' token
10 | n /=10
| ^
| ;
11 | }
| ~
|
s245426272 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M=0,sum=0,X=1;
cin>>N;
int n=N
while(!(n/10==0)){
sum++;
n /=10
}
int c=pow(2, sum);
for(int tmp=0;tmp<c;tmp++){
bitset<9> A(tmp);
int s=N;
int t=1;
for(int i=0;i<sum;i++){
if(A.test(i)){
int a=pow(10, t... | a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'while'
8 | while(!(n/10==0)){
| ^~~~~
|
s093211766 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M=0,sum=0,X=1;
cin>>N;
while(!(N/10==0)){
sum++;
}
for(int tmp=0;tmp<pow(2, sum);tmp++){
bitset<9> A(tmp);
int s=N;
int t=1;
for(int i=0;i<sum;i++){
if(A.test(i)){
M +=s%pow(10, t);
s /=pow(10, t);
... | a.cc: In function 'int main()':
a.cc:16:14: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
16 | M +=s%pow(10, t);
| ~^~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {... |
s289864348 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M=0,sum=0,X=1;
cin>>N;
while(!(N/10==0)){
sum++;
}
for(int tmp=0;tmp<pow(2, sum);tmp++){
bitset<9> A(tmp)
int s=N;
int t=1;
for(int i=0;i<sum;i++){
if(A.test(i)){
M +=s%pow(10, t);
s /=pow(10, t);
... | a.cc: In function 'int main()':
a.cc:12:5: error: expected ',' or ';' before 'int'
12 | int s=N;
| ^~~
a.cc:16:13: error: 's' was not declared in this scope
16 | M +=s%pow(10, t);
| ^
a.cc:22:9: error: 's' was not declared in this scope
22 | M +=s;
| ^
|
s017631580 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
int main(){
string s;
cin>>s;
int sum=0;
for(int i=0;i<s.size... | a.cc: In function 'int main()':
a.cc:24:16: error: redeclaration of 'std::string str'
24 | string str="";
| ^~~
a.cc:17:16: note: 'std::string str' previously declared here
17 | string str="";
| ^~~
|
s698010221 | p04001 | C++ | #include "bits/stdc++.h"
#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) ... | a.cc: In function 'long long int dfs(long long int, long long int, long long int)':
a.cc:10:12: error: expected primary-expression before 'long'
10 | #define ll long long
| ^~~~
a.cc:27:18: note: in expansion of macro 'll'
27 | ll add = ll(S[index] - '0') * times;
| ... |
s244534310 | p04001 | C++ | #include "bits/stdc++.h"
#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) ... | a.cc: In function 'long long int dfs(long long int, long long int, long long int)':
a.cc:27:18: error: expected primary-expression before 'long'
27 | ll add = long long(S[index]- long long('0')) * times;
| ^~~~
a.cc:10:12: error: expected primary-expression before 'long'
10 | #defin... |
s306854194 | p04001 | C++ | #include "bits/stdc++.h"
#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) ... | a.cc: In function 'long long int dfs(long long int, long long int, long long int)':
a.cc:10:12: error: expected primary-expression before 'long'
10 | #define ll long long
| ^~~~
a.cc:27:18: note: in expansion of macro 'll'
27 | ll add = ll(S[index]-ll('0')) * times;
| ... |
s460958321 | p04001 | C++ | #include "bits/stdc++.h"
#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) ... | a.cc: In function 'long long int dfs(long long int, long long int, long long int)':
a.cc:10:12: error: expected primary-expression before 'long'
10 | #define ll long long
| ^~~~
a.cc:27:18: note: in expansion of macro 'll'
27 | ll add = ll(S[index]-ll('0')) * times;
| ... |
s578519181 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
long long calc(string s){
int N = s.size();
long long ret = stoll(s);
//recursive step
for(int i=1;i<N;i++){
string sl = s.substr(0,i);
ret += stoll(sl)*pow(2,sr.size()-1);
string sr = s.substr(i,N-i);
ret += calc(sr);
}
return ret;
}
int ... | a.cc: In function 'long long int calc(std::string)':
a.cc:11:28: error: 'sr' was not declared in this scope; did you mean 'sl'?
11 | ret += stoll(sl)*pow(2,sr.size()-1);
| ^~
| sl
|
s530370468 | p04001 | C++ | #include <algorithm>
#include <cmath>
#include <ctype.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ENDL '\n'
#define ... | a.cc: In function 'long long int calc(std::string&)':
a.cc:34:94: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
34 | sum += stoll(s.substr(0, i)) * (long long)pow(2, len - i - 1) +... |
s174006317 | p04001 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<map>
#include<cstdlib>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
string s;
int main(){
int ans=0;
cin >> s;
int n = s.size();
long long int a;
rep(i,(1<<(n-1) -... | a.cc:36:2: error: unterminated argument list invoking macro "rep"
36 | }
| ^
a.cc: In function 'int main()':
a.cc:23:5: error: 'rep' was not declared in this scope
23 | rep(i,(1<<(n-1) - 1){
| ^~~
a.cc:23:8: error: expected '}' at end of input
23 | rep(i,(1<<(n-1) - 1){
| ... |
s991665922 | p04001 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <cmath>
int main(int argc, const char * argv[]) {
std::string S;
std::cin >> S;
unsigned long size = S.size();
if(size == 1) {
std::cout << S;
return;
}
long long count = std::pow(2, size - 1);
long long su... | a.cc: In function 'int main(int, const char**)':
a.cc:14:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
14 | return;
| ^~~~~~
|
s046955382 | p04001 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char s[11];
scanf("%s",s);
int i,j;
long long ans=0;
long long tmp; // ’+’で分割したものを代入
for(i=0;i<( 1 << ( strlen(s) - 1 ) );i++){ // S="125"なら、i=(00)_2~(11)_2まで。
// strlen(s) に... | a.cc:14:45: error: extended character is not valid in an identifier
14 | // strlen(s) にすると、i=(111)_2までになる。
| ^
a.cc:23:20: error: extended character is not valid in an identifier
23 | ans += tmp; // 最後の分割部... |
s467350778 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int sum(int n) {
vector<int> on;
while(on >= 0) {
on.push_back(n % 10);
on /= 10;
}
return all_sum(n, on);
}
int all_sum(int n; vector<int> on) {
}
int main() {
int n;
vector<int> on;
cin >> n;... | a.cc: In function 'int sum(int)':
a.cc:7:12: error: no match for 'operator>=' (operand types are 'std::vector<int>' and 'int')
7 | while(on >= 0) {
| ~~ ^~ ~
| | |
| | int
| std::vector<int>
In file included from /usr/include/c++/14/regex:68,
... |
s592998907 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int solve(string S)
{
long long Ssize = S.size();
long long sum = 0;
if (Ssize == 1)
{
int ss = S[0] - '0';
cout << ss << endl;
return 0;
}
for (long long bit = 0; bit < (1 << (Ssize - 1)); bit++)
{
string num = ... | a.cc: In function 'int solve(std::string)':
a.cc:23:25: error: 'setbit' was not declared in this scope; did you mean 'setuid'?
23 | cout << setbit<8>(1 << i) << endl;
| ^~~~~~
| setuid
a.cc:23:43: error: invalid operands of types 'int' and '... |
s338380249 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int solve(string S)
{
long long Ssize = S.size();
long long sum = 0;
if (Ssize == 1)
{
int ss = S[0] - '0';
cout << ss << endl;
return 0;
}
for (long long bit = 0; bit < (1 << (Ssize - 1)); bit++)
{
string num = ... | a.cc: In function 'int solve(std::string)':
a.cc:23:25: error: 'setbit' was not declared in this scope; did you mean 'setuid'?
23 | cout << setbit<8>(1 << i) << endl;
| ^~~~~~
| setuid
a.cc:23:43: error: invalid operands of types 'int' and '... |
s577462500 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int solve(string S)
{
long long Ssize = S.size();
long long sum = 0;
if (Ssize == 1)
{
int ss = S[0] - '0';
cout << ss << endl;
return 0;
}
for (long long bit = 0; bit < (1 << (Ssize - 1)); bit++)
{
string num = ... | a.cc: In function 'int solve(std::string)':
a.cc:23:25: error: 'setbit' was not declared in this scope; did you mean 'setuid'?
23 | cout << setbit<8>(1 << i) << endl;
| ^~~~~~
| setuid
a.cc:23:43: error: invalid operands of types 'int' and '... |
s708632436 | p04001 | C | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using ll = long long;
int main(){
string s;
cin >> s;
int n = s.size();
ll ans = 0;
for(int bit = 0; bit < (1 << (n-1)); bit++){
ll tmp = 0;
for(int i = 0; i < n; i++){
if... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s145894053 | p04001 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
long long sum(int i, string &s){
int n = s.size()-1;
vector<long long> part;
part.push_back(s[0]-'0');
for(int j=0; j<n; j++){
if((i<<j)&1){
part.push_back(s[j+1]);
}
else{
part.back() *= 10;
... | a.cc: In function 'long long int sum(int, std::string&)':
a.cc:20:3: error: 'll' was not declared in this scope
20 | ll rtn = 0;
| ^~
a.cc:22:5: error: 'rtn' was not declared in this scope
22 | rtn += part[j];
| ^~~
a.cc:24:10: error: 'rtn' was not declared in this scope
24 | return r... |
s942204788 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
int res = 0;
string s;
void dfs(int i, int sum, int psum, string &s) {
int n = s.size();
int si = s.at(i) - '0';
if (i == n - 1) {
res += sum + si + 10 * psum;
return;
}
dfs(i + 1, sum + si + 10 * psum, 0, s);
dfs(i + 1, sum, 10 * p... | a.cc:21:7: error: redefinition of 'long long int res'
21 | int res = 0;
| ^~~
a.cc:4:5: note: 'long long int res' previously defined here
4 | int res = 0;
| ^~~
a.cc:22:6: error: expected constructor, destructor, or type conversion before '(' token
22 | dfs(0, 0, s);
| ^
a... |
s307283829 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size() - 1;
int res = 0;
for (int bit = 0; bit < (1<<n); bit++) {
int sum = 0;
for (int i = 0; i < n; i++) {
int si = s.at(i) - '0'
if ((1<<i) & bit) {
res = res + 10 * sum + si;
sum =... | a.cc: In function 'int main()':
a.cc:13:7: error: expected ',' or ';' before 'if'
13 | if ((1<<i) & bit) {
| ^~
a.cc:17:7: error: 'else' without a previous 'if'
17 | else {
| ^~~~
|
s336174439 | p04001 | C | #include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
using namespace std;
#define ll long long
int n;
string ss;
vector<int> now;
ll ans;
void dfs(int cur)
{
if(cur==n-1)
{
now.push_back(n-1);
ll pre=0; int last=-1;
for(int i=0;i<(int)now.size();i++)... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s453798274 | p04001 | C | #include <bits/stdc++.h>
using namespace std;
string s;
vector<int> v;
long long ans=0;
long long sti(int l,int r){
long long sum=0;
for(int i=l;i<=r;i++){
sum=sum*10+s[i]-'0';
}
return sum;
}
void dfs(){
if(v.size()+1==s.size()){
long long l=0,sum=0;
for(int i=0;i<s.size()-1;i++){
if(v[i]==1){
sum+=s... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s721753259 | p04001 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int main(){
long long sum = 0;
string S;
cin >> S;
int n = S.size();
for (int i = 0; i < pow(2, n-1);i++){
long long part = 0;
for(int j = 0; j < n-1;j++){
part *= 10;
part += (int)(S[j] - '0');
... | a.cc: In function 'int main()':
a.cc:27:6: error: expected '}' at end of input
27 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s264147981 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
long long calc(string s)
{
int len = s.length();
long long sum ;
sum = stoll(s);
for(int i=1;i<len;i++)
{
string left =s.substr(0,i);
sum += stoll(left) * pow(2,len-i-1);
string right = substr(i,len-i);
... | a.cc: In function 'long long int calc(std::string)':
a.cc:17:24: error: 'substr' was not declared in this scope; did you mean 'strstr'?
17 | string right = substr(i,len-i);
| ^~~~~~
| strstr
|
s072496301 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
long long calc(string s)
{
int len = s.length();
long long sum ;
sum = stoll(s);
for(int i=1;i<len;i++)
{
string left =s.substr(0,i);
sum += stoll(left) * pow(2,len-i-1);
string right = substr(i,len-i);
... | a.cc: In function 'long long int calc(std::string)':
a.cc:17:24: error: 'substr' was not declared in this scope; did you mean 'strstr'?
17 | string right = substr(i,len-i);
| ^~~~~~
| strstr
|
s059712800 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
long f(long n) {
if (n < 10) return n;
long a = 100, b = 1, c = 11;
while (true) {
if (n < a) return n/(a/10)*c + f(n%(a/10))*2;
a *= 10;
b *= 2;
c = 10*c + b;
}
}
long main() {
long x;
cin >> x;
cout << f(x) << endl;
}
| cc1plus: error: '::main' must return 'int'
|
s336265703 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int sum_plus(string &S, string plus, int n, int ans) {
int sum = 0;
if (n == 0) {
sum = S.at(0);
for (int i = 0; i < plus.size(); i++) {
if (plus.at(i) == "0") {
sum *= 10;
sum += S.at(i + 1);
}
else {
ans += sum;
... | a.cc: In function 'int sum_plus(std::string&, std::string, int, int)':
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (plus.at(i) == "0") {
| ~~~~~~~~~~~^~~~~~
|
s404713052 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int sum_plus(string &S, string plus, int n, int ans) {
int sum = 0;
if (n == 0) {
sum = S.at(0);
for (int i = 0; i < plus.size(); i++) {
if (plus.at(i) == "0") {
sum *= 10;
sum += S.at(i + 1);
}
else {
ans += sum;
... | a.cc: In function 'int sum_plus(std::string&, std::string, int, int)':
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (plus.at(i) == "0") {
| ~~~~~~~~~~~^~~~~~
a.cc:21:10: error: invalid use of non-static member function 'void std::__cxx11::basic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.