submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s147181063 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#defi... | a.cc: In function 'int main()':
a.cc:23:33: error: no matching function for call to 'max(ll, int)'
23 | ll ans = (b / x) - ((max(a - 1, 0)) / x);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/... |
s273819028 | p03861 | C++ | package main
import (
"fmt"
)
func main() {
var a, b, x int64
fmt.Scan(&a, &b, &x)
if a%x == 0 && b%x == 0 {
fmt.Println((b-a)/x + int64(1))
} else {
fmt.Println((b - a) / x)
}
}
| a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
|
s947304135 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x, ans = 0;
cin >> a >> b >> x;
if (x == 1) ans = b - a + 1;
else {
long long double q = ceil(((double)a - 1) / x);
if (a != x * q + 1) {
ans++;
a = x * q + 1;
}
ans += (b - a + 1) / x;
}
cout << ans << en... | a.cc: In function 'int main()':
a.cc:8:10: error: 'long long' specified with 'double'
8 | long long double q = ceil(((double)a - 1) / x);
| ^~~~
|
s293803307 | p03861 | C++ | #include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
int main() {
ll a, b, x;
cin >> a >> b >> x;
cout << b / x - max(a-1, 0) / x << endl;
}
| a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'max(ll, int)'
10 | cout << b / x - max(a-1, 0) / x << endl;
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s643971427 | p03861 | C++ | #include <iostream>
using namespace std;
using ll = long long;
int main() {
ll a, b, x;
cin >> a >> b >> x;
cout << b / x - max(a-1, 0) / x << endl;
}
| a.cc: In function 'int main()':
a.cc:9:24: error: no matching function for call to 'max(ll, int)'
9 | cout << b / x - max(a-1, 0) / x << endl;
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s627020773 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll a,b,x;
cin>>a>>b>>x;
if(!n) cout<<b/x+1<<endl;
else cout<<b/x-(a-1)/x<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: 'n' was not declared in this scope
8 | if(!n) cout<<b/x+1<<endl;
| ^
|
s086106113 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int a,b,c,ans
cin >> a >> b >> c;
if(a != 0){
a--;
ans=(b/c)-(a/c);
} else{
ans=(b/c)-(a/c);
ans++;
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'cin'
5 | cin >> a >> b >> c;
| ^~~
a.cc:8:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | ans=(b/c)-(a/c);
| ^~~
| abs
a.cc:10:5: error: 'ans' was not declared in this scope; d... |
s498699959 | p03861 | C++ | #include<iostream>
#include <string>
using namespace std;
int main()
{
// string buf;
__int64 i1, i2, i3;
int ret;
// cin >> buf;
cin >> i1 >> i2 >> i3;
ret = 0;
for (__int64 i = i1; i <= i2; i++)
{
if (i % i3 == 0) ret++;
}
cout << ret;
system("pause");
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
8 | __int64 i1, i2, i3;
| ^~~~~~~
| __int64_t
a.cc:13:16: error: 'i1' was not declared in this scope
13 | cin >> i1 >> i2 >> i3;
| ... |
s234884578 | p03861 | C++ | #include <iostream>
int main() {
using namespace std;
unsigned long long a, b, x;
unsigned long long count = 0;
cin >> a >> b >> x;
for (int i = a; i <= b; i++) {
if (i%x == 0) {
count++;
}
}
cout << count;
| a.cc: In function 'int main()':
a.cc:16:23: error: expected '}' at end of input
16 | cout << count;
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s703533711 | p03861 | C | ソースコード
#include <stdio.h>
int main(void)
{
unsigned long long a, b, x;
unsigned long long res = 0;
scanf("%llu %llu %llu", &a, &b, &x);
res = (b - a) / x;
if( (a % x) == 0 ) res++;
printf("%llu", res);
} | main.c:1:13: error: expected ';' before 'typedef'
1 | ソースコード
| ^
| ;
|
s485909162 | p03861 | C | #include <stdio.h>
int main(void)
{
unsigned long long a, b, x;
unsigned long long ans = 0;
scanf("%llu %llu %llu", &a, &b, &x);
res = (b - a) / x;
if( (a % x) == 0 ) res++;
printf("%llu", res);
} | main.c: In function 'main':
main.c:10:9: error: 'res' undeclared (first use in this function)
10 | res = (b - a) / x;
| ^~~
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
|
s600649313 | p03861 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#define rep(i,n) for (int i=0;i<(n);i++;)
using namespace std;
#define int long long int
int ans(int);
int a, b, x;
unsigned main(){
cin >> a >> b >> x;
cout << ans(b) - ans(a - 1) << endl;
}
int ans(int n... | cc1plus: error: '::main' must return 'int'
|
s487476214 | p03861 | C++ | #include <bits/stdc++.h>
//#include <iostream>
//#include <cstdio>
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
#define MOD 1000000007
#define INF 2000000000
typedef long long ll;
typedef unsigned long long ull;
//typedef Pair<int,int> P;
using namespace std;
int main(void){
ll a,... | a.cc: In function 'int main()':
a.cc:21:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
21 | return;
| ^~~~~~
|
s503876250 | p03861 | C++ | #include <stdio.h>
int main(){
long long int a,b,x;
scanf("%11d,%11d,%11d",&&a,&&b,&&x);
long long int A = [a/x];
long long int B = [b/x];
long long int ans = B-A;
printf("%11d",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:21: error: expected ',' before '/' token
5 | long long int A = [a/x];
| ^
| ,
a.cc:5:21: error: expected identifier before '/' token
a.cc: In lambda function:
a.cc:5:24: error: expected '{' before ';' token
5 | long long ... |
s357004885 | p03861 | C++ | a, b, x = map(int, input().split())
if x == 1:
print(b - a + 1)
elif a == 0:
print(b // x)
else:
print(b // x - (a - 1) // x)
| a.cc:1:1: error: 'a' does not name a type
1 | a, b, x = map(int, input().split())
| ^
|
s653022540 | p03861 | C++ | #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
using namespace std;
typedef pair<int, int> P;
int a, b, x;
int f(n){
if(n == -1) return 0;
return n... | a.cc:12:7: error: 'n' was not declared in this scope; did you mean 'yn'?
12 | int f(n){
| ^
| yn
a.cc: In function 'int main()':
a.cc:19:14: error: 'f' cannot be used as a function
19 | cout << f(b) - f(a - 1) << endl;
| ~^~~
a.cc:19:21: error: 'f' cannot be used as a... |
s694723739 | p03861 | C++ | #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<stdlib.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n)... | a.cc: In function 'int main()':
a.cc:25:9: error: no matching function for call to 'max(long long int, int)'
25 | ans-=max(a-1,0)/x;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/... |
s004984942 | p03861 | C++ | #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<stdlib.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n)... | a.cc: In function 'int main()':
a.cc:25:19: error: expected ')' before ';' token
25 | ans-=max((a-1,0)/x;
| ~ ^
| )
|
s825070759 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long a, b, x;
cin >> a >> b >> x;
cout << (b / x - max((a - 1), 0) / x) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:29: error: no matching function for call to 'max(long long int, int)'
8 | cout << (b / x - max((a - 1), 0) / x) << endl;
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-l... |
s820729880 | p03861 | C | #include <stdio.h>
int main()
{
unsigned long long a, b, x, ;
scanf("%llu%llu%llu", &a, &b, &x);
printf("%llu", (a%x==0?1:0)+b/x-a/x);
return(0);
} | main.c: In function 'main':
main.c:5:30: error: expected identifier or '(' before ';' token
5 | unsigned long long a, b, x, ;
| ^
|
s681227529 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In function 'void solve()':
a.cc:20:24: error: no matching function for call to 'max(int, ll)'
20 | cout<<(B/X)-max(0,A-1)/X<<endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,... |
s753292252 | p03861 | C | #include <stdio.h>
int main()
{
long double a, b, x;
scanf("%lf%lf%lf", &a, &b, &x);
printf("%lf", (a%x==0?1:0)+(double)((long long)(b-a)/x));
return(0);
} | main.c: In function 'main':
main.c:7:18: error: invalid operands to binary % (have 'long double' and 'long double')
7 | printf("%lf", (a%x==0?1:0)+(double)((long long)(b-a)/x));
| ^
|
s870720122 | p03861 | C++ | void test2(){
long long a,b,x;
while(cin>>a>>b>>x){
//cout<<a<<" "<<b<<" "<<x<<endl;
long long t1=a%x,t2=b%x;
long long k1=a/x,k2=b/x;
if(t1==0&&t2==0)cout<<(k2-k1+1)<<endl;
else cout<< k2-k1<<endl;
}
return;
}
int main()
{
//freopen("data","r",stdin);
tes... | a.cc: In function 'void test2()':
a.cc:3:11: error: 'cin' was not declared in this scope
3 | while(cin>>a>>b>>x){
| ^~~
a.cc:7:25: error: 'cout' was not declared in this scope
7 | if(t1==0&&t2==0)cout<<(k2-k1+1)<<endl;
| ^~~~
a.cc:7:42: error: 'endl' was... |
s213835800 | p03861 | C++ | #include<iostream>
#include <string>
using namespace std;
int main2(){
int a,b,x,i,N;
int flag =0;
cin >>a>>b>>x;
for(i = 0; i< N; i++){
if(((a + i)%x)==0 ){
flag++;
}
}
cout << flag;
return 0;
}
int main(){
int a,b,x,i;
int a_1,b_1;
int sum;
cin >>a>>b>>x;
b_1= b/x;
a_1=a/x;
sum=b_1-a_1
if((a%x)==0){
s... | a.cc: In function 'int main()':
a.cc:25:12: error: expected ';' before 'if'
25 | sum=b_1-a_1
| ^
| ;
26 | if((a%x)==0){
| ~~
|
s733668666 | p03861 | C | #include <stdio.h>
int main(void)
{
long long int a,b,x,y,z;
scanf("%lld %lld %lld",&a,&b,&x);
y=b/x;
if(a>1);
z=(a-1)/x;
else
z=0;
printf("%lld",y-z);
return 0;
} | main.c: In function 'main':
main.c:10:9: error: 'else' without a previous 'if'
10 | else
| ^~~~
|
s948802979 | p03861 | Java | import java.util.Scanner;
/**
* @Author oreid
* @Release 04/12/2016
*/
public class MainA2 {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
long a = scanner.nextLong();
long b = scanner.nextLong();
long x = scanner.nextLong();
long cnt... | Main.java:7: error: class MainA2 is public, should be declared in a file named MainA2.java
public class MainA2 {
^
1 error
|
s580512572 | p03861 | Java | import java.util.*;
public class AbetweenB{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String chaineNombre = scan.nextLine();
String[] numberString = chaineNombre.split(" ");
double a = Double.parseDouble(numberString[0]);
double b = Double.parseDouble(num... | Main.java:3: error: class AbetweenB is public, should be declared in a file named AbetweenB.java
public class AbetweenB{
^
1 error
|
s348375611 | p03861 | C | #include <stdio.h>
int main()
{
long long a, b, x, i, ans=0;
scanf("%lld%lld%lld", &a, &b, &x);
for(i=a; i<=b; i+=x) ans++:
printf("%lld", ans);
return(0);
} | main.c: In function 'main':
main.c:7:28: error: expected ';' before ':' token
7 | for(i=a; i<=b; i+=x) ans++:
| ^
| ;
|
s265219139 | p03861 | C | #include <stdio.h>
int main()
{
long long a, b, x, i, ans=0;
scanf("%lld%lld%lld", &a, &b, &x);
for(i=a, i<=b; i+=x) ans++:
printf("%lld", ans);
return(0);
} | main.c: In function 'main':
main.c:7:21: error: expected ';' before ')' token
7 | for(i=a, i<=b; i+=x) ans++:
| ^
| ;
main.c:7:28: error: expected ';' before ':' token
7 | for(i=a, i<=b; i+=x) ans++:
| ^
| ... |
s616966611 | p03861 | C++ | i = [int(x) for x in input().split()]
c =0
for x in range(i[0],i[1]+1):
if x%i[2] == 0:
c+=1
print(c) | a.cc:1:1: error: 'i' does not name a type
1 | i = [int(x) for x in input().split()]
| ^
|
s920840501 | p03862 | Java | import java.util.*;
public class bzbz {
public static void main(String[] args) {
Scanner no=new Scanner(System.in);
int n=no.nextInt();
int m=no.nextInt();
int arr[]=new int[n];
int sum=0;
for(int i=0;i<n;i++){
arr[i]=no.nextInt();
}
for(int i=0;i<n-1;i++){
if(arr[0]>m){
sum=s... | Main.java:2: error: class bzbz is public, should be declared in a file named bzbz.java
public class bzbz {
^
1 error
|
s647957406 | p03862 | C++ | #include<bits/stdc++.h>
#include <stdio.h>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
using namespace std;
#define newl "\n"
#define ll long long
#define ull unsigned long long
#define FORM(m) for (auto const& x : m) cout << x.first << " : " << x.second << newl
#define FORV(v) cout << '\n'; for... | a.cc: In function 'void solve()':
a.cc:10:12: error: expected primary-expression before 'long'
10 | #define ll long long
| ^~~~
a.cc:216:40: note: in expansion of macro 'll'
216 | v[i + 1] = max(ll(0), v[i + 1] - diff);
| ^~
|
s205705078 | p03862 | C++ | ¥#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(){
ll N,X;
cin>>N>>X;
vector<ll> a(N);
for(int i=0; i<N; i++) cin>>a[i];
ll ans = 0;
for(int i=1; i<N; i += 2){
ll sum = a[i] + a[i-1];
if(sum > X){
ans += sum-X;
... | a.cc:1:1: error: extended character ¥ is not valid in an identifier
1 | ¥#include <iostream>
| ^
a.cc:1:2: error: stray '#' in program
1 | ¥#include <iostream>
| ^
a.cc:1:1: error: '\U000000a5' does not name a type
1 | ¥#include <iostream>
| ^
In file included from /usr/include/c++/14/bit... |
s458327751 | p03862 | C++ | #include <bits/stdc++.h>
#define ll long long int
#define F(i,j,k,in) for(int i=j;i<k;i+=in)
#define DF(i,j,k,in) for(int i=j;i>=k;i-=in)
#define feach(it,l) for (auto it = l.begin(); it != l.end(); ++it)
#define fitr(it,it1,itr2) for(auto it=itr1;it!=itr2;++it)
#define fall(a) a.begin(),a.end()
#define pb push_back
#d... | a.cc: In function 'int main()':
a.cc:46:26: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
46 | cnt+=take; A[i]=max(0,A[i]-take);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/alg... |
s086887469 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main(){
int N, x;
cin >> N >> x;
vector<ll> a(N);
for(int i=0; i<N; i++) cin >> a[i];
ll count = 0;
for(int i=0; i<N-1; i++) {
if(a[i]+a[i+1] > x) {
ll div = a[i]+a[i+1] ... | a.cc: In function 'int main()':
a.cc:17:25: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
17 | a[i+1] = max(0, a[i+1]);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorith... |
s366557014 | p03862 | C++ | #include <iostream>
#include <string>
using namespace std;
int main()
{
long int n;
long long int x;
int ans=0;
cin>>n>>x;
long long int e[n];
for(int i=0;i<n;i++){
cin>>e[i];
}
for(int i=1;i<n;i++){
int sum=e[i]+e[i+1];
if(sum<=x)continue;
int steps=sum-x;
ans+=steps;
if(steps<=e[i]) e[i]-=ste... | a.cc: In function 'int main()':
a.cc:33:11: error: 'S' was not declared in this scope
33 | cout<<ans;S
| ^
|
s202985967 | p03862 | Java | import java.util.*; import java.io.*; import java.math.*;
public class Main{
//Don't have to see. start------------------------------------------
static class InputIterator{
ArrayList<String> inputLine = new ArrayList<String>(1024);
int index = 0; int max; String read;
InputIterator(){
BufferedReader br = ne... | Main.java:81: error: cannot find symbol
int minus = (mae + ato) - K;
^
symbol: variable K
location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s999859967 | p03862 | C++ |
#include<bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using hea... | a.cc: In function 'int main()':
a.cc:45:3: error: expected unqualified-id before 'for'
45 | for(int i = 0; i < n-1; ++i){
| ^~~
a.cc:45:18: error: 'i' was not declared in this scope
45 | for(int i = 0; i < n-1; ++i){
| ^
|
s259891081 | p03862 | C++ | #include <iostream>
using namespace std;
int main() {
int N, x;
int arr[N];
for (int i = 0; i < N; i ++){
cin >> arr[i];
}
int spet = 0;
for (int i = 0; i < N - 1; i ++){
arr[i] + arr[i + 1] = x;
spet += arr[i] + arr[i + 1] - x;
}
cout << spet << '\n';
} | a.cc: In function 'int main()':
a.cc:12:24: error: lvalue required as left operand of assignment
12 | arr[i] + arr[i + 1] = x;
| ~~~~~~~^~~~~~~~~~~~
|
s684954053 | p03862 | C++ | #include <bits/stdc++.h>
#include <math.h>
#include <float.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
const ll INF = 1LL<<62;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
... | a.cc: In function 'int main()':
a.cc:35:25: error: no matching function for call to 'min(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
35 | a[i+1] = min(0,a[i+1]);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:... |
s925338452 | p03862 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long x = sc.nextLong();
long[] a = new long[n];
for(int i = 0; i < n; i++) {
a[i] = sc.nextLong();
}
long ans = 0;
for(int i = 1; i < n; i+... | Main.java:23: error: reached end of file while parsing
}
^
1 error
|
s783095807 | p03862 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
void solve() {
int n, x;
int ans;
cin >> n >> x;
vector <int> a(n);
for (int &ai: a)
cin >> ai;
ans = 0;
for (int i = 1; i < n; ++i) {
if (a[i] + a[i-1] > x) {
ans += a[i] + a[i-1] - x;
if... | a.cc: In function 'void solve()':
a.cc:10:5: error: 'vector' was not declared in this scope
10 | vector <int> a(n);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <algorithm>
+++ |+#include <vector>
3... |
s397359285 | p03862 | C++ | #define loop(i,n) for(int i = 0;i < int(n);i++)
#define sz(s) (int)(s.size())
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define fr first
#define sc second
#define NumofDigits(n) ((long long)log10(n)+1)
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,r... | a.cc:9:17: error: '__gnu_pbds' is not a namespace-name
9 | using namespace __gnu_pbds;
| ^~~~~~~~~~
a.cc:10:9: error: 'tree' does not name a type
10 | typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
| ^~~~
a.cc: In function 'vo... |
s708102886 | p03862 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
int x[a], y[a];
for (int i = 0; i < a; i++) {
cin >> x[i];
y[i] = x[i];
}
if (x[0] > b)
x[0] = b;
for (int i = 0; i < a - 1; i++) {
x[i + 1] -= x[i + 1] + x[i] - b;
if (x[i + 1] < 0) {
x[i] += x[i + 1]
... | a.cc: In function 'int main()':
a.cc:18:23: error: expected ';' before 'x'
18 | x[i] += x[i + 1]
| ^
| ;
19 | x[i + 1] = 0;
| ~
|
s262566669 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef long long int ll;
int main()
{
int n;
ll a, b, x, d, op = 0 ;
cin >> n >> x;
cin >> a >> b;
if( a + b > x )
{
d = a + b - x;
if( d <= b ){
b -= diff;
}
else
{
b = 0;
}
... | a.cc: In function 'int main()':
a.cc:15:22: error: 'diff' was not declared in this scope
15 | b -= diff;
| ^~~~
a.cc:31:30: error: 'diff' was not declared in this scope
31 | b -= diff;
| ^~~~
|
s026232841 | p03862 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
int main(){
ll n,x;
cin>>n>>x;
vector<ll> a(n);
rep(i,n) cin>>a[i]>>endl;
ll cnt=0;
rep(i,n-1){
if(a[i]+a[i+1]>x){
if(a[i]<=x){
... | a.cc: In function 'int main()':
a.cc:11:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
11 | rep(i,n) cin>>a[i]>>endl;
| ~~~~~~~~~^~~~~~
In file included from /usr/i... |
s700312734 | p03862 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
int main(){
ll n,x;
cin>>n>>x;
vector<ll> a(n);
rep(i,n) cin<<a[i]<<endl;
ll cnt=0;
rep(i,n-1){
if(a[i]+a[i+1]>x){
if(a[i]<=x){
... | a.cc: In function 'int main()':
a.cc:11:17: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
11 | rep(i,n) cin<<a[i]<<endl;
a.cc:11:17: note: candida... |
s163342405 | p03862 | C++ | #include<iostream>
#include<string>
#include<vector>
typedef long long ll;
using namespace std;
int main(){
ll N, x, c, ans; cin >> N >> x;
std:::vector<int> v(N);
for(int i=0; i<N; i++) cin >> v[i];
ans = 0;
for(int i=0; i<N-1; i++){
if(v[i] + v[i+1] > x){
c = v[i+1] + v[i] -... | a.cc: In function 'int main()':
a.cc:9:10: error: expected unqualified-id before ':' token
9 | std:::vector<int> v(N);
| ^
a.cc:10:36: error: 'v' was not declared in this scope
10 | for(int i=0; i<N; i++) cin >> v[i];
| ^
a.cc:13:12: error: 'v' was... |
s414977257 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long double PI = (acos(-1));
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
#define scll(x) scanf("%lld",&x)
int main(){
ll n, x, tmp, ans = 0; sc(n), sc(x);
vector<ll> a(n);
... | a.cc: In function 'int main()':
a.cc:16:19: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, int)'
16 | a[i] = max(a[i], 0);
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s118129427 | p03862 | C++ | #include <bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
int main() {
int64_t N, x;
cin >> N >> x;
vector<int64_t> v(N);
for (int64_t i = 0; i < N; i++) {
cin >> v.at(i);
}
int n = 0;
int sum = 0;
for (int64_t i = 1; i < N; i += 2) {
int64_t& a = v.at(i - 1),
& b = v.at(i),
& c = n;
... | a.cc: In function 'int main()':
a.cc:19:31: error: cannot bind non-const lvalue reference of type 'int64_t&' {aka 'long int&'} to a value of type 'int'
19 | & c = n;
| ^
|
s804354213 | p03862 | C++ | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define what_is(x) cerr << #x << " is " << x << endl;
#define MT make_tuple
#define eb emplace_back
#defin... | a.cc: In function 'int func(ll*, ll, ll)':
a.cc:33:28: error: no matching function for call to 'max(int, ll)'
33 | if(i==1) return max(0,a[0]+a[1]-x);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_... |
s164518882 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pb(s) push_back(s)
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(ALLA(arr, sz))
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz))
typedef long long l... | a.cc: In function 'int main()':
a.cc:40:27: error: 'diff' was not declared in this scope; did you mean 'dif'?
40 | vi[i-1]-=(diff-vi[i]);
| ^~~~
| dif
|
s493762463 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pb(s) push_back(s)
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(ALLA(arr, sz))
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz))
typedef long long l... | a.cc: In function 'int main()':
a.cc:35:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
35 | ans+=dif;
| ^~~
| abs
a.cc:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
38 | ans+=vi[i];
| ... |
s064799789 | p03862 | C++ |
// Problem : C - Boxes and Candies
// Contest : AtCoder - AtCoder Beginner Contest 048
// URL : https://atcoder.jp/contests/abc048/tasks/arc064_a
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
#define spc ' '
#define endl '\n'
... | a.cc: In function 'int main()':
a.cc:19:9: error: 'll' was not declared in this scope
19 | ll n, x, t = 0, c;
| ^~
a.cc:20:16: error: 'n' was not declared in this scope; did you mean 'yn'?
20 | cin >> n >> x;
| ^
| yn
a.cc:20:21: error: 'x' w... |
s028465434 | p03862 | C++ | #include<iostream>
#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
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#inclu... | a.cc: In function 'int main()':
a.cc:32:11: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
32 | c+=max(d[i]+d[i+1]-b,0);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s479328735 | p03862 | C++ | #include<iostream>
#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
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#inclu... | a.cc: In function 'int main()':
a.cc:32:11: error: no matching function for call to 'max(long long int, int)'
32 | c+=max(d[i]+d[i+1]-b,0);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s650902385 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll N, x;
cin >> N >> x;
vector<ll> a(N);
R... | a.cc: In function 'int main()':
a.cc:18:18: error: 'i' was not declared in this scope
18 | ans += a[i] - x;
| ^
|
s631267313 | p03862 | C++ | //https://atcoder.jp/contests/abc048/tasks/arc064_a
//2020-04-27
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <stack>
#include <deque>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <iomanip>
using namespace std;
int_fast16_t ma... | a.cc:17:1: error: 'int_fast16_t' does not name a type
17 | int_fast16_t main()
| ^~~~~~~~~~~~
|
s542833590 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
ll N,X,i,ans=0;cin>>N>>X;ll A[N];
REP(i,N)cin>>A[i];
if(A[0]>x)ans+=A[0]-x;... | a.cc: In function 'int main()':
a.cc:13:11: error: 'x' was not declared in this scope
13 | if(A[0]>x)ans+=A[0]-x;A[0]=x;
| ^
a.cc:13:30: error: 'x' was not declared in this scope
13 | if(A[0]>x)ans+=A[0]-x;A[0]=x;
| ^
|
s474169235 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n, c=0;
long long x;
cin>>n>>x;
int a[n];
for(int i=0; i<n; i++) cin>>a[i];
for(int i=1; i<n; i++){
int temp = a[i-1]+a[i];
if( temp > x ){
int c+= temp - x;
... | a.cc: In function 'int main()':
a.cc:16:18: error: expected initializer before '+=' token
16 | int c+= temp - x;
| ^~
|
s464729807 | p03862 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using std::cin;
using std::cout;
using std::endl;
using std::min;
using std::vector;
int main(void){
int n, x;
vector<int> a;
cin >> n >> x;
for(int i=0; i<n; i++) cin >> a[i];
long long ans = 0LL;
for(int i=1; i<n; i++) {
long long dif = a[i] ... | a.cc: In function 'int main()':
a.cc:20:18: error: no matching function for call to 'min(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
20 | a[i] -= min(dif, a[i]);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
... |
s611774514 | p03862 | C++ | #include<iostream>
#include<vector>
int main(void){
int n, x;
std::vector<int> a;
std::cin >> n >> x;
for(int i=0; i<n; i++) cin >> a[i];
long long ans = 0LL;
for(int i=1; i<n; i++) {
int dif = a[i] + a[i-1] - x;
if (dif>0) {
a[i] -= std::min(dif, a[i]);
ans += dif;
}
}
st... | a.cc: In function 'int main()':
a.cc:8:26: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | for(int i=0; i<n; i++) cin >> a[i];
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin'... |
s860738047 | p03862 | C++ | #include<iostream>
#include<vector>
int main(void){
int n, x;
std::vector<int> a;
std::cin >> n >> x;
for(int i=0; i<n; i++) cin >> a[i];
long long ans = 0LL;
for(int i=1; i<n; i++) {
int dif = a[i] + a[i-1] - x;
if (dif>0) {
a[i] -= min(dif, a[i]);
ans += dif;
}
}
std::co... | a.cc: In function 'int main()':
a.cc:8:26: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | for(int i=0; i<n; i++) cin >> a[i];
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin'... |
s252366655 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, a, ans=0;
cin >> n >> x;
vector<long long> box(n);
for(int i=0; i<n; i++) cin >> box.at(i);
vector<long long> s(n-1);
for(int i=0; i<n-1; i++) s.at(i)=box.at(i)+box.at(i+1);
for(int i=0; i<n-2; i++) {
a=max(s.at(i)-x,... | a.cc: In function 'int main()':
a.cc:12:12: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
12 | a=max(s.at(i)-x, 0);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s451532063 | p03862 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define ... | a.cc: In function 'int main()':
a.cc:40:7: error: 'i' was not declared in this scope
40 | A[i]=0;
| ^
|
s100160748 | p03862 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define ... | a.cc: In function 'int main()':
a.cc:39:12: error: 'i' was not declared in this scope
39 | ans+=A[i-1]+A[i]-X;
| ^
|
s170719226 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long sum=0//计数器,n,x;
cin>>n>>x;//输入
long long a[n+1];
cin>>a[1];//处理第一个单独超限。
if(a[1]>x)
{
sum+=a[1]-x;//增加吃的量
a[1]=x;//a[i]>=x,要吃的最少,即是a[i]=x;
}
for(int i=2;i<=n;i++)
{
cin>>a[i];//输入
... | a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'cin'
6 | cin>>n>>x;//输入
| ^~~
a.cc:7:17: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | long long a[n+1];
| ^
| yn
a.cc:8:10: error: 'a' was not declared ... |
s535955013 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
//const ull mod = 1e9 + 7;
const ll mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)
// debug
#define dump(x) cerr << #x... | a.cc: In function 'int main()':
a.cc:49:38: error: expected ')' before 'a'
49 | ll tori = max(a[i+1]+a[i]-x,a a[i+1]);
| ~ ^~
| )
a.cc:49:22: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocat... |
s049169225 | p03862 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>
#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#defi... | a.cc: In function 'int main()':
a.cc:37:22: error: no matching function for call to 'max(int, ll)'
37 | A[i-1] -= max(0, t2 - A[i]);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s217087437 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long N, X, A, B, ans = 0;
cin >> N >> X >> A;
while (cin >> B) {
ans += max(0, A + B - X);
B -= (A + B > X) ? max(B, A + B - X) : 0;
A = B;
}
cout << ans << "\n";
} | a.cc: In function 'int main()':
a.cc:8:15: error: no matching function for call to 'max(int, long int)'
8 | ans += max(0, A + B - X);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s507793062 | p03862 | C++ | #include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
#include <tuple>
#include <functional>
#include <cstring>
#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007
#define irep(i,n) for(int i = 0; ... | a.cc: In function 'int main()':
a.cc:62:27: error: expected ';' before 'a_ans'
62 | if(a[i] + a[i]
| ^
| ;
63 | a_ans += (a[i]+a[i+1] - x);
| ~~~~~
a.cc:64:40: error: expected ')' before ';' token
... |
s449980164 | p03862 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),... | a.cc:75:2: error: unterminated argument list invoking macro "COUT"
75 | }
| ^
a.cc: In function 'int main()':
a.cc:74:3: error: 'COUT' was not declared in this scope
74 | COUT(min(anss,ans);
| ^~~~
a.cc:74:7: error: expected '}' at end of input
74 | COUT(min(anss,ans);
| ^
a.cc:3... |
s923509747 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq... | a.cc: In function 'int main()':
a.cc:27:12: error: 'Z' was not declared in this scope
27 | ans+=Z;
| ^
|
s398309945 | p03862 | C++ | #include <vector>
#include <algorithm>
#include <iostream>
#include <queue>
#include <limits>
#include <math.h>
#include <map>
using namespace std;
typedef long long ll;
int main() {
int N;
ll x;
scanf("%d %lld", &N, &x);
vector<ll> a(N);
for (int i = 0; i < N; ++i) scanf("%d", &a[i]);
ll ans = 0;
for ... | a.cc: In function 'int main()':
a.cc:24:21: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
24 | a[i + 1] = max(0, a[i + 1] - diff);
| ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14... |
s461161330 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, x;
cin>>n>>x;
int a[n];
//int sum = 0;
for(int i = 0; i < n; i++)
{
cin>>a[i];
//sum += a[i];
}
for(int i = 0; i < n-1; i++)
{
int d = x-a[i];
if(a[i+1]-d < 0)
continue;
res +=... | a.cc: In function 'int main()':
a.cc:20:9: error: 'res' was not declared in this scope
20 | res += a[i+1]-d;
| ^~~
a.cc:23:15: error: 'res' was not declared in this scope
23 | cout<<res<<"\n";
| ^~~
|
s693142676 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x... | a.cc: In function 'int main()':
a.cc:46:23: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
46 | V[i] = max(0LL, V[i] - (sum - x));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/incl... |
s541344668 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x... | a.cc: In function 'int main()':
a.cc:46:23: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
46 | V[i] = max(0LL, V[i] - (sum - x));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/incl... |
s331949078 | p03862 | C++ | #include<bits/stdc++.h>
#define ll long long
#define int ll
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
int32_t main(){
fast;
int N{},x{},c{}; cin>>N>>x;
int A[N]{}; for(int i=0;i<N;i++) cin>>A[i];
for(int i=1;i<N;i++){
if(a[i]+a[i-1] > x){
... | a.cc: In function 'int32_t main()':
a.cc:12:12: error: 'a' was not declared in this scope
12 | if(a[i]+a[i-1] > x){
| ^
|
s412770740 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll Svec(vector<ll> v){
ll n=0;
for(ll i=0;i<v.size();i++) n+=v[i];
return n;
}
int main(){
ll n,x,ans;cin>>n>>x;
vector<ll> v(n);
rep(i,n) cin>>v[i];
ans=Svec(v);
if(v[0]>x) v[0]=x;
for(ll i=0;i<n-1;i++){
if(v[i]+v[i+1]>x){
... | a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
12 | rep(i,n) cin>>v[i];
| ^
a.cc:12:3: error: 'rep' was not declared in this scope
12 | rep(i,n) cin>>v[i];
| ^~~
|
s983455628 | p03862 | C++ | /*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
const ll MOD = 1000000000000000001;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a) (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll Len(ll n) {
... | a.cc: In function 'int main()':
a.cc:99:11: error: 'x' was not declared in this scope
99 | cin>>n>>x;
| ^
|
s387113457 | p03862 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
long long a[100005];
int main()
{
long long n,x,t;
while(~scanf("%lld%lld",&n,&x))
{
long long sum = 0;
a[0] = 0;
for(int i = 1; i <= n; i++)
{
scanf("%lld",&a[i]);
if(a[i] + a[i-1] > x)
... | a.cc: In function 'int main()':
a.cc:21:43: error: expected primary-expression before '/' token
21 | t = a[i] + a[i-1] - x; / / the number of the difference from the previous value
| ^
a.cc:21:45: error: expected primary-expression before '/' token
... |
s138936064 | p03862 | C++ |
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
ll x;
cin >> x;
vector<ll> a(n);
for(ll i=0;i<n;i++){
cin >> a.at(i);
}
ll ans =0;
for(ll i=1;i<n;i++){
if(a.at(i-1) + a.at(i) > x){
ans +=
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
8 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:11:3: error: 'vector' was not declared ... |
s027758618 | p03862 | C++ | #include<iostream>
#include<vector>
using namespace std;
long long main(){
long long n;
long long maxc;
cin >> n >> maxc;
vector<long long>candies;
for(long long i = 0;i<n;++i){
long long temp;
cin >>temp;
candies.push_back(temp);
}
long long sum = 0;
for(long long j = 0;j<n-1;++j){
if(candies[j]+cand... | cc1plus: error: '::main' must return 'int'
|
s884740352 | p03862 | C | # include <stdio.h>
# include <math.h>
# include <stdlib.h>
int main()
{
int a[100000], x, i, k = 0;
scanf("%d %d", &n, &x);
for (i = 0; i < n; i++)
{
scanf("%d", &a[i]);
if (a[i] > x)
{
k = k + (a[i] - x);
a[i] = x;
}
}
for (i = 0; i < (n - 1); i++)
{
if ((a[i] + a[i + 1]) > x)
{
... | main.c: In function 'main':
main.c:8:25: error: 'n' undeclared (first use in this function)
8 | scanf("%d %d", &n, &x);
| ^
main.c:8:25: note: each undeclared identifier is reported only once for each function it appears in
|
s429191484 | p03862 | C++ | #include<bits/stdc++.h >
#include<algorithm>
#include<vector>
typedef long long ll;
#define rep(i,a,b) for(ll i=(a);i<(b);i++)
using namespace std;
ll N, x;
vector<ll> a;
int ans = 0;
int main() {
cin >> N >> x;
rep(i, 0, N) {
ll t;
cin >> t;
a.push_back(t);
}
if (a[0] > x) {
ans += a[0] - x;
a[0] = x;... | a.cc:1:9: fatal error: bits/stdc++.h : No such file or directory
1 | #include<bits/stdc++.h >
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s513863863 | p03862 | C++ | Last login: Fri Oct 11 10:11:46 on console
pc026030m:~ 8289423578$ vim
pc026030m:~ 8289423578$ vim test.cpp
pc026030m:~ 8289423578$ cp test.cpp > init.cpp
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
pc026030... | a.cc:11:2: error: invalid preprocessing directive #exl
11 | #exl.awk# eular.dat nbody2_anim
| ^~~
a.cc:13:1: error: too many decimal points in number
13 | 1.2.cpp eular_1.cpp nbody2_anim.cpp~
| ^~~~~~~
a.cc:14:1: error: too many decimal points i... |
s555078820 | p03862 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
typedef long long ll;
#define rep(i,a,b) for(ll i=long long(a);i<long long(b);i++)
using namespace std;
ll N, x;
vector<ll> a;
int ans = 0;
int main() {
cin >> N >> x;
rep(i, 0, N) {
ll t;
cin >> t;
a.push_back(t);
}
if (a[0] > x) {
ans += a[0] - x;... | a.cc: In function 'int main()':
a.cc:5:29: error: expected primary-expression before 'long'
5 | #define rep(i,a,b) for(ll i=long long(a);i<long long(b);i++)
| ^~~~
a.cc:14:9: note: in expansion of macro 'rep'
14 | rep(i, 0, N) {
| ^~~
a.cc:5:44: error: expe... |
s603382364 | p03862 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
long long int x;
cin >> N >> x;
vector<long long int> a(N,0LL);
for(int i = 0; i < N; i++) cin >> a[i];
long long int ans = 0LL;
for(int i = 0; i < N-1; i++){
if(a[i] + a[i+1] > x){
if(a[i + 1] >= (a[i] + a[i+1... | a.cc: In function 'int main()':
a.cc:20:7: error: expected '}' before 'else'
20 | else{
| ^~~~
a.cc:17:42: note: to match this '{'
17 | if(a[i + 1] >= (a[i] + a[i+1] - x)){
| ^
|
s242265456 | p03862 | C++ | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
int n; cin >> n;
ll x; cin >> x;
ll ans = 0;
vector<ll> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
if(a[0] > x;){
ans += a[0] - x;
a[0] -= a[0] - x;
}
for(int i = 1; i < n; ... | a.cc: In function 'int main()':
a.cc:13:17: error: expected primary-expression before ')' token
13 | if(a[0] > x;){
| ^
|
s906333447 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(... | a.cc: In function 'int main()':
a.cc:26:25: error: no matching function for call to 'max(ll, int)'
26 | a[i+1] = max(a[i+1] - eat,0);
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/st... |
s505052073 | p03862 | C++ | // https://atcoder.jp/contests/arc067/tasks/arc067_b
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
signed... | a.cc: In function 'int main()':
a.cc:21:23: error: no matching function for call to 'max(long long int, int64_t)'
21 | sum += max(0LL, t - x);
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits... |
s849120522 | p03862 | C++ | // https://atcoder.jp/contests/arc067/tasks/arc067_b
#include <bits/stdc++.h>
using namespace std;
#define int int_fast64_t
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
s... | a.cc: In function 'int main()':
a.cc:19:19: error: no matching function for call to 'max(long long int, int_fast64_t&)'
19 | sum += max(0LL, t);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:... |
s834659954 | p03862 | C++ | // https://atcoder.jp/contests/arc067/tasks/arc067_b
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
signed... | a.cc: In function 'int main()':
a.cc:19:19: error: no matching function for call to 'max(long long int, int64_t&)'
19 | sum += max(0LL, t);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s640239014 | p03862 | C++ | // https://atcoder.jp/contests/arc067/tasks/arc067_b
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
signed... | a.cc: In function 'int main()':
a.cc:18:19: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
18 | sum += max(0LL, v[i + 1] + v[i] - x);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/includ... |
s278637887 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,x,a2,res,num;
cin>>n>>x;
res = 0;
num = 0;
cin>>a1;
for(long long i=1;i<n;i++){
cin>>a2;
num = x<(a1+a2)?a1+a2-x:0;
res += num;
if(a2 >= num){
a2 -= num;
}else{
a2... | a.cc: In function 'int main()':
a.cc:8:10: error: 'a1' was not declared in this scope; did you mean 'a2'?
8 | cin>>a1;
| ^~
| a2
a.cc:16:19: error: expected ';' before '}' token
16 | a2 = 0
| ^
| ;
17 | }
... |
s418317019 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n);(i)>=0;(i)--)
typedef long long lint;
int main(){
unsigned long long int N,x,ans=0,tmp=0;
cin >>N>>x;
lint M[N];
rep(i,N)cin >>M[i];
... | a.cc: In function 'int main()':
a.cc:18:16: error: no matching function for call to 'max(long long unsigned int, int)'
18 | M[i]-=max(tmp-x,0);
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s227252630 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
using int = long long;
int main(){
int N, x;
cin >> N >> x;
vector<int> a(N);
for(int i=0; i<N; i++){
cin >> a.at(i);
}
//操作
int ans = 0;
if(a.at(0) > x){
ans += a.at(0) - x;
a.at(0) = x;
}
for(int i=1; i<N; i++){
if(a.at(i-1) + a.at(i) >... | a.cc:3:7: error: expected nested-name-specifier before 'int'
3 | using int = long long;
| ^~~
|
s078828354 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
using long long = int;
int main(){
int N, x;
cin >> N >> x;
vector<int> a(N);
for(int i=0; i<N; i++){
cin >> a.at(i);
}
//操作
int ans = 0;
if(a.at(0) > x){
ans += a.at(0) - x;
a.at(0) = x;
}
for(int i=1; i<N; i++){
if(a.at(i-1) + a.at(i) >... | a.cc:3:7: error: expected nested-name-specifier before 'long'
3 | using long long = int;
| ^~~~
|
s704472542 | p03862 | C++ | #include<bits/stdc++.h>
using namespace std;
long long a,b,n,x,ans,t;
int main(){
cin>>n>>x;
cin>>a;
for(int i=2;i<=n;i++)
{
cin>>b;
if(a+b>x)t=a+b-x,ans+=t,
b=b-t,if(b<0)b=0;
a=b;
}
cout<<ans;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:15: error: expected primary-expression before 'if'
12 | b=b-t,if(b<0)b=0;
| ^~
|
s250045121 | p03862 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int x;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int answer = 0;
for (int i = 0; i < n; i++) {
if (arr[i] > x) {
answer = answer + (arr[i] - x);
}
}
for (int i = 0; i... | a.cc: In function 'int main()':
a.cc:29:53: error: 'i' was not declared in this scope
29 | answer = answer + (arr[n - 2] - x < 0 ? arr[i + 1] : arr[i + 1] - x);
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.