submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s645253752 | p04017 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
const int maxn = 1e5 + 5;
int dp[maxn][21] , a[maxn] , n , L;
int ask (int x , int c)
{
int pos = x;
if (pos == -1) return 1e9;
for (int i = 20 ; i >= 0 ; i--){
if (c... | a.cc:103:1: error: 'v' does not name a type
103 | v
| ^
|
s934720626 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
int bs(const int &n, const int &t, const int &a[]){
int l = 0, h = n-1;
while (l<=h){
int mid = (l+h)/2;
if (a[mid] <= t) l = mid+1;
else h = mid-1;
}
return l-1;
}
signed main(){
int n, l, q, x, y; cin >> n;
int a[n];
for (int i=0; i<n... | a.cc:5:47: error: declaration of 'a' as array of references
5 | int bs(const int &n, const int &t, const int &a[]){
| ^
a.cc: In function 'long long int bs(...)':
a.cc:6:24: error: 'n' was not declared in this scope
6 | int l = 0, h = n-1;
| ... |
s673272544 | p04017 | C++ | #include<bits/stdc++.h>
using namespace std;
#define N 100000 + 5
#define rep(i, l, r) for(int i = l; i <= r; ++i)
int n, l, q, a, b, tot, size, x[N], nxt[N], last[N], cntb[N], block[N];
int read(){
char c; int x = 0, f = 1;
c = getchar();
while(c > '9' || c < '0'){ if(c == '-') f = -1; c = getchar();}
... | a.cc: In function 'int main()':
a.cc:14:17: error: reference to 'size' is ambiguous
14 | n = read(), size = sqrt(n), tot = ceil(1.0 * n / size);
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/includ... |
s224114876 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
const int maxn=112345;
int n,x[maxn],l,q,f[maxn][20];
int main()
{
scanf("%d",&n);
for (int i=1;i<=n;++i) scanf("%d",&x[i]);
scanf("%d%d",&l,&q);
for (int i=1;i<=n;++i) {
int t=upper_bound(x+1,x+1+n,x[i]+l)-x-1;
f[i][0]=t;
}
for (int ... | a.cc: In function 'int main()':
a.cc:15:30: error: expected primary-expression before ';' token
15 | for (int j=1;j<=n+1==;++j)
| ^
|
s378932729 | p04017 | C++ | #include "header.hpp"
// #define int long long
signed main() {
//input
int N;cin>>N;
vector<int> x(N);
rep(n, N) cin>>x[n];
int L;cin>>L;
int Q;cin>>Q;
//solve
vector<vector<int>> db(N, vector<int>(20));
rep(n, N){
// fill: db[n][0]
// x[n] + L
db[n][0] = up... | a.cc:1:10: fatal error: header.hpp: No such file or directory
1 | #include "header.hpp"
| ^~~~~~~~~~~~
compilation terminated.
|
s537403908 | p04017 | C++ | #pragma GCC Optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define lp(i,begin,end) for (int i=begin;i<end;i++)
const int N=1e5+5,M=N*N,OO=0x3f3f3f3f;
int n,l,q,arr[N],x,y;
int lst,far,d;
struct query{
int x,y,qnum,ans;
}qarr[N];
bool cmp(query a,query b){
if(a.x==b.x)return ... | a.cc:6:22: warning: integer overflow in expression of type 'int' results in '1411065433' [-Woverflow]
6 | const int N=1e5+5,M=N*N,OO=0x3f3f3f3f;
| ~^~
a.cc: In function 'int mnroot(int)':
a.cc:19:24: error: invalid conversion from 'int*' to 'int' [-fpermissive]
19 | idx=lower_bo... |
s066596550 | p04017 | C++ | //#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
//#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
//#pragma GCC target("avx2") //Enable AVX
#include<bits/stdc++.h>
using namespace std;
#define int ll
#define all(a) begin(a),end(a)
#define F... | a.cc:85:10: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
85 | void clr(auto &a,int n){
| ^~~~
a.cc:90:10: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
90 | void unq(auto &a){
| ^~~... |
s392560074 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end(... | a.cc: In function 'int32_t main()':
a.cc:112:2: error: expected '}' at end of input
112 | }
| ^
a.cc:62:15: note: to match this '{'
62 | int32_t main(){
| ^
|
s195780863 | p04017 | C++ | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const do... | a.cc: In function 'int main()':
a.cc:116:13: error: 'm' was not declared in this scope
116 | r = m;
| ^
a.cc:118:13: error: 'm' was not declared in this scope
118 | l = m;
| ^
|
s889301407 | p04017 | C++ | nclude <bits/stdc++.h>
using namespace std ;
#define N 100010
int n , L , m ;
int a[ N ] , to[ N ] ;
int num , block , belong[ N ] ;
int nxt[ N ] , val[ N ] ;
int find( int x ) {
int l = x + 1 , r = n , ans = 0 ;
while( l <= r ) {
int mid = ( l + r ) >> 1 ;
if( a[ mid ] - a[ x ] <= L ) l =... | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude <bits/stdc++.h>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:23:5: error: 'scanf' was not declared in this scope
23 | scanf( "%d" , &n ) ;
| ^~~~~
a.cc:27:5: error: 'sort' was not declared in this scope; did you mean 'short'?
27 | ... |
s959755286 | p04017 | C++ | #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
#define F first
#define S second
int a[100009][20];
int b[100009];
int n,L,test;
signed main(){
cin>>n;
r(i,n) cin>>b[i];
cin>>L;
r(j,20){
if(j==0){
int id=0,sum=0;
r(i,n){
w... | a.cc: In function 'int main()':
a.cc:34:9: error: 'eixt' was not declared in this scope; did you mean 'exit'?
34 | eixt(0);
| ^~~~
| exit
|
s420086256 | p04017 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
ll n,len,q;
ll num;
ll block;
ll a[100010];
ll b[100010];
ll to[100010];
ll nxt[100010];
ll step[100010];
ll find(ll x)
{
ll ans=0;
ll l=1,r=n;
while(l<=r)
{
ll mid=(l+r)/2... | a.cc: In function 'void build()':
a.cc:67:25: error: 'val' was not declared in this scope
67 | val[i]--,nxt[i]--;
| ^~~
|
s722080537 | p04017 | C++ | #include<bits/stdc++.h>
#define N 100010
#define swap(a,b) a^=b^=a^=b
using namespace std;
int l,n,m;
int f[N][25]={},a[N]={};
int read(){int s=0,w=1;char ch=getchar();while((ch>'9'||ch<'0')&&ch!='-')ch=getchar();if(ch=='-')w=-1;while(ch<='9'&&ch>='0')s=s*10+ch-'0',ch=getchar();return s*w;}
struct rode{int l,r;}e[N*2]=... | a.cc:27:17: error: expected unqualified-id before 'for'
27 | for(int i=1;i<=m;++i)
| ^~~
a.cc:27:29: error: 'i' does not name a type
27 | for(int i=1;i<=m;++i)
| ^
a.cc:27:34: error: expected unqualified-id before '++' token
... |
s210376796 | p04017 | C | //此程序使用了qt专属名称,请勿模仿。侵权必究!!!
//我真是太菜了……
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1000100;
int n,m,l,k;
int a[N],f[N][30];
inline int read()
{
int sum=0,flag=1;
char c;
for(;c<'0'||c>'9';c=getchar())if(c=='-') flag=-1;
for(;c>='0'&&c<='9';c=getchar())sum=(sum<<1)+(sum<<3)+c-'0';
... | main.c:3:9: fatal error: bits/stdc++.h: No such file or directory
3 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s561536262 | p04017 | C++ | #include<cstdio>
#include<vector>
using namespace std;
const int N=100002;
int n,L,q,x[N],i,j,k,a,b,l,r;
int h[N],t[N],v[N],Ans[N];
int dep[N],p[N];
struct Uzi{
int d,id;
};
vector<Uzi>g[N];
void add(int a,int b){
t[++k]=h[a];
h[a]=k;
v[k]=b;
}
void init(){
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",x+i);
sc... | a.cc: In function 'void dfs(int)':
a.cc:37:23: error: no match for 'operator[]' (operand types are 'int [100002]' and '__gnu_cxx::__alloc_traits<std::allocator<Uzi>, Uzi>::value_type' {aka 'Uzi'})
37 | if(dep[g[i][j]].d==dep[i])
| ^
|
s219695255 | p04017 | C | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int a[100005];
int dp[100005][50];
ll read()
{
ll sum=0;int f=1,c=getchar();
while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
while(c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}
return sum*f;
}
int main()
{
int n=read();
for(int i=1;i<=n;... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s364472942 | p04017 | C | #include<bits/stdc++.h>
#define ll int
using namespace std;
ll n,l,q;
ll x[100005],a[100005],b[100005];
ll le[100005],ri[100005];
ll read()
{
ll sum=0;int f=1,c=getchar();
while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
while(c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}
return sum*f;
}
void pre(int p)
{
int ... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s966629566 | p04017 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=100010;
int n,x[maxn],l,q,a,b,vis[maxn],nextnext[maxn][20];
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')
f=-1;
ch=getc... | a.cc: In function 'int query(int, int)':
a.cc:49:17: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
49 | int main()
| ^~
a.cc:49:17: note: remove parentheses to default-initialize a variable
49 | int main()
| ^~
... |
s472430102 | p04017 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=100010;
int n,x[maxn],l,q,a,b,vis[maxn],nextnext[maxn][20];
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')
f=-1;
ch=getc... | a.cc: In function 'int query(int, int)':
a.cc:49:17: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
49 | int main()
| ^~
a.cc:49:17: note: remove parentheses to default-initialize a variable
49 | int main()
| ^~
... |
s788887506 | p04017 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=100010;
int n,x[maxn],l,q,a,b,vis[maxn],next[maxn][20];
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')
f=-1;
ch=getchar(... | a.cc: In function 'int query(int, int)':
a.cc:33:20: error: reference to 'next' is ambiguous
33 | if(next[s][i]<=e&&next[s][i])
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
fro... |
s678586346 | p04017 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=100010;
int n,x[maxn],l,q,a,b,vis[maxn],next[maxn][20];
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')
f=-1;
ch=getchar(... | a.cc: In function 'int query(int, int)':
a.cc:33:20: error: reference to 'next' is ambiguous
33 | if(next[s][i]<=e&&next[s][i])
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
fro... |
s680697607 | p04017 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define fre(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)
using namespace std;
inline int read(){
int sum=0,f=1;char ch=getchar();
while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){sum=sum*10+ch-'0';c... | a.cc: In function 'int main()':
a.cc:42:22: error: 'sqrt' was not declared in this scope
42 | n=read();gap=sqrt(n);
| ^~~~
|
s166873250 | p04017 | C++ | #include<bits/stdc++.h>
#define rg register
#define file(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout);
using namespace std;
int read(){
int x=0,f=1;char c=getchar();
while(c<'0'||c>'9') f=(c=='-')?-1:1,c=getchar();
while(c>='0'&&c<='9') x=x*10+c-48,c=getchar();
return f*x;
}
struct node {
i... | a.cc:19:21: error: stray '#' in program
19 | head[x]=cnt;#include<bits/stdc++.h>
| ^
a.cc: In function 'void add(int, int)':
a.cc:19:22: error: 'include' was not declared in this scope
19 | head[x]=cnt;#include<bits/stdc++.h>
| ^~~~~~~
a.cc:19:3... |
s929249483 | p04017 | C++ | #include <iostream>
using namespace std;
int d[100002][20];
int power2(int n){
int res = 1;
for(int i = 0; i < n; i++) res *= 2;
return res;
}
int main()
{
int n;
cin >> n;
int x[100002];
for(int i = 0; i < n; i++) cin >> x[i];
int l;
cin >> l;
for(int i = 0; i < n; i++){
... | a.cc: In function 'int main()':
a.cc:21:20: error: 'upper_bound' was not declared in this scope
21 | d[i][0] = (upper_bound(x, x + n, x[i] + l) - x) - 1;
| ^~~~~~~~~~~
|
s328269463 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vecto... | cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:19:13: error: expected primary-expression before 'long'
19 | #define int long long
| ^~~~
a.cc:6:33: note: in expansion of macro 'int'
6 | #define REP(i,n) for(int i=0; i<int(n); i++)
| ... |
s377284705 | p04017 | C++ | #include <assert.h>
#include <limits.h>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using ll = ... | a.cc: In function 'int main()':
a.cc:66:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
66 | std::cout<<ans+1<<"\n";
| ^~~
| abs
|
s169980928 | p04017 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include <fstream>
#include <time.h>
#in... | a.cc:93:30: error: macro "REPR" passed 3 arguments, but takes just 2
93 | REPR(j, 29, 0) {
| ^
a.cc:25:9: note: macro "REPR" defined here
25 | #define REPR(i, n) for(int i = n;i >= 0;i--)
| ^~~~
a.cc: In function 'int main()':
a.cc:93:17: error: 'RE... |
s785068698 | p04017 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef int long long
typedef pair<int,int> ii;
int n,rmq[200005][20],x[200005],l,q;
signed main()
{
queue<ii> que;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x[i];
}
cin>>l>>q;
for(int j=0;j<=18;j++)
{
for(int i=1;i<=n;i++)
{
rmq[i][j]=999999;
}
}
int cnt=0;... | a.cc:4:1: error: duplicate 'typedef'
4 | typedef pair<int,int> ii;
| ^~~~~~~
| -------
a.cc:4:23: error: invalid declarator before 'ii'
4 | typedef pair<int,int> ii;
| ^~
a.cc: In function 'int main()':
a.cc:8:15: error: 'ii' was not declared in this scope
8 | ... |
s251256079 | p04017 | C++ | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.TreeMap;
public class Main {
static int MOD=1000000007;
static long p[][]=new long[405][405];
static long sum[][]=new long[405][405];
static long dp[][]=new long[35][100005];
static long a[]=new l... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
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.InputStreamReader;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available wit... |
s499070196 | p04017 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
typedef long long ll;
... | a.cc: In function 'int main()':
a.cc:44:5: error: 'memset' was not declared in this scope
44 | memset(cld, -1, sizeof(cld));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <queue>
+++ |+#include <cstring>
... |
s535090386 | p04017 | C++ | #include <bits/stdc++.h>
#define sp ' '
#define nyan "(=^・ω・^=)"
#define mkp make_pair
#define intmax 2147483647
#define llmax 9223372036854775807
#define lP pair<ll,ll>
#define iP pair<int,int>
typedef long long ll;
using namespace std;
const int mod = 1000000007;
const int mod998 = 998244353;
int N, L, Q, x[100000]... | a.cc: In function 'int fr(int)':
a.cc:43:22: error: expected primary-expression before '<' token
43 | if (r[a][x] =< b) {
| ^
|
s687418966 | p04017 | C++ | #include<cstdio>
#include<algorithm>
#include"lib/graph.hpp"
int x[1001]={};
int main(){
int n,l,q;
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d",&x[i]);
scanf("%d%d",&l,&q);
if(n>1000||q>1000){
printf("0\n");
return 0;
}
Graph g(n+1);
for(int i=1;i<=n;i++){
for... | a.cc:3:9: fatal error: lib/graph.hpp: No such file or directory
3 | #include"lib/graph.hpp"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s861514800 | p04017 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
t... | a.cc: In function 'int main()':
a.cc:60:35: 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:... |
s829533656 | p04017 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
t... | a.cc: In function 'int main()':
a.cc:45:33: error: expected ',' or ';' before ')' token
45 | int num=(po-ori.begin())-1);
| ^
|
s366285254 | p04017 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
t... | a.cc: In function 'int main()':
a.cc:45:18: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type, long long int)'
45 | int num=max((po-ori.begin())-1,0LL);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ... |
s111194810 | p04017 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
t... | a.cc: In function 'int main()':
a.cc:45:18: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type, int)'
45 | int num=max((po-ori.begin())-1,0);
| ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c... |
s715706618 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 100000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).... | a.cc: In function 'int solve(int, int)':
a.cc:29:20: error: reference to 'next' is ambiguous
29 | if(next[i][a]<=b){
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/inc... |
s439254609 | p04017 | C++ | #include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <string>
#include <cstring>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <funct... | a.cc:71:9: warning: "REP" redefined
71 | #define REP(i,s,n) for(int i=s;i<n;++i)
| ^~~
a.cc:23:9: note: this is the location of the previous definition
23 | #define REP(i, a, b) for (int (i)=(a);(i)>=(b);(i)--)
| ^~~
a.cc:72:9: warning: "rep" redefined
72 | #define rep(i,n) REP(i,0,... |
s694731465 | p04017 | C++ | # include <cstdio>
# include <iostream>
# include <algorithm>
# define Maxn 100005
using namespace std;
inline int read()
{
int ok=1,k=0;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
ok=-1;
c=getchar();
}
while(c>='0'&&c<='9')
{
k=k*10+c-'0';
c=getchar();
}
return ok*k;
}
struct node{
int x;
... | a.cc: In function 'int main()':
a.cc:57:17: error: reference to 'next' is ambiguous
57 | next[i]=sd[r].xh;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bi... |
s696438571 | p04017 | C++ | # include "stdio.h"
# include "iostream"
# include "algorithm"
# define Maxn 100005
using namespace std;
inline int read()
{
int ok=1,k=0;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
ok=-1;
c=getchar();
}
while(c>='0'&&c<='9')
{
k=k*10+c-'0';
c=getchar();
}
return ok*k;
}
struct node{
int x;
... | a.cc: In function 'int main()':
a.cc:57:17: error: reference to 'next' is ambiguous
57 | next[i]=sd[r].xh;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bi... |
s725913841 | p04017 | C | # include "cstdio"
# include "iostream"
# include "algorithm"
# define Maxn 100005
using namespace std;
inline int read()
{
int ok=1,k=0;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
ok=-1;
c=getchar();
}
while(c>='0'&&c<='9')
{
k=k*10+c-'0';
c=getchar();
}
return ok*k;
}
struct node{
int x;
... | main.c:1:11: fatal error: cstdio: No such file or directory
1 | # include "cstdio"
| ^~~~~~~~
compilation terminated.
|
s415650606 | p04017 | C | # include "cstdio"
# include "iostream"
# include "algorithm"
# define Maxn 100005
using namespace std;
inline int read()
{
int ok=1,k=0;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
ok=-1;
c=getchar();
}
while(c>='0'&&c<='9')
{
k=k*10+c-'0';
c=getchar();
}
return ok*k;
}
struct node{
int x;
... | main.c:1:11: fatal error: cstdio: No such file or directory
1 | # include "cstdio"
| ^~~~~~~~
compilation terminated.
|
s539176619 | p04017 | C++ | # include "cstdio"
# include "iostream"
# include "algorithm"
# define Maxn 100005
using namespace std;
inline int read()
{
int ok=1,k=0;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
ok=-1;
c=getchar();
}
while(c>='0'&&c<='9')
{
k=k*10+c-'0';
c=getchar();
}
return ok*k;
}
struct node{
int x;
... | a.cc: In function 'int main()':
a.cc:57:17: error: reference to 'next' is ambiguous
57 | next[i]=sd[r].xh;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bi... |
s203766638 | p04017 | C++ | # include "cstdio"
# include "iostream"
# include "algorithm"
# define Maxn 100005
using namespace std;
inline int read()
{
int ok=1,k=0;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
ok=-1;
c=getchar();
}
while(c>='0'&&c<='9')
{
k=k*10+c-'0';
c=getchar();
}
return ok*k;
}
struct node{
int x;
... | a.cc: In function 'int main()':
a.cc:57:17: error: reference to 'next' is ambiguous
57 | next[i]=sd[r].xh;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bi... |
s051285370 | p04017 | C++ | # include "cstdio"
# include "iostream"
# include "algorithm"
# define Maxn 100005
using namespace std;
#define BF_N 1<<17
char buf[BF_N]; int sl,sr;
char gc(){
return sl==sr&&(sr=(sl=0)+fread(buf,1,BF_N,stdin),sl==sr)?EOF:buf[sl++];
}
int read(){
int ans=0,k=1; char c=gc();
while(!isdigit(c)){if(c=='-')k=-1; c=gc()... | a.cc: In function 'int main()':
a.cc:52:17: error: reference to 'next' is ambiguous
52 | next[i]=sd[r].xh;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bi... |
s408110557 | p04017 | C++ | #include<bits/stdc++.h>
#define N 100005
using namespace std;
inline int read(){
int ans=0;
char ch=getchar();
while(!isdigit(ch))ch=getchar();
while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch^48),ch=getchar();
return ans;
}
int l,n,x[N],Q,tim[N],next[N],hd,tl,q[N],blo[N],sig;
int main(){
n=read(),sig=sqrt(n);
for(in... | a.cc: In function 'int main()':
a.cc:16:34: error: reference to 'next' is ambiguous
16 | hd=tl=1,q[tl]=n,tim[n]=0,next[n]=n+1;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
... |
s269234901 | p04017 | C++ | #include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef long long ll;
#define MAX 100010
ll N,Q,L;
ll x[MAX],a,b;
int nex[MAX][70];
void compute() {
rep(i,N) {
nex[i][0] = ( upper_bound(x,x+N,x[i]+L) - x ) - 1;
assert( nex[i][0] != 0 );
... | a.cc: In function 'int main()':
a.cc:41:13: error: expected '}' at end of input
41 | int main() {
| ~^
|
s588232514 | p04017 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
long long N, x[100000], L;
int next[100000], before[100000];
int Q;
int main(){
cin >> N;
for(int i = 0; i < N; i++){
cin >> x[i];
}
cin >> L;
// dist [l, r) <= L
int r = 0;
for(int l = 0; l < N; l++){... | a.cc: In function 'int main()':
a.cc:26:9: error: reference to 'next' is ambiguous
26 | next[l] = r - 1;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
... |
s768333140 | p04017 | C++ | #include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) ce... | a.cc: In function 'int main()':
a.cc:59:11: error: 'bitset' was not declared in this scope
59 | cerr << bitset<20>(524287) << endl;
| ^~~~~~
a.cc:14:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
13 | #include <functional>
+++ |+#... |
s004906610 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
int hotel[200005];
int jump[200005][20];
/* Phan chuan bi LCA */
void pre_process()
{
for(int i=1;i<=n;i++)
{
int p = upper_bound(hotel,hotel+n+2,hotel[i]+k) - hotel ;
jump[i][0] = p-1;
}
for(int j=1;j<20;j++)
{
for(int i=1;i<=... | a.cc: In function 'void pre_process()':
a.cc:10:20: error: 'n' was not declared in this scope
10 | for(int i=1;i<=n;i++)
| ^
a.cc:12:54: error: 'k' was not declared in this scope
12 | int p = upper_bound(hotel,hotel+n+2,hotel[i]+k) - hotel ;
| ... |
s329748701 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, x[100010], l, q, a, b, dp[100010][20];
int main() {
memset(dp, -1, sizeof(dp));
scanf("%d", &n);
for(int i = 0; i < n; i++) scanf("%d", &x[i]);
scanf("%d", &l);
for(int i = n-1; i >= 0; i--) {
int L = i, R = n;
while(L + 1 < R) {... | a.cc: In function 'int main()':
a.cc:18:23: error: expected ';' before '}' token
18 | dp[i][0] = L;a
| ^
| ;
19 | }
| ~
|
s321146403 | p04017 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, a[200001], sum[200001], maxi[200001], q, dis, c, b, itr = 1;
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
cin >> dis;
for(int i = 1; i < n; i++){
int l = i + 1, r = n;
while(l != r){
int mid = (l + r)... | a.cc: In function 'int main()':
a.cc:31:31: error: 'l' was not declared in this scope
31 | else if(abs(b - c) <= l * (sum[b] - sum[c])) cout << abs(sum[b] - sum[c]) << endl;
| ^
|
s927144890 | p04017 | C++ | #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
#define MAXN 100010
int x[MAXN],fa[MAXN][20],step[MAXN],end[MAXN];
vector<int>G[MAXN];
void dfs(int u,int p)
{
step[u]=step[p]+1;
for(int i=1,j=2;j<step[u];i++,j<<=1)
fa[u][i]=fa[fa[u][i-1]][i-1],end[u]=i;
for(int i=0;i<G[u].size();i++)
d... | a.cc: In function 'void dfs(int, int)':
a.cc:12:46: error: reference to 'end' is ambiguous
12 | fa[u][i]=fa[fa[u][i-1]][i-1],end[u]=i;
| ^~~
In file included from /usr/include/c++/14/vector:69,
from a.cc:2:
/usr/include/c++/14/bits/r... |
s968831515 | p04017 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=100005,BLK=320;
struct Query
{
int l,r,id;
bool operator < (const Query &t)const
{
if(l/BLK==t.l/BLK)
return r<t.r;
return l<t.l;
}
};
int N,L,Q;
int x[MAXN],left[MAXN],right[MAXN];
Query q[MAXN];
int ans[MAXN];
int ... | a.cc: In function 'int main()':
a.cc:31:28: error: no matching function for call to 'max(long int, int)'
31 | left[i]=max(lower_bound(x+1,x+N+1,x[i]-L)-x,1);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s641811676 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
using Pint = pair<int, int>;
int N, L, Q;
vector<int> x;
vector<Pint> q;
int main()
{
cin >> N;
x.resize(N);
for (auto &val : x) cin >> val;
x.push_back(x[N-1]+1);
cin >> L >> Q;
q.resize(Q);
for (int i=0; i<Q; i++)
{
int t1, t2;
... | a.cc: In function 'int main()':
a.cc:37:25: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<int*, std::vector<int> >, void>::difference_type, int&)'
37 | next[1][i] = min(distance(x.begin(), lower_bound(x.begin(), x.end(), x[i]+L+1)) - 1, N);
| ... |
s465944454 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
using Pint = pair<int, int>;
int N, L, Q;
vector<int> x;
vector<Pint> q;
int main()
{
cin >> N;
x.resize(N);
for (auto &val : x) cin >> val;
x.push_back(x[N-1]+1);
cin >> L >> Q;
q.resize(Q);
for (int i=0; i<Q; i++)
{
int t1, t2;
... | a.cc: In function 'int main()':
a.cc:37:25: error: no matching function for call to 'min(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, int)'
37 | next[1][i] = min(lower_bound(x.begin(), x.end(), x[i]+L+1) - x.begin() - 1, N-1);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~... |
s735495040 | p04017 | C++ | #include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef long long int ll;
ll n, x[110000], l, numq, a, b, nexth[110000], table[30][110000];
void build_sparse()
{
for (int i = 0; i < 20; i++)
{
if ((1 << i) >= n)
break;
for (int j = 0; j < n; j++)
{
if (i == 0)
{
table[i][j... | a.cc: In function 'int main()':
a.cc:81:9: error: 'memset' was not declared in this scope
81 | memset(table, -1, sizeof(table));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
+++ |+#include ... |
s964493443 | p04017 | C++ | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
int n, l, q;
int[] xs, as, bs;
public static void main(String args[]) {
new Main().run();
}
void run() {
FastReader sc = new FastReade... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
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.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fm... |
s274732670 | p04017 | C++ | #pragma GCC optimize("O3")
#include <iostream>
#include <cstdio>
#include <cstring>
#include <list>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#define in(x) scanf("%d",&x)
#define ein(x) ~scanf("%d",&x)
#define inl(x) scan... | a.cc: In member function 'bool iofstream::out_double(T, int)':
a.cc:205:5: warning: no return statement in function returning non-void [-Wreturn-type]
205 | }
| ^
a.cc: In member function 'bool iofstream::out_doubleln(T, int)':
a.cc:245:5: warning: no return statement in function returning non-void [-Wr... |
s702771168 | p04017 | C++ | #pragma GCC optimize("O3")
#include <iostream>
#include <cstdio>
#include <cstring>
#include <list>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#define in(x) scanf("%d",&x)
#define ein(x) ~scanf("%d",&x)
#define inl(x) scan... | a.cc: In member function 'bool iofstream::out_double(T, int)':
a.cc:205:5: warning: no return statement in function returning non-void [-Wreturn-type]
205 | }
| ^
a.cc: In member function 'bool iofstream::out_doubleln(T, int)':
a.cc:245:5: warning: no return statement in function returning non-void [-Wr... |
s388740005 | p04017 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<stdlib.h>
#include<stack>
#include<vector>
using namespace std;
const int N=1e5+50;
const int INF=0x3f3f3f;
long long num[N];
int main()
{
long long n;
long long l;
int q,a,b,ber;
scanf("%lld",&n);
for(long long i=1;i... | a.cc: In function 'int main()':
a.cc:25:26: error: 'b' was not declared in this scope
25 | scanf("%d%d",&a,&b);
| ^
a.cc:29:9: error: 'ber' was not declared in this scope; did you mean 'bzero'?
29 | ber=1;
| ^~~
| bzero
|
s784915458 | p04017 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<stdlib.h>
#include<stack>
#include<vector>
using namespace std;
const int N=1e5+50;
const int INF=0x3f3f3f;
long long num[N];
int main()
{
long long n;
long long l;
int q,a,b;
scanf("%lld",&n);
for(long long i=1;i<=n;... | a.cc: In function 'int main()':
a.cc:29:15: error: 'ber' was not declared in this scope
29 | while(ber<endd)
| ^~~
|
s627059637 | p04017 | C++ | import strutils
import sequtils
import algorithm
import math
import queues
import tables
import logging
import future
const INF* = int(1e18 + 373)
when not defined(release):
addHandler(newFileLogger(stderr, lvlAll, "[ $levelname ] "))
proc readInt1*(): int = stdin.readLine().strip().parseInt()
proc readInt2*(): (i... | a.cc:26:12: error: too many decimal points in number
26 | for i in 0..<n:
| ^~~
a.cc:32:2: error: invalid preprocessing directive #--
32 | #------------------------------------------------------------------------------#
| ^~
a.cc:33:2: error: invalid preprocessing directive #--
33 | #... |
s112855568 | p04017 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
//#defi... | a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:19:1: note: in expansion of macro 'll'
19 | ll t[111111];
| ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ... |
s013251800 | p04017 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
//#defi... | a.cc: In function 'int main()':
a.cc:43:17: error: reference to 'next' is ambiguous
43 | next[0][i]=che(i);
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/b... |
s492800796 | p04017 | C++ | #include <iostream>
#include <utility>
#include <algorithm>
#define inf 1000000007
using namespace std;
int N, L, Q;
int x[100005];
int next[17][100005];
int main(void)
{
cin >> N;
for(int i = 0; i < N; i++) cin >> x[i];
x[N] = x[N-1]+1;
cin >> L;
int p;
for(int i = 0; i <= N; i++){
next[0][i] = upper_boun... | a.cc: In function 'int main()':
a.cc:21:17: error: reference to 'next' is ambiguous
21 | next[0][i] = upper_bound(x, x+N+1, x[i] + L) - x - 1;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s012639840 | p04017 | C++ | import math
import itertools
import heapq
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque
# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")
##### stdin ####
def LM(t, r): return list(map(t, r)... | a.cc:9:3: error: invalid preprocessing directive #d
9 | # d = defaultdict(lambda: 0)
| ^
a.cc:10:3: error: invalid preprocessing directive #setrecursionlimit
10 | # setrecursionlimit(10**7)
| ^~~~~~~~~~~~~~~~~
a.cc:11:3: error: invalid preprocessing directive #inf; did you mean #if?
11 | # inf... |
s337841708 | p04017 | C++ | #include <cstdio>
#include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
int x[N];
for(int i = 0; i < N; ++i) cin >> x[i];
int L;
cin >> L;
//Doubling
int table[N][30];
for(int i = 0; i < N; ++i){
fill(table[i],table[i]+30,0);
table[i][0] = upper_bound(x,x+N,x[i]+L) - x - 1;
}... | a.cc: In function 'int main()':
a.cc:15:19: error: 'upper_bound' was not declared in this scope
15 | table[i][0] = upper_bound(x,x+N,x[i]+L) - x - 1;
| ^~~~~~~~~~~
|
s885651198 | p04017 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int n,q,l,a[111111],x,y,pos,prev,cnt;
int main()
{
scanf("%d",&n);
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
scanf("%d%d",&l,&q);
while(q--)
{
scanf("%d%d",&x,&y);
if (x>y) swap(x,y);
pos=x;cnt=0;
while(pos<y)
{
prev=pos;
while(pos<=y && a[po... | a.cc: In function 'int main()':
a.cc:17:25: error: reference to 'prev' is ambiguous
17 | prev=pos;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c... |
s733908202 | p04017 | C++ | #include<iostream>
#include<fstream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<set>
#define P 1000000007
using namespace std;
int fastpow(int e, int x) {
if(x == 0) {
return 1;
}
if(x % 2 == 0) {
return fastpow(e... | a.cc: In function 'int main()':
a.cc:55:7: error: 'comtinue' was not declared in this scope
55 | comtinue;
| ^~~~~~~~
|
s089311861 | p04017 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef long long lli;
lli n;
vector<lli> x;
lli l;
lli q;
vector<lli> a;
vector<lli> b;
lli k;
vector<vector<lli> > r;
void query(lli a,lli b){
lli ans = 0;
if(a > b) swap(a,b);
while(a < b){
lli t = upper_bound(r[a].begin(... | a.cc: In function 'void query(lli, lli)':
a.cc:18:17: error: 'upper_bound' was not declared in this scope
18 | lli t = upper_bound(r[a].begin(),r[a].end(),b) - r[a].begin() - 1;
| ^~~~~~~~~~~
a.cc: In function 'int main(int, const char**)':
a.cc:33:19: error: 'upper_bound' was not decla... |
s116904890 | p04017 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<cfloat>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<cstring>
#include<queue>
#include<map>
#include<functional>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)n;++i)
const int mod = 1e9+7;
const ... | a.cc: In function 'int main()':
a.cc:59:12: error: conflicting declaration 'int a'
59 | int Q, a, b;
| ^
a.cc:58:12: note: previous declaration as 'ull a'
58 | ull L, a, b;
| ^
a.cc:59:15: error: conflicting declaration 'int b'
59 | int Q, a, b;
| ... |
s947859524 | p04017 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap ;
/**
* http://arc060.contest.atcoder.jp/tasks/arc060_c
*
* @author Cummin
*/
public class ARC060_E {
static int N ; // 2 <= N <= 10^5
static long L ; ... | Main.java:12: error: class ARC060_E is public, should be declared in a file named ARC060_E.java
public class ARC060_E {
^
1 error
|
s289145388 | p04017 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* http://arc060.contest.atcoder.jp/tasks/arc060_c
*
* @author Cummin
*/
public class Main {
static int N ; // 2 <= N ... | Main.java:130: error: cannot find symbol
Logger.getLogger(ARC060_E.class.getName()).log(Level.SEVERE, null, ex);
^
symbol: class ARC060_E
location: class Main
1 error
|
s007315713 | p04017 | C++ | // Author: Mohib Manva
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int rig[30][111111];
int n, q, l, u, v;
int x[111111];
int main(void)
{
scanf("%d",&n);
int i, j;
for(i=0 ; i<n ; i++)
{
scanf("%d",&x[i]);
}
scanf("%d %d",&l,&q);
for(i=0 ; i<n ; i++)
{
int lo = i+1,high = n-1;... | a.cc: In function 'int main()':
a.cc:24:28: error: 'a' was not declared in this scope
24 | if(a[mi]-a[i]<=l)
| ^
a.cc:29:17: error: 'dp' was not declared in this scope; did you mean 'dup'?
29 | dp[0][i]=last;
| ^~
... |
s693462824 | p04017 | C++ | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int nxt[20][100010];
int inp[100010];
int main(){
ios::sync_with_stdio(0);
int n;
... | a.cc: In function 'int main()':
a.cc:68:12: error: 'j' was not declared in this scope
68 | if(j==-1) ans++;
| ^
|
s491379178 | p04017 | C++ | hoge | a.cc:1:1: error: 'hoge' does not name a type
1 | hoge
| ^~~~
|
s497469318 | p04017 | C++ | #include <iostream>
using namespace std;
#define MAX_N 100000
int tab[40][MAX_N];
// mid日でaからbまで行けるか
bool C(int a, int b, int mid){
int pos = a;
int cnt = 0;
while(mid != 0){
if(mid & 1){
pos = tab[cnt][pos];
}
mid >>= 1;
cnt++;
}
if(pos >= b) return true;
else return false;
}
int solve(int a, int... | a.cc: In function 'int main()':
a.cc:52:30: error: 'upper_bound' was not declared in this scope
52 | tab[0][i] = upper_bound(x, x+N, x[i]+L) - x - 1;
| ^~~~~~~~~~~
|
s058973345 | p04017 | C++ | 5
1 2 3 4 5
100000
10 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5
| ^
|
s512693740 | p04017 | C++ | #include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
const int maxn = 1e5 + 10;
int s[maxn], n, L, Q;
int cnt[maxn], c[maxn];
int main(){
s[0]=0;
while(~scanf("%d", &n)){
for(int i=1; i<=n; i++) scanf("%d", &s[i]);
scanf("%d", &L);
... | a.cc: In function 'int main()':
a.cc:55:18: error: expected '}' at end of input
55 | return 0;
| ^
a.cc:12:11: note: to match this '{'
12 | int main(){
| ^
|
s127139469 | p04017 | C++ | #include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef pair<int,int> P;
typedef long long int lnt;
const lnt INF 0xffffffffffffff;
lnt n,x[100000],l,q,a[100000],b[100000... | a.cc:14:15: error: expected initializer before numeric constant
14 | const lnt INF 0xffffffffffffff;
| ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:31:53: error: 'INF' was not declared in this scope
31 | for(lnt j=0;j<100000;j++) lca[i][j]=INF;
| ... |
s103330445 | p04017 | Java | #define _CRT_SECURE_NO_WARNINGS
#include<sstream>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<t... | Main.java:1: error: illegal character: '#'
#define _CRT_SECURE_NO_WARNINGS
^
Main.java:2: error: illegal character: '#'
#include<sstream>
^
Main.java:3: error: illegal character: '#'
#include<iostream>
^
Main.java:4: error: illegal character: '#'
#include<cstdio>
^
Main.java:5: error: illegal character: '#'
#include<cs... |
s039813013 | p04017 | Java |
import java.io.*;
import java.math.*;
import java.util.*;
import static java.util.Arrays.*;
public class D {
private static final int mod = (int)1e9+7;
final Random random = new Random(0);
final IOFast io = new IOFast();
/// MAIN CODE
public void run() throws IOException {
// int TEST_CASE = Integer.parseInt... | Main.java:8: error: class D is public, should be declared in a file named D.java
public class D {
^
1 error
|
s461236966 | p04017 | Java |
import java.io.*;
import java.math.*;
import java.util.*;
import static java.util.Arrays.*;
public class E {
private static final int mod = (int)1e9+7;
final Random random = new Random(0);
final IOFast io = new IOFast();
/// MAIN CODE
public void run() throws IOException {
// int TEST_CASE = Integer.parseInt... | Main.java:8: error: class E is public, should be declared in a file named E.java
public class E {
^
1 error
|
s513844543 | p04017 | C++ |
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;
using ll = long long;
ll n;
ll x[123456];//n
ll l;
ll q;
ll a[123456], b[123456];//q
ll lbar[123456];//n
ll rbar[123456];//n
vector<ll> lgraph[123456];
ll dist[123456];
int bfs(int v1, int v2)
{
que... | a.cc: In function 'int main()':
a.cc:57:30: error: no matching function for call to 'max(long int, int&)'
57 | rbar[i] = max(upper_bound(x + i, x + n, x[i] + l) - x - 1, i);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14... |
s720516762 | p04017 | C++ |
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
using ll = long long;
ll n;
ll x[123456];//n
ll l;
ll q;
ll a[123456], b[123456];//q
ll lbar[123456];//n
ll rbar[123456];//n
vector<ll> lgraph[123456];
ll dist[123456];
int bfs(int v1, int v2)
{
queue<ll> que;
memset(... | a.cc: In function 'int bfs(int, int)':
a.cc:25:9: error: 'memset' was not declared in this scope
25 | memset(dist, 0xFF, sizeof(ll) * n);
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <queue>
+++ |+... |
s342134016 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin()... | a.cc: In function 'int main()':
a.cc:34:15: error: conflicting declaration 'long long int q'
34 | long long a,q,ans,w,s,t;
| ^
a.cc:29:11: note: previous declaration as 'int q'
29 | int n,l,q;
| ^
|
s629086056 | p04017 | C++ |
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
using ll = long long;
ll n;
ll x[123456];//n
ll l;
ll q;
ll a[123456], b[123456];//q
ll lbar[123456];//n
ll rbar[123456];//n
vector<ll> lgraph[123456];
ll dist[123456];
int bfs(int v1, int v2)
{
queue<ll> que;
memset(... | a.cc: In function 'int bfs(int, int)':
a.cc:25:9: error: 'memset' was not declared in this scope
25 | memset(dist, 0xFF, sizeof(ll) * n);
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <queue>
+++ |+... |
s552754371 | p04017 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin()... | a.cc: In function 'int main()':
a.cc:34:15: error: conflicting declaration 'long long int q'
34 | long long a,q,ans,w-0,s,t;
| ^
a.cc:29:11: note: previous declaration as 'int q'
29 | int n,l,q;
| ^
a.cc:34:22: error: expected initializer before '-' token
34 | long lon... |
s340865250 | p04017 | C++ | int main()
{
long long N, Q, L;
vector<long long> loc(1);
cin >> N;
long long t;
for (long long i = 0; i < N; ++i){
cin >> t;
loc.push_back(t);
}
cin >> L >> Q;
vector<vector<pair<long long, long long>>> days(N + 1, vector<pair<long long, long long>>(N + 1, { 0, 0 }));
for (long long i = 1; i < N; ++i){
... | a.cc: In function 'int main()':
a.cc:4:9: error: 'vector' was not declared in this scope
4 | vector<long long> loc(1);
| ^~~~~~
a.cc:4:16: error: expected primary-expression before 'long'
4 | vector<long long> loc(1);
| ^~~~
a.cc:5:9: error: 'cin' was not decla... |
s123590000 | p04017 | C++ | #include <iostream>
#include <vector>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int N, Q, L;
vector<int> loc(1);
cin >> N;
int t;
for (int i = 0; i < N; ++i){
cin >> t;
loc.push_back(t);
}
cin >> L >> Q;
vector<vector<pair<int, int>>> days(N + 1, vector<pair<int, int>>(N + 1, { 0, 0 }));
... | a.cc:5:22: error: '_TCHAR' has not been declared
5 | int _tmain(int argc, _TCHAR* argv[])
| ^~~~~~
|
s103877790 | p04017 | C++ | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
int main() {
int n, q, a, b;
long long l;
long long x[100000];
std::vector<std::vector<int>> next(100000, std::vector<int>(20));
std::cin >> n;
for (int ni = 0; ni < n; ++ni) {
std::cin >>... | a.cc:65:5: error: redefinition of 'int main()'
65 | int main() {
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8 | int main() {
| ^~~~
a.cc:122:5: error: redefinition of 'int main()'
122 | int main() {
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8... |
s524321037 | p04018 | C++ | #include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <chrono>
#include <vector>
#include <map>
#include <random>
#include <set>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <stdio.h>
#include <queue>
#include <bitset>
#include <cstdlib>... | a.cc:115:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
115 | main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:134:20: error: no matching function for call to 'merge(int&, int)'
134 | ans = merge(n, 1);
| ~~~~~^~~~~~
In file included from /usr/in... |
s099032868 | p04018 | C++ | 場合分けはできた
文字列アルゴリズムに思考が行かなかったのはまずい
それはそうと思いついたかはわからない | a.cc:1:1: error: '\U00005834\U00005408\U00005206\U00003051\U0000306f\U00003067\U0000304d\U0000305f' does not name a type
1 | 場合分けはできた
| ^~~~~~~~~~~~~~~~
|
s224421592 | p04018 | C++ | #include<iostream>
#define maxn 500005
using namespace std;
bool same(string s) {
char base = s[0];
for (char c : s)
if (c != base)
return false;
return true;
}
int f[2][maxn];
bool good[2][maxn];
void kmp(string s, int* f, bool* good) {
f[0] = -1;
for (int i = 1, j = -1; i < (int)s.size(); i++) {
while (j ... | a.cc: In function 'int main()':
a.cc:36:25: error: 'reverse' was not declared in this scope
36 | reverse(s.begin(), s.end());
| ^~~~~~~
|
s878098321 | p04018 | C++ | #include <bits/stdc++.h>
using namespace std;
constexpr int mod = 1000000007;
bool isprime(int n) {
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) return (false);
}
return (true);
}
int main()
{
string W;
cin >> W;
int n = W.size();
vector ... | a.cc: In function 'int main()':
a.cc:34:25: error: 'flag' was not declared in this scope
34 | flag = true;
| ^~~~
|
s842131727 | p04018 | C++ | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair < int, int >
#define F first
#define S second
#define int long long int
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loop... | a.cc:8:24: error: '::main' must return 'int'
8 | #define int long long int
| ^~~
a.cc:25:1: note: in expansion of macro 'int'
25 | int main () {
| ^~~
|
s477541802 | p04018 | C++ | #include <iostream>
#include <vector>
#define llint unsigned long long
#define H 1000000007
using namespace std;
string s;
llint hash[500005];
llint bekiH[500005];
vector<int> vec[500005];
llint get(llint l, llint r)
{
return hash[r] - hash[l-1]*bekiH[r-l+1];
}
bool check2(int l, int r, int p)
{
return get(l, r-p... | a.cc: In function 'long long unsigned int get(long long unsigned int, long long unsigned int)':
a.cc:15:16: error: reference to 'hash' is ambiguous
15 | return hash[r] - hash[l-1]*bekiH[r-l+1];
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/in... |
s553604761 | p04018 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
// Sparse Table
template<class MeetSemiLattice> struct SparseTable {
const MeetSemiLattice INF = 1<<30;
vector<vector<MeetSemiLattice> > dat;
vector<int> height;
SparseTable() { }
SparseTable(cons... | a.cc: In function 'int main()':
a.cc:133:21: error: 'lcp' was not declared in this scope
133 | if (lcp[d] >= dd - d) cannot_cut[dd] = true;
| ^~~
a.cc:134:21: error: 'lcp2' was not declared in this scope
134 | if (lcp2[d] >= dd - d) cannot_cut[n-dd] = true;
... |
s690770834 | p04018 | C++ | #include <iostream>
#include <vector>
#include <string>
using namespace std;
struct RollingHash {
using ull = unsigned long long;
string S_;
vector<ull> hash, power;
RollingHash(){}
RollingHash(const string &S, const ull base = 1000000007LL) : S_(S) {
int n = (int)S.size();
hash.ass... | a.cc: In function 'std::vector<long long int> divisor(long long int)':
a.cc:58:5: error: 'sort' was not declared in this scope; did you mean 'short'?
58 | sort(res.begin(), res.end());
| ^~~~
| short
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.