submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s832747790 | p03739 | C++ | #include"bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
vector<int> x;
int temp,ans=0;
for(int i=0;i!=n;++i){
cin>>temp;
x.push_back(temp);
}
if(!x[0]){
x[0]=1;
++ans;
int val,ind;
for(int i=0;i!=n;++i){
if(!x[i]){
val=x[i];
ind=i;
break;
}
}
if((val>0 && ind%2) ... | a.cc: In function 'int main()':
a.cc:23:59: error: expected ';' before 'x'
23 | if((val>0 && ind%2) || (val<0 && !(ind%2))
| ^
| ;
24 | x[0]=-1;
... |
s777829108 | p03739 | C++ | #include <bits/stdc++.h>
using namespace std;
__int64 dp[100005][2],s[100005][2];
int a[100005];
int main()
{
//freopen("1.txt","w",stdout);
int n;
scanf("%d",&n);
for(int i=0;i<n;++i) scanf("%d",&a[i]);
if(a[0]<0)
{
dp[0][0]=0;
s[0][0]=a[0];
dp[0][1]=1-a[0];
s[0][1]=1;
}
else if(a[0]>0)
{
dp[0]... | a.cc:3:1: error: '__int64' does not name a type; did you mean '__int64_t'?
3 | __int64 dp[100005][2],s[100005][2];
| ^~~~~~~
| __int64_t
a.cc: In function 'int main()':
a.cc:13:17: error: 'dp' was not declared in this scope; did you mean 'dup'?
13 | dp[0][0]=0;
| ... |
s989844898 | p03740 | C++ | #include <bits/stdc++.h>
//#include <atcoder/all>
#define ll long long int
#define MOD 1000000007
#define P pair<ll,ll>
#define INF 1000000000000000000
//using namespace atcoder;
using namespace std;
int main(void){
ll x, y;
cin >> x >> y;
if (abs(x-y) < 2)
cout << "Brown" << endl;
else
cout << "Al... | a.cc: In function 'int main()':
a.cc:18:21: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
18 | cout << "Alice" << end;
| ~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/... |
s865459906 | p03740 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int64_t x, y;
cin >> x >> y;
if (abs(x, y) <= 1) {
cout << "Brown";
} else {
cout << "Alice";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:10: error: no matching function for call to 'abs(int64_t&, int64_t&)'
6 | if (abs(x, y) <= 1) {
| ~~~^~~~~~
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
from... |
s771162289 | p03740 | Java |
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class A {
private static final int mod =(int)1e9+7;
public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
PrintWriter out=new PrintWriter(System.out);
long x=sc.nextLong();
long y=sc.next... | Main.java:5: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s309268001 | p03740 | C | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
int a, b;
cin >> a >> b;
if (abs(a-b) <= 1){
cout << "Brown";
}
else{
cout << "Alice";
}
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s055818887 | p03740 | C++ | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(a... | a.cc: In function 'int main()':
a.cc:29:9: error: 'lll' was not declared in this scope; did you mean 'll'?
29 | lll s,t;
| ^~~
| ll
a.cc:31:15: error: 's' was not declared in this scope
31 | cin >>s>>t;
| ^
a.cc:31:18: error: 't' was not declared in ... |
s854517729 | p03740 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
#define MODSIZE 1000000007
int main(){
ll x,y;
ll a = 0;
ll b = 0;
scanf("%lld %lld", &x, &y);
if(abs(X - Y) <= 1) printf("Brown\n");
else printf("Alice\n");
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:10: error: 'X' was not declared in this scope
14 | if(abs(X - Y) <= 1) printf("Brown\n");
| ^
a.cc:14:14: error: 'Y' was not declared in this scope
14 | if(abs(X - Y) <= 1) printf("Brown\n");
| ^
|
s537745202 | p03740 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s831264628 | p03740 | C++ | #include <bits/stdc++.h>
using namespace std;
long long abs(long long x)
{
return x>=0?x:-x;
}
int main()
{
long long x,y;
cin>>x>>y;
cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:19: error: call of overloaded 'abs(long long int)' is ambiguous
11 | cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl;
| ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.... |
s249315156 | p03740 | C++ | #include <bits/stdc++.h>
using namespace std;
long long abs(long long x)
{
return x>=0?x:-x;
}
int main()
{
long long x,y;
cin>>x>>y;
cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:19: error: call of overloaded 'abs(long long int)' is ambiguous
11 | cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl;
| ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.... |
s011881897 | p03740 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int x, y;
cin>>x>>y;
if(abs(x-y) <= 1)
cout<<"Brown";
else
cout<<"Alice"
return 0;
} | a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before 'return'
11 | cout<<"Alice"
| ^
| ;
12 | return 0;
| ~~~~~~
|
s130768328 | p03740 | 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 int64_t
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq p... | a.cc: In function 'int main()':
a.cc:31:24: error: request for member 'b' in 'std::__cxx11::stoll(A, 0, 10)', which is of non-class type 'long long int'
31 | int a=stoll(A).b=stoll(B);
| ^
a.cc:32:15: error: 'b' was not declared in this scope
32 | if(a<=b+1)
| ... |
s473210549 | p03740 | 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 uint64_t
#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:31:24: error: request for member 'b' in 'std::__cxx11::stoll(A, 0, 10)', which is of non-class type 'long long int'
31 | int a=stoll(A).b=stoll(B);
| ^
a.cc:32:15: error: 'b' was not declared in this scope
32 | if(a<=b+1)
| ... |
s788366351 | p03740 | C++ | #include <bits/stdc++.h>
#define ri register int
#define ll long long
using namespace std;
int read()
{
int num=0;
int flg=1;
char c=getchar();
while(!isdigit(c))
{
if(c=='-')
{
flg=-1;
}
c=getchar();
}
while(isdigit(c))
{
num=(num<<1)... | a.cc: In function 'int main()':
a.cc:29:63: error: expected '}' at end of input
29 | return 0&(int)puts(abs(read()-read())<=1?"Brown":"Alice");
| ^
a.cc:28:1: note: to match this '{'
28 | {
| ^
|
s753508622 | p03740 | C++ | #include<bits/stdc++.h>
using namespace std;
long read(){
long num=0,flag=1;
char c=getchar();
while(!isdigit(c)){
if(c=='-') flag=-1;
c=getchar();
}
while(isdigit(c)){
num=(num<<1)+(num<<3)+(c^48);
c=getchar();
}
return num*flg;
}
int main(){
puts(abs(read()... | a.cc: In function 'long int read()':
a.cc:14:16: error: 'flg' was not declared in this scope; did you mean 'flag'?
14 | return num*flg;
| ^~~
| flag
|
s004332322 | p03740 | C++ | # include <iostream>
using namespace std;
typedef long long ll;
int main(void){
ll n, m;
cin >> n>> m;
if (abs(n-m) <= 1) cout << Brown << endl;
else cout << Alice << endl;
} | a.cc: In function 'int main()':
a.cc:8:30: error: 'Brown' was not declared in this scope
8 | if (abs(n-m) <= 1) cout << Brown << endl;
| ^~~~~
a.cc:9:16: error: 'Alice' was not declared in this scope
9 | else cout << Alice << endl;
| ^~~~~
|
s246699913 | p03740 | C++ | #include<bits/stdc++.h>
using namespace std;
int main
{
unsigned long long int x ,y;
cin>>x>>y;
if(abs(x - y) <= 1) puts("Brown");
else puts("Alice");
} | a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main
| ^~~~
a.cc:5:9: error: expected primary-expression before 'unsigned'
5 | unsigned long long int x ,y;
| ^~~~~~~~
a.cc:5:9: error: expected '}' before 'unsigned'
a.cc:4:1: note: to match this '{'
4 ... |
s147563664 | p03740 | C++ | #include "bits/stdc++.h"
using namespace std;
int main() {
ll X, Y;
cin >> X >> Y;
if (abs(X - Y) < 2) {
cout << "Brown" << endl;
} else {
cout << "Alice" << endl;
}
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
5 | ll X, Y;
| ^~
a.cc:6:12: error: 'X' was not declared in this scope
6 | cin >> X >> Y;
| ^
a.cc:6:17: error: 'Y' was not declared in this scope
6 | cin >> X >> Y;
| ... |
s740773606 | p03740 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second
template <class T>
void cout_vec(const vector<T> &vec){
for(auto itr:v... | a.cc: In function 'int main()':
a.cc:26:6: error: expected primary-expression before '|' token
26 | if(|x-y|<=1) cout<<"Brown"<<endl;
| ^
a.cc:26:11: error: expected primary-expression before '<=' token
26 | if(|x-y|<=1) cout<<"Brown"<<endl;
| ^~
|
s523397059 | p03740 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define MOD 1000000007
#define DEBUG 0
#define REP(i,n) for(int i=0;i<n;i++)
int main(){
lli x,y;
cin>>x,y;
cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:23: error: no match for 'operator<=' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int')
15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl;
| ~~~~~~~~~~~~~~^~~
| | |
| ... |
s340753528 | p03740 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#define MOD 1000000007
#define INF INT_MAX
#define NINF INT_MIN
#define LLINF LLONG_MAX
using ll = long long;
using namespace std;
int main() {
int X, Y;
ll >> X >> Y... | a.cc: In function 'int main()':
a.cc:19:8: error: expected unqualified-id before '>>' token
19 | ll >> X >> Y;
| ^~
|
s838436848 | p03740 | C++ | #include<bits/stdc++>
using namespace std;
int main(void){
long long x, y;
cin >> x >> y;
if(abs(x-y)<=1) cout << "Brown" << endl;
else cout << "Alice" << endl;
} | a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s187102294 | p03740 | C++ | #include <cstdio>
main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}
| a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:22: error: 'cin' is not a member of 'std'
2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":... |
s335181072 | p03740 | C++ | #include <bits.stdc++.h>
using namespace std;
typedef long long ll;
ll x, y;
int main() {
cin >> x >> y;
if(abs(x - y) > 1) puts("Alice");
else puts("Brown");
} | a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory
1 | #include <bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s094918072 | p03740 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
//#include <stack>
#include <climits>
#include <map>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
usi... | a.cc: In function 'int main()':
a.cc:26:6: error: expected '}' before 'else'
26 | else{
| ^~~~
a.cc:24:20: note: to match this '{'
24 | if(abs(x-y)<=1){
| ^
|
s239988119 | p03740 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;
int main(){
unsigned long long x,y;
cin>>x>>y;
if(abs(x-y)>=2) cout<<"Alice"<<endl;
else cout<<"Brown"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:9: error: call of overloaded 'abs(long long unsigned int)' is ambiguous
13 | if(abs(x-y)>=2) cout<<"Alice"<<endl;
| ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
... |
s207612459 | p03740 | C++ | #inclde <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin >> a >> b;
cout << ((abs(a-b) > 1) ? "Alice" : "Brouwn" ) << endl;
} | a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
1 | #inclde <bits/stdc++.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '... |
s395873836 | p03740 | C++ | #include <iostream>
using namespace std;
long long X,Y;
int main(){
cin >> X >> Y;
if((X+Y>1 && abs(X-Y)<=1) || (X==0 && Y==0) cout << "Brown" << endl;
else cout << "Alice" << endl;
} | a.cc: In function 'int main()':
a.cc:8:46: error: expected ';' before 'cout'
8 | if((X+Y>1 && abs(X-Y)<=1) || (X==0 && Y==0) cout << "Brown" << endl;
| ^~~~~
| ;
a.cc:9:3: error: expected primary-expression befor... |
s631176344 | p03740 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int n=0;
for(int i=a;i<b;++i)n+=(a-i);
cout<<(n%2==0?Alice:Brown)<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:15: error: 'Alice' was not declared in this scope
9 | cout<<(n%2==0?Alice:Brown)<<endl;
| ^~~~~
a.cc:9:21: error: 'Brown' was not declared in this scope
9 | cout<<(n%2==0?Alice:Brown)<<endl;
| ^~~~~
|
s059402475 | p03740 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#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 ll __int64
#define ll lo... | a.cc: In function 'int main()':
a.cc:22:14: error: 'a' was not declared in this scope
22 | cin>>a>>b;
| ^
a.cc:22:17: error: 'b' was not declared in this scope; did you mean 'pb'?
22 | cin>>a>>b;
| ^
| pb
|
s948069809 | p03740 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#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 ll __int64
//#define ll lo... | a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:20:1: note: in expansion of macro 'll'
20 | ll a,b;
| ^~
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
16 | #define ll __int64
... |
s126924427 | p03740 | C++ | #include<bits/stdc++.h>
using namespace std;
long long ll;
int main (){
ll x,y;
cin >> x >> y;
if(abs(x-y)<=1){
cout<<"Brown"<<endl;
}else{
cout<<"Alice"<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:5: error: expected ';' before 'x'
5 | ll x,y;
| ^~
| ;
a.cc:6:10: error: 'x' was not declared in this scope
6 | cin >> x >> y;
| ^
a.cc:6:15: error: 'y' was not declared in this scope; did you mean 'yn'?
6 | cin >> x >> y;
... |
s242748092 | p03740 | C++ | #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
typedef long long LL;
typedef pair<int,int> PII;
const double eps=1e-8;
const double pi=acos(-1.0);
const int K=1e6+7;
const int mod=1e9+7;
bool solve (int x, int y) {
for (int i = 2; i <= x; i += 2) {
if (!solve(x -... | a.cc: In function 'int main()':
a.cc:28:10: error: 'a' was not declared in this scope
28 | cin>>a>>b;
| ^
a.cc:28:13: error: 'b' was not declared in this scope
28 | cin>>a>>b;
| ^
|
s697547336 | p03740 | C++ | #include <bits/stdc++.h>
#define p(s) cout<<(s)<<endl
using namespace std;
int main(){
ll x,y;
cin>>x>>y;
p(abs(x-y)<=1?"Brown":"Alice");
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:9: error: 'll' was not declared in this scope
6 | ll x,y;
| ^~
a.cc:7:14: error: 'x' was not declared in this scope
7 | cin>>x>>y;
| ^
a.cc:7:17: error: 'y' was not declared in this scope; did you mean 'yn'?
7 | ... |
s687887310 | p03740 | C | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")};
| main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")};
| ^~~~
main.c: In function 'main':
main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(){long a,b;scanf("%lld... |
s457560454 | p03740 | C | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice");
| main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice");
| ^~~~
main.c: In function 'main':
main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(){long a,b;scanf("%lld%... |
s782334870 | p03740 | C++ | main(){long long a,b;cin>>a>>b;puts(a-b-1&&a-b+1&&a-b?"Alice":"Brown");}
| a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){long long a,b;cin>>a>>b;puts(a-b-1&&a-b+1&&a-b?"Alice":"Brown");}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:22: error: 'cin' was not declared in this scope
1 | main(){long long a,b;cin>>a>>b;puts(a-b-1&&a-... |
s964825123 | p03740 | C++ | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int X, Y;
cin >> X >> Y;
cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:22: error: no match for 'operator<=' (operand types are 'std::basic_ostream<char>' and 'int')
8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl;
| ~~~~~~~~~~~~~~~~~~ ^~ ~
| | |
| | int
| std::... |
s264547297 | p03740 | C++ | #include<csdtio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
using namespace std;
typedef long long LL;
LL a, b;
int main(){
scanf("%lld %lld", &a, &b);
if(abs(a - b) <= 1) printf("Brown\n");
else printf("Alice\n");
return 0;
} | a.cc:1:9: fatal error: csdtio: No such file or directory
1 | #include<csdtio>
| ^~~~~~~~
compilation terminated.
|
s708148476 | p03740 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const int MaxN = 1e5;
typedef long long LL;
LL n, m;
LL gcd(LL x, LL y)
{
if(y == 0) return x;
else return gcd(y, x % y);
}
int main()
{
while(scanf("%lld %lld", &n, &m) != EOF)
{
if(n > 0 && m > 0)... | a.cc: In function 'int main()':
a.cc:22:39: error: 'y' was not declared in this scope
22 | LL x = gcd(x, y);
| ^
|
s590211326 | p03740 | C++ | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<string>
#include<climits>
#include<vector>
#include<cmath>
#include<map>
#include<queue>
#define LL long long
#define pii pair<int,int>
#define mp make_pair
using namespace std;
inline char nc(){
/*
stati... | a.cc: In function 'int main()':
a.cc:71:14: error: 'put' was not declared in this scope; did you mean 'putw'?
71 | else put("Alice");
| ^~~
| putw
|
s551837549 | p03740 | C++ | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
typedef unsigned long long ull;
int main() {
unsigned long long n1, n2;
cin >> n1 >> n2;
if((ull(1) * n1 + n2) > ull(2) && ((ull(1) * n1 + n2) % ull(5) == 0 || (ull(1) * n1 + n2) % ull(3) == 0) || (ull(1) * n1 + n2) % ull(7) == 0))... | a.cc: In function 'int main()':
a.cc:13:144: error: expected primary-expression before ')' token
13 | if((ull(1) * n1 + n2) > ull(2) && ((ull(1) * n1 + n2) % ull(5) == 0 || (ull(1) * n1 + n2) % ull(3) == 0) || (ull(1) * n1 + n2) % ull(7) == 0)) cout << "Alice" << endl;
| ... |
s504052156 | p03740 | C++ | #include <bits/stdc++.h>
#define scan(x) scanf("%d",&x)
#define scan2(x,y) scanf("%d%d",&x,&y)
#define scan3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define FASTER std::ios::sync_with_stdio(false)
#define DEBUG(x) cout<<#x<<" = "<<x<<endl
#define pb push_back
#define mk make_pair
#define vp vector<pair<ll,ll> >
#define se se... | a.cc: In function 'int main()':
a.cc:42:33: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
42 | cout << "Alice" <endl;
| ~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
... |
s425136469 | p03741 | C++ | #include<cstring>
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<climits>
#include<bitset>
using namespace std;
const int N = 100000 + 5;
int n, a[N];
int main() {
scanf ("%d", &n);
for (int i = 1; i <= n; ++i) scanf ("%d", &a[i]);
long long sum = 0, need1... | a.cc: In function 'int main()':
a.cc:34:5: error: 'cout' was not declared in this scope
34 | cout << need1 << '\n';
| ^~~~
a.cc:9:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
8 | #include<bitset>
+++ |+#include <iostream>
9 |... |
s819109910 | p03741 | 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)
int main(){
ll N,i,ans,sum;cin>>N;ll A[N];REP(i,N)cin>>A[i];
sum=max(A[0],1);ans=sum-A[0];
FOR(i,(ll)1,N){
if((sum<0&&sum+A[i]>0)||(sum>0&&sum+A[i]<0))sum+=A[i];
else{ans+... | a.cc: In function 'int main()':
a.cc:8:10: error: no matching function for call to 'max(ll&, int)'
8 | sum=max(A[0],1);ans=sum-A[0];
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from ... |
s967438423 | p03741 | 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)
int main(){
ll N,i,ans,sum;cin>>N;ll A[N];REP(i,N)cin>>A[i];
sum=max(A[0],1);ans=sum-A[0];
FOR(i,(ll)1,N){
if((sum<0&&sum+A[i]>0)||(sum>0&&sum+A[i]<0))sum+=A[i];
else{ans+... | a.cc: In function 'int main()':
a.cc:8:10: error: no matching function for call to 'max(ll&, int)'
8 | sum=max(A[0],1);ans=sum-A[0];
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from ... |
s991088619 | p03741 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using ii=pair<ll,ll>;
using vi=vector<ll>;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (ll)1e18
#define all(x) (x).begin(),(x).end()
#define print(a); for(auto x:a)cout<<x<<" "; cout<<"\... | a.cc: In function 'int main()':
a.cc:49:28: error: 'i' was not declared in this scope
49 | else if(a[0]>0)ans2+=a[i]+1,p[0]=-1;
| ^
a.cc:50:19: error: 'i' was not declared in this scope
50 | else ans2-=(a[i]-1),p[0]=1;
| ^
|
s692654877 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> A(N);
for(int i=0;i<N;i++){
cin >> A.at(i);
}
int C1=0,C2=0;
int sum=0;
for(int i=0;i<N;i++){
sum+=A.at(i);
if(i%2==0 && sum<=0){
C1+=abs(sum)+1;
sum=1;
}
else if(i%2==1 && sum>=0){
... | a.cc: In function 'int main()':
a.cc:25:7: error: redeclaration of 'int sum'
25 | int sum=0;
| ^~~
a.cc:12:7: note: 'int sum' previously declared here
12 | int sum=0;
| ^~~
|
s493868259 | p03741 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, 1, 0, -1};
int main(){
ll n;
cin >> n;
vector<ll> a;
... | a.cc: In function 'int main()':
a.cc:49:16: error: expected primary-expression before '<' token
49 | if(sum2[0]=<0) total = abs(sum2[0])+1;
| ^
|
s504010582 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vpi;
typedef double dl;
#define mp make_pair
#define pb emplace_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define dst distance
#define INF 100000... | a.cc:27:1: error: '::main' must return 'int'
27 | ll main(){
| ^~
|
s427081682 | p03741 | C++ | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
long long int a,b[100010],c[100010],ans =0;
int main(){
cin >> a;
for(int i=0;i<a;i++)
cin >> b[i];
c[0] = b[0];
for(int i=0;i<a-1;i++){
c[i+1] += b[i+1];
if( c[i] <0 && c[i+1] <=0){
... | a.cc: In function 'int main()':
a.cc:26:32: error: expected primary-expression before '>' token
26 | else if(c[i] >0 && c[i+1] =>0){
| ^
|
s504355073 | p03741 | C++ | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
long long int a,b[100010],c[100010],ans =0;
int main(){
cin >> a;
for(int i=0;i<a;i++)
cin >> b[i];
c[0] = b[0]
for(int i=0;i<a-1;i++){
c[i+1] += b[i+1];
if( c[i] <0 && c[i+1] <=0){
... | a.cc: In function 'int main()':
a.cc:16:15: error: expected ';' before 'for'
16 | c[0] = b[0]
| ^
| ;
17 | for(int i=0;i<a-1;i++){
| ~~~
a.cc:17:15: error: 'i' was not declared in this scope
17 | for(int i=0;i<a-1;i++){
| ^
|
s106110612 | p03741 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
#include <string>
#include <sstream>
//#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
/*struct shi
{
int x;
int T;
} s[100000];
int cmp(shi a,shi b)
{
return a.x<b.x;
}
long... | a.cc: In function 'int main()':
a.cc:145:16: error: expected primary-expression before '>' token
145 | if(sum=>0)
| ^
|
s038228447 | p03741 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
#include <string>
#include <sstream>
//#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
/*struct shi
{
int x;
int T;
} s[100000];
int cmp(shi a,shi b)
{
return a.x<b.x;
}
long... | a.cc: In function 'int main()':
a.cc:107:19: error: expected ';' before '}' token
107 | sum=-1
| ^
| ;
108 |
109 | }
| ~
|
s537838396 | p03741 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
long long x, y;
cin >> x >> y;
if (abs (x - y) < 2)
cout << "Brown" << endl:
else
cout << "Alice" << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before ':' token
9 | cout << "Brown" << endl:
| ^
| ;
|
s594031409 | p03741 | C++ | #include <bits/stdc++.h>
typedef long long ll;
ll x, y;
int main()
{
scanf("%lld%lld", &x, &y);
printf("%s\n", max(0, x - 1) > y? "Alice" : "Brown");
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:24: error: 'max' was not declared in this scope; did you mean 'std::max'?
10 | printf("%s\n", max(0, x - 1) > y? "Alice" : "Brown");
| ^~~
| std::max
In file included from /usr/include/c++/14/algorithm:61,
... |
s938732105 | p03741 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
int *a;
int l;
int ct=0;
int p=0;
cin>>n;
a=new long long int [n+1];
while(cin>>l){
a[p] = l;
p++;
}
a[n]=0;
if(a[0]>0){
for(int i=0;i<n;i++){
if(a[i]<=0&&i%2==0){
ct=ct+0-a[i]+1;
a[i]=1... | a.cc: In function 'int main()':
a.cc:10:11: error: cannot convert 'long long int*' to 'int*' in assignment
10 | a=new long long int [n+1];
| ^~~~~~~~~~~~~~~~~~~~~~~
| |
| long long int*
|
s200985575 | p03741 | C++ | #define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#pragma GCC optimize ("O3","unroll-loops")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
#define hi cerr<<"hi"<<endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
#define... | a.cc:12:9: warning: "INT_MAX" redefined
12 | #define INT_MAX LLONG_MAX
| ^~~~~~~
In file included from /usr/include/c++/14/climits:42,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38,
from a.cc:8:
/usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:120:9: note... |
s624477757 | p03741 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = int long long;
map <int ,int> mpa,mpb;
int main(){
int n;
cin >> n;
ll a[n];
ll sum=0,sum1=0;... | a.cc: In function 'int main()':
a.cc:23:15: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
23 | for(int i=1;i<n:i++){
| ^
a.cc:23:18: error: found ':' in nested-name-specifier, expected '::'
23 | for(int i=1;i<n:i++... |
s459397163 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define LINF 1000000000000000007
typedef long long Int;
typedef pair<Int,Int> P;
Int gcd(Int x, Int y){
if(y == 0) return x;
return gcd(y, x%y);
}
Int lcm(Int x, Int y){
return x * y / gcd(x,y);
}
bool sosuu(Int x){
bool b = 1;
if(x == 1) b ... | a.cc: In function 'int main()':
a.cc:62:35: error: expected ';' before 'return'
62 | cout << min(ans[0],ans[1])
| ^
| ;
63 |
64 | return 0;
| ~~~~~~
|
s484458345 | p03741 | C++ | #include<iostream>
using namespace std;
int sign(int x){
if (x>0)
return 1;
return -1;
}
int main(){
int n;
cin >> n;
int sum = 0;
int res = 0;
for(int i=0;i <n;i++){
int x;
cin >> x;
if (sign(sum) != sign(sum+x) || i == 0){
sum += x;
}else{
sum += x;
res += sum;
sum = (sum-x > 0 ? -1 : 1);... | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:18:1: error: extended character is not valid in an identifier
18 |
| ^
a.cc:3:1: error: '\U000000a0' does not name a type
... |
s007569067 | p03741 | C++ |
#include<iostream>
using namespace std;
int sign(int x){
if (x>0)
return 1;
return -1;
}
int main(){
int n;
cin >> n;
int sum = 0;
int res = 0;
for(int i=0;i <n;i++){
int x;
cin >> x;
if (sign(sum) != sign(sum+x) || i == 0){
sum += x;
}else{
sum += x;
res += sum;
sum = (sum-x > 0 ? -1 : ... | a.cc:4:1: error: extended character is not valid in an identifier
4 |
| ^
a.cc:10:1: error: extended character is not valid in an identifier
10 |
| ^
a.cc:14:1: error: extended character is not valid in an identifier
14 |
| ^
a.cc:20:1: error: extended character is not valid in... |
s016261439 | p03741 | C++ | #include<iostream>
using namespace std;
int sign(int x){
if (x>0)
return 1;
return -1;
}
int main(){
int n;
cin >> n;
int sum = 0;
int res = 0;
for(int i=0;i <n;i++){
int x;
cin >> x;
if (sign(sum) != sign(sum+x) ){
sum += x;
}else{
sum += x;
res += sum;
sum = (sum-x > 0 ? -1 : 1);
}
}... | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:19:1: error: extended character is not valid in ... |
s592123131 | p03741 | C++ | #include<iostream>
using namespace std;
int sign(int x){
if (x>0)
return 1;
return -1;
}
int main(){
int n;
cin >> n;
int sum = 0;
int res = 0;
for(int i=0;i <n;i++){
int x;
cin >> x;
if (sign(sum) != sign(sum+x) ){
sum += x;
}else{
sum += x;
res += sum;
sum = (sum-x > 0 ? -1 : 1);
}
co... | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:19:1: error: extended character is not valid in ... |
s107460914 | p03741 | C++ | #include<iostream>
using namespace std;
int sign(x){
if (x>0)
return 1;
return -1;
}
int main(){
int n;
cin >> n;
int sum = 0;
int res = 0;
for(int i=0;i <n;i++){
int x;
cin >> x;
if (sign(sum) != sign(sum+x) ){
sum += x;
}else{
sum += x;
res += sum;
sum = (sum-x > 0 ? -1 : 1);
}
cout <<... | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:19:1: error: extended character is not valid in an identifier
19 |
| ^
a.cc:27:1: error: extended character is not valid in... |
s462546681 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
/*
MOMMMMMOMOBMMMBMGMBMBMBMMMBM iivvYuVoqXPPENGGOGMMMOMOBMBkkqMOBGJuPkkVZBkiBBBMONNqEGOOMGOMMMMONoLrrrrrriiii BBMOGMGOOMOOOMOOOOOMMPjIFSXXBB irISVJkP
MMOMOMOMOMOMOMOMOGOMMMMMMMMBu irrLYYukkXSPqGGGZOGMGOGGSokOGOMSLVLuFGMBuJBBGGNNXqNGOOOMGMOONFYriiiiiiii iBMMGOOOGOGG... | cc1plus: error: '::main' must return 'int'
|
s419993970 | p03741 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
//* 便利な変数
namespace {
int dx4[] = { 1, -1, 0, 0 };
int dy4[] = { 0, 0, 1, -1 };
int dx8[] = { 1, -1, 0, 0, 1, 1,... | a.cc:162:7: error: extended character is not valid in an identifier
162 | sum = as[0];
| ^
a.cc: In function 'void arc072a::arc072a()':
a.cc:162:7: error: '\U00003000sum' was not declared in this scope
162 | sum = as[0];
| ^~~~~
|
s805326831 | p03741 | C++ | #include<iostream>
#include<string>
#include<cstring>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<set>
#include<map>
#include<vector>
#include<cstdio>
using namespace std;
int n;
long long a[120000];
int main()
{
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}
long long nowa=0;
long long sum=0;
for(i... | a.cc: In function 'int main()':
a.cc:47:8: error: no matching function for call to 'min(int&, long long int&)'
47 | ans=min(ans,nowa);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/... |
s907771962 | p03741 | C++ | #include<iostream>
#include<string>
#include<cstring>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<set>
#include<map>
#include<vector>
#include<cstdio>
using namespace std;
int n;
int a[120000];
int main()
{
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}
int nowa=0;
int sum=0;
for(int i=0;i<n;i++){
... | a.cc:50:2: error: stray '#' in program
50 | }#include<iostream>
| ^
a.cc:99:2: error: stray '#' in program
99 | }#include<iostream>
| ^
a.cc:148:2: error: stray '#' in program
148 | }#include<iostream>
| ^
a.cc:50:3: error: 'include' does not name a type
50 | }#include<iostream>
| ... |
s002815310 | p03741 | C++ | #include <iostream>
#define ll long long
using namespace std;
ll abs(ll x)
{
return x<0?-x:x;
}
int main()
{
ll n;
cin>>n;
ll a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
ll s1=0,s2=0,f=1,now1=0,now2=0;
for(int i=0;i<n;i++)
{
now1+=a[i];
now2+=a[i];
if(now1*f<=0) s1+=abs(f-now1),now1=f;
if(now2*f>=0)... | a.cc: In function 'int main()':
a.cc:24:38: error: call of overloaded 'abs(long long int)' is ambiguous
24 | if(now1*f<=0) s1+=abs(f-now1),now1=f;
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/... |
s717315345 | p03741 | C++ | #include <cstdio>
#include <iostream>
using namespace std;
int n,f[100005];
int did(int b,int t,int not)
{
int s=f[1],i;
for(i=2;i<=n;i++)
{
if(not!=1) scanf("%d",&f[i]);
b*=-1;
s+=f[i];
if(b==-1&&s>=0)
{
t+=(s+1);
s=-1;
}
else if(b==1&&s<=0)
{
t+=(1-s);
s=1;
}
}
return t;
}
i... | a.cc:7:25: error: expected ',' or '...' before 'not' token
7 | int did(int b,int t,int not)
| ^~~
a.cc: In function 'int did(int, int, int)':
a.cc:12:19: error: expected primary-expression before '!=' token
12 | if(not!=1) scanf("%d",&f[i]);
| ^~
|
s209702770 | p03741 | C++ | #include<iostream>
using namespace std;
int n;
int a[100001];
int t=0,a=0,a2=0;
int main()
{
cin>>n;
int l=-1;
for(int i=0;i<n;i++){
cin>>a[i];
t+=a[i];
if(t==0){
a1++;
if(l<0)
t=1;
else
t=-1;
}
else
if(t<0&&l<0){
a1+=1-t;
t=1;
}
else
if(t>0&&l>0){
a1+=t+1;
t=-1... | a.cc:5:9: error: conflicting declaration 'int a'
5 | int t=0,a=0,a2=0;
| ^
a.cc:4:5: note: previous declaration as 'int a [100001]'
4 | int a[100001];
| ^
a.cc: In function 'int main()':
a.cc:14:25: error: 'a1' was not declared in this scope; did you mean 'a2'?
14 | ... |
s279065162 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
const ll mod = 1e9 + 7;
const int INF = 1e9;
int main() {
cin.sync_with_stdio(false);
int n;
cin >> n;
ll sum = 0, ans1 =... | a.cc: In function 'int main()':
a.cc:39:66: error: expected ';' before '}' token
39 | else if (sum < 0){flag = false;ans1+=-sum+1;sum=1}
| ^
| ;
a.cc:62:60: er... |
s746459442 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
const ll mod = 1e9 + 7;
const int INF = 1e9;
int main() {
cin.sync_with_stdio(false);
int n;
cin >> n;
ll sum = 0, ans1 =... | a.cc: In function 'int main()':
a.cc:39:48: error: 'ans' was not declared in this scope; did you mean 'ans2'?
39 | else if (sum < 0){flag = false;ans+=-sum+1;sum=1}
| ^~~
| ans2
a.cc:39:65: error... |
s842978421 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
long long int a[100005]={0};
long long int solve(bool even){
long long int sum = 0, ans = 0;
for(int i=0;i<n;++i){
if(i == 0){
if(even){
long long int diff = (a[i] > 0 ? 0 : 1 - a[i]);
}else{
long long... | a.cc: In function 'long long int solve(bool)':
a.cc:8:19: error: 'n' was not declared in this scope
8 | for(int i=0;i<n;++i){
| ^
a.cc:15:27: error: 'diff' was not declared in this scope
15 | sum += a[i] + diff;
| ^~~~
|
s670052866 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int64;
int main()
{
int N, A[100000];
cin >> N;
for(int i = 0; i < N; i++) {
cin >> A[i];
}
// さいしょをマイナスにする!
int64 choku = 0, sum1 = 0;
for(int i = 0; i < N; i++) {
choku += A[i];
if(i % 2 == 0) {
sum1 += max(0, choku + ... | a.cc: In function 'int main()':
a.cc:21:18: error: no matching function for call to 'max(int, int64)'
21 | sum1 += max(0, choku + 1);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s929665325 | p03741 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
vector<int> a(n);
for(int i=0;i<n;i++)cin>>a[i];
long long int np=a[0];
long long int ans=0;
if(np==0){
np=1;
ans=1;
}
for(int i=1;i<n;i++){
if(np>0){
if(np+a[i]>=0){
ans+=abs((np+a[i])+1);
np=-1;
}else{
np+... | a.cc: In function 'int main()':
a.cc:39:31: error: expected ';' before '}' token
39 | ans2=np+a[0]-1
| ^
| ;
40 | }else{
| ~
a.cc:42:31: error: expected ';' before '}' token
42 | ... |
s648524172 | p03741 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
vector<int> a(n);
for(int i=0;i<n;i++)cin>>a[i];
long long int np=a[0];
long long int ans=0;
if(np==0){
np=1;
ans=1;
}
for(int i=1;i<n;i++){
if(np>0){
if(np+a[i]>=0){
ans+=abs((np+a[i])+1);
np=-1;
}else{
np+... | a.cc: In function 'int main()':
a.cc:39:22: error: expected ';' before ':' token
39 | np=-1:
| ^
| ;
|
s949046562 | p03741 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;
using static CS_Contest.Utils;
namespace CS_Contest {
using Li = List<int>;
using LLi = List<List<int>>;
class Program {
static void Main... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.L... |
s333071020 | p03741 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(void){
int n; cin >> n; ll a[n]; for(int i=0;i<n;i++) cin >> a[i];
ll ans[2];
for(int i=0;i<2;i++){
ll s = 0; ll ans[i] = 0;
for(int j=0;j<n;j++){
s += a[j];
if ((i+j)%2){
if (s<=0) {ans[i] += 1-s; s = 1;}
}else{
if (s... | a.cc: In function 'int main()':
a.cc:9:25: error: array must be initialized with a brace-enclosed initializer
9 | ll s = 0; ll ans[i] = 0;
| ^
|
s959562235 | p03741 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
__attribute__((constructor))
void initial() {
cin.tie(0);
ios::sync_with_stdio(false);
}
ll n, a[100000];
int aaa(ll ... | a.cc: In function 'int aaa(ll)':
a.cc:29:19: error: expected ';' before '}' token
29 | flag = !flag;a
| ^
| ;
30 | }
| ~
|
s690657145 | p03741 | C++ |
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
using namespace std;
#define ll long long
#define ld long do... | cc1plus: error: '::main' must return 'int'
|
s728632086 | p03741 | Java |
import java.util.Scanner;
public class Sequence {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[] num = new int[n];
for(int i = 0; i < n; i++){
num[i] = scanner.nextInt();
}
int countP = exe(n, num, 1);
int countM = exe(n, num, -1);... | Main.java:4: error: class Sequence is public, should be declared in a file named Sequence.java
public class Sequence {
^
1 error
|
s286336232 | p03741 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
public class A {
public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub
BufferedReader br = new Buffer... | Main.java:8: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s149489182 | p03741 | C | #include <stdio.h>
#include <stdlib.h>
int changeCount(int*, int);
int main(void){
/*
サイズnの入力
*/
int n;
if(scanf("%d\n", &n) < 1){
exit(1);
}
/*
a_1,a_2, ... a_nの入力
*/
int *a;
a = (int*) malloc ( n * sizeof(int));
int i;
for(i=0; i<n-1; i++){
if(scanf("%d ", &a[i]) < 1){ //scanfの戻り値は、成功した変数の数、もしくは-1... | main.c: In function 'changeCount':
main.c:49:28: error: 'n' undeclared (first use in this function)
49 | printf("n = %d\n", n);
| ^
main.c:49:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:54:13: error: 'i' undeclared (first ... |
s552758670 | p03741 | C | #include <stdio.h>
#include <stdlib.h>
int changeCount(int, int*, int);
int main(void){
/*
サイズnの入力
*/
int n;
if(scanf("%d\n", &n) < 1){
exit(1);
}
/*
a_1,a_2, ... a_nの入力
*/
int *a;
a = (int*) malloc ( n * sizeof(int));
int i;
for(i=0; i<n-1; i++){
if(scanf("%d ", &a[i]) < 1){ //scanfの戻り値は、成功した変数の数、も... | main.c: In function 'changeCount':
main.c:62:34: error: 's1' undeclared (first use in this function)
62 | sum[0] = s1;
| ^~
main.c:62:34: note: each undeclared identifier is reported only once for each function it appears in
|
s836265132 | p03741 | C | #include <stdio.h>
#include <stdlib.h>
int changeCount(int*, boolean);
int main(void){
/*
サイズnの入力
*/
int n;
if(scanf("%d\n", &n) < 1){
exit(1);
}
/*
a_1,a_2, ... a_nの入力
*/
int *a;
a = (int*) malloc ( n * sizeof(int));
int i;
for(i=0; i<n-1; i++){
if(scanf("%d ", &a[i]) < 1){ //scanfの戻り値は、成功した変数の数、もし... | main.c:4:23: error: unknown type name 'boolean'
4 | int changeCount(int*, boolean);
| ^~~~~~~
main.c: In function 'main':
main.c:32:31: error: implicit declaration of function 'changeCount' [-Wimplicit-function-declaration]
32 | int evenchangeCount = changeCount(a, false); //何... |
s501123993 | p03741 | C++ | package main
import (
"fmt"
"math"
)
func main() {
var n int64
fmt.Scan(&n)
var counter1, counter2 int64 = 0, 0
var total1, total2 int64 = 0, 0
var a int64
for i := 0; i < int(n); i++ {
fmt.Scan(&a)
total1 += a
total2 += a
if i%2 == 0 {
if total1 <= 0 {
counter1 += int64(math.Abs(float64(tota... | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
|
s258428679 | p03741 | C++ | #include<iostream>
using namespace std;
int main (){
int n,m;
cin>>n>>m;
if(n>m){int k=n;n=m;m=k;}
if((m-n)>2)cout<<Alice<<endl;
else cout<<Brown<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:18: error: 'Alice' was not declared in this scope
8 | if((m-n)>2)cout<<Alice<<endl;
| ^~~~~
a.cc:9:12: error: 'Brown' was not declared in this scope
9 | else cout<<Brown<<endl;
| ^~~~~
|
s873858227 | p03741 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
long long work(vector<int> &num, bool flag) {
long long sum = 0, count = 0;
for (int i = 0; i < num.size(); ++i) {
sum += num[i];
if (i % 2 == flag) {
if (sum <= 0) {
count += 1 - sum;
sum = 1;
}
} else {
if (sum >= ... | a.cc: In function 'int main()':
a.cc:37:26: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>'
37 | cout << min(work(num, true), work(num, false)) << endl;
| ^~~
a.cc:7:29: note: in passing argument 1 of '... |
s303565241 | p03741 | C++ | #include<bits/stdc++.h>
#define nmax 100001
using namespace std;
int n,i;
long long x,cur[nmax],ans;
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
cin>>n;
for(i=1;i<=n;i++)
{
cin>>x;
cur[i]=cur[i-1]+x;
if(i>1 && cur[i]<0 && cur[i-1]<0)ans+=abs(cur[i]-1),cur[i]=1;
else if(... | a.cc: In function 'int main()':
a.cc:16:25: error: 'a' was not declared in this scope
16 | else if(a!cur[i])ans++,cur[i]=1;
| ^
a.cc:16:26: error: expected ')' before '!' token
16 | else if(a!cur[i])ans++,cur[i]=1;
| ~ ^
... |
s345651718 | p03741 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <map>
#include <cstring>
using namespace std;
int main()
{
//freopen("input.in", "r", stdin);
int n;
while(scanf("%d", &n)!=EOF){
int sum=0, res=0;
vector<int> nums(n, 0);
for(int i=0;i<n;i++){
... | a.cc: In function 'int main()':
a.cc:15:9: error: 'vector' was not declared in this scope
15 | vector<int> nums(n, 0);
| ^~~~~~
a.cc:7:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
6 | #include <cstring>
+++ |+#include <vect... |
s329975140 | p03741 | C++ | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Main main = new Main();
main.solveC();
}
private void solveC() {
Scanner sc = new Scanner(System.in);
long n = sc.nextInt();
List<Long> list = new ArrayList<Long>();
f... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.ArrayList;
| ^~~~~~
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.util.List;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s636815913 | p03741 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#define rep(i,a) for(int i=0;i<a;i++)
#define nrep(i,a,b) for(int i=a;i<b;i++)
#define INF 1145141919810
#define ll long long
using namespace std;
int main(){
ll n; cin>>n;
vector<ll> a(n);
rep(i,n) cin>>a[i];
ll sum=0;
ll an... | a.cc: In function 'int main()':
a.cc:32:6: error: 'fla' was not declared in this scope; did you mean 'flag'?
32 | }fla=false;
| ^~~
| flag
|
s802998799 | p03741 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s371520891 | p03741 | C++ | #include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#define rep(i,a) for(int i=0;i<a;i++)
#define nrep(i,a,b) for(int i=a;i<b;i++)
#define INF 1145141919810
#define ll long long
using namespace std;
ll solv(const vector<ll> &a,bool flag){
ll ret=0,sum=0;
rep(i,n){
... | a.cc: In function 'long long int solv(const std::vector<long long int>&, bool)':
a.cc:14:11: error: 'n' was not declared in this scope
14 | rep(i,n){
| ^
a.cc:6:32: note: in definition of macro 'rep'
6 | #define rep(i,a) for(int i=0;i<a;i++)
| ^
|
s254802659 | p03741 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int nmax = 100010; const LL mod = 31007;
int N;
LL a[nmax],ans,s1,s2,s,x;
inline void Solve(){
int i,j,sgn;
cin >> N;
for(i = 1; i <= N; ++i)
cin >> a[i];
if(!a[1]){
sgn=s1=s=1;
for(i = 2; i <= N; ++i){
... | a.cc: In function 'void Solve()':
a.cc:21:21: error: expected ';' before 'if'
21 | x = -1-s
| ^
| ;
22 | if(a[i] <= x){s+=a[i];sgn*=-1;continue;}
| ~~
a.cc:29:23: error: expected ';' before 'if'
29 | ... |
s879718946 | p03741 | C++ | #include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#define rep(i,a) for(int i=0;i<a;i++)
#define nrep(i,a,b) for(int i=a;i<b;i++)
#define INF 1145141919810
#define ll long long
using namespace std;
ll solv(const vector<ll> &a,bool flag){
ll ret=0,sum=0;
rep(i,n){
... | a.cc: In function 'long long int solv(const std::vector<long long int>&, bool)':
a.cc:14:11: error: 'n' was not declared in this scope
14 | rep(i,n){
| ^
a.cc:6:32: note: in definition of macro 'rep'
6 | #define rep(i,a) for(int i=0;i<a;i++)
| ^
a.cc:18:17... |
s180620074 | p03741 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int n,D;
cin>>n>>D;
vector<long long int> d(n);
for(int i=0;i<n;i++){
cin>>d[i];
}
int q;
cin>>q;
vector<long long int> dis(n);
dis[0]=D;
for(int i=1;i<n;i++){
dis[i]=min(dis[i-1],abs(dis[i-1]-d[i-1]));
}
for(int i=0... | a.cc: In function 'int main()':
a.cc:27:12: error: no matching function for call to 'min(const long long int&, int&)'
27 | k=min(max(k-d[i],d[i]/2),k);
| ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.