submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s003621873 | p03807 | Java | package test;
import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine();
int[] a = new int[n];
int oddOfSum = 0;
for (int i=0;i<n;i++){
a[i] = sc.nextInt();
if (a[i]%2==1){
oddOfSum++;
}
... | Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s142134937 | p03807 | C++ | import java.util.Scanner;
/**
* Created by wenjian on 2017/2/4.
*/
public class Main{
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
int n = reader.nextInt();
int[] a = new int[n];
for (int i=0; i<a.length; ++i) a[i] = reader.nextInt();
i... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
6 | public class Main{
| ^~~~~~
|
s619674216 | p03807 | Java | public class Main {
public static void main(String[] args) {
try (Scanner in = new Scanner(System.in)) {
solve(in);
}
}
private static void solve(Scanner in) {
int N = in.nextInt();
final int[] A = new int[N];// 2 <= N
for (int i = 0; i < N; i++) {
... | Main.java:8: error: cannot find symbol
private static void solve(Scanner in) {
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
try (Scanner in = new Scanner(System.in)) {
^
symbol: class Scanner
location: class Main
M... |
s763380418 | p03807 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int count=0;
int temp;
cin >> n;
for(i=0;i<n;i++){
cin >> temp;
if(temp%2==1){
count++;}
}
if(count%2==1)
cout << "NO";
else
cout <<"YES";
return 0;
} | a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
8 | for(i=0;i<n;i++){
| ^
|
s354658962 | p03807 | C++ | #include <iostream>
#include <time.h>
#include <vector>
#include <stdio.h>
#include <memory.h>
#include <string>
#include <map>
#include <algorithm>
#include <bitset>
#include <queue>
#include <set>
#include <time.h>
#include <assert.h>
#include <sstream>
//#include <unordered_map>
#include <bitset>
#include <utility>... | a.cc:30:10: fatal error: inc.h: No such file or directory
30 | #include "inc.h"
| ^~~~~~~
compilation terminated.
|
s520698822 | p03807 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef __int64 LL;
typedef vector<int> ivec;
typedef vector<string> svec;
int n;
int a[100010];
int ... | a.cc:13:9: error: '__int64' does not name a type; did you mean '__int64_t'?
13 | typedef __int64 LL;
| ^~~~~~~
| __int64_t
|
s353427337 | p03807 | C++ | #include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
const int mod=1000000000+7;
int addm(int& a,int b) {return (a+=b)<mod?a:a-=mod;}
template<... | a.cc: In function 'int main()':
a.cc:36:28: error: expected ';' before '}' token
36 | else cout << "NO\n"
| ^
| ;
37 | }
| ~
|
s363372188 | p03807 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 0; i < N; ++ i) {
int x;
cin >> x;
if (x % 2) ++ c;
}
cout << (c % 2 == 0 ? "YES" : "NO") << endl;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 0; ... | a.cc:16:5: error: redefinition of 'int main()'
16 | int main() {
| ^~~~
a.cc:3:5: note: 'int main()' previously defined here
3 | int main() {
| ^~~~
|
s079699405 | p03807 | C++ | n = input()
a = sum(map(int, raw_input().split())) & 1
print 'YES' if a == 1 else 'NO'
| a.cc:3:7: warning: multi-character character constant [-Wmultichar]
3 | print 'YES' if a == 1 else 'NO'
| ^~~~~
a.cc:3:28: warning: multi-character character constant [-Wmultichar]
3 | print 'YES' if a == 1 else 'NO'
| ^~~~
a.cc:1:1: error: 'n' does not name a type
... |
s734057491 | p03807 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 0; i < N; ++ i) {
int x;
cin >> x;
if (x % 2) ++ c;
}
cout << (c % 2 == 0 ? "YES" : "NO") << endl;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 0; ... | a.cc:16:5: error: redefinition of 'int main()'
16 | int main() {
| ^~~~
a.cc:3:5: note: 'int main()' previously defined here
3 | int main() {
| ^~~~
|
s174527267 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
vector<long long> a(n);
long long sum=0;
for ( int i=0; i<n; i++ ) {
cin >> a[i];
sum+=a[i];
}
long long m=(long long)n*(n+1)/2;
if ( m%n ){
cout << "NO" << '\n';
return 0;
... | a.cc: In function 'int main()':
a.cc:30:5: error: 'else' without a previous 'if'
30 | else cout << "YES" << '\n';
| ^~~~
|
s272083855 | p03808 | C++ | #include<bits/stdc++.h>
using namespace std;
#pragma region Macros
#define ll long long
#define ld long double
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)... | a.cc: In function 'int main()':
a.cc:95:85: error: expected ')' before ';' token
95 | REP(i, n) fin((s + a[i] - a[i + 1]) % n or ((s + a[i] - a[i + 1]) / n < 0, "NO");
| ~ ^
| ... |
s746016715 | p03808 | C++ | #include <iostream>
#define ll long long
using namespace std;
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int check=0;
ll n, sum = 0, k=0;
int stones[100005], diff[100005];
cin >> n;
for(int i=1; i<=n; i++){
cin >> stones[i];
sum+=stones[i];
}... | a.cc: In function 'int main()':
a.cc:30:40: error: expected primary-expression before '=' token
30 | if(x>=0 && x%n==0 && (k-x>==0) && (k-x%n==0)){
| ^
|
s293688881 | p03808 | C++ | /**
____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N_MAX = 100002;
int n;
int a[N_MAX];
ll sum;
ll k;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);... | a.cc:65:11: error: redefinition of 'const int N_MAX'
65 | const int N_MAX = 100002;
| ^~~~~
a.cc:15:11: note: 'const int N_MAX' previously defined here
15 | const int N_MAX = 100002;
| ^~~~~
a.cc:67:5: error: redefinition of 'int n'
67 | int n;
| ^
a.cc:17:5: note: 'in... |
s404787040 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string _... | a.cc:47:21: warning: missing terminating " character
47 | out("YES);
| ^
a.cc:47:21: error: missing terminating " character
47 | out("YES);
| ^~~~~~
a.cc: In function 'void solve()':
a.cc:51:9: error: expected primary-expression b... |
s909038135 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string _... | a.cc: In function 'void solve()':
a.cc:45:45: error: 'retrun' was not declared in this scope
45 | if(tmp1<0 or tmp1%n)retrun out("No");
| ^~~~~~
|
s395255862 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
#define eb(t) emplace_back(t)
typedef long long ll;
typedef long long unsigned int llu;
ll INF = 1000000009;
ll MOD = 1000000007;
ll a[100010];
ll d[100010];
void solve(){
ll n;
cin >> n;
ll sum=0;
rep(i,n){
... | a.cc: In function 'void solve()':
a.cc:34:26: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
34 | cout << b?"YES":"NO" << endl;
| ~~~~~^~~~~~~
|
s594082801 | p03808 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define ll long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w"... | cc1plus: error: '::main' must return 'int'
|
s702620504 | p03808 | C++ | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main() {
ll N;
cin >> N;
vector<ll> A(N), D(N);
ll t = 0;
for (int i = 0; i < N; i++) {
cin >> A.at(i);
t += A.at(i);
}
ll u = N * (N+1) / 2;
if (t % u != 0) {
return cout << "NO" << '\n', 0;
ll m = t / u;
... | a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s392342640 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
signed main(){
ll n;
cin >> n;
ll sum = 0;
ll... | a.cc: In function 'int main()':
a.cc:35:20: error: expected ';' before '}' token
35 | sum -= d[i]
| ^
| ;
36 | }
| ~
|
s260003173 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
signed main(){
ll n;
cin >> n;
ll sum = 0;
l... | a.cc: In function 'int main()':
a.cc:33:14: error: expected '}' at end of input
33 | return 0;
| ^
a.cc:11:14: note: to match this '{'
11 | signed main(){
| ^
|
s881707600 | p03808 | C++ | #include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);
using namespace std;
int main(void){
cin.tie(0);
ios::sync_with_stdio(false)... | a.cc: In function 'int main()':
a.cc:38:27: error: expected ';' before ')' token
38 | }else cnt += -D[i])/N;
| ^
| ;
|
s728048736 | p03808 | C | #pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) <... | main.c:4:9: fatal error: cstdio: No such file or directory
4 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s213597156 | p03808 | C++ | #include<bits/stdc++.h>
using namespace std;
#define RI register int
int read() {
int q=0;char ch=' ';
while(ch<'0'||ch>'9') ch=getchar();
while(ch>='0'&&ch<='9') q=q*10+ch-'0',ch=getchar();
return q;
}
typedef long long LL;
const int N=100005;
LL sum,nowadd,nows,a[N],orz[N],m;int n;
int work() {
in... | a.cc: In function 'int work()':
a.cc:15:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
15 | for(RI i=0;i<n;++i) {
| ^
a.cc:21:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
21 | for(RI i=0;i<n;++i) {
| ... |
s119670564 | p03808 | C++ | #include<bits/stdc++.h>
using namespace std;
#define RI register int
int read() {
int q=0;char ch=' ';
while(ch<'0'||ch>'9') ch=getchar();
while(ch>='0'&&ch<='9') q=q*10+ch-'0',ch=getchar();
return q;
}
typedef long long LL;
const int N=100005;
LL sum,nowadd,nows,a[N],orz[N],m;int n;
int work() {
in... | a.cc: In function 'int work()':
a.cc:15:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
15 | for(RI i=0;i<n;++i) {
| ^
a.cc:21:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
21 | for(RI i=0;i<n;++i) {
| ... |
s856250094 | p03808 | C++ | #include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#include <time.h>
#pragma warning(disable:4996)
typedef long lon... | a.cc: In function 'int main(int, char**)':
a.cc:63:22: error: 'm' was not declared in this scope; did you mean 'mm'?
63 | if(tmp>=0 && tmp%m==0) {
| ^
| mm
|
s813710388 | p03808 | C++ | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> boo... | a.cc: In function 'void Main()':
a.cc:37:41: error: expected primary-expression before 'return'
37 | if(sum%itido!=0) cout<< "NO"<<"\n", return;
| ^~~~~~
a.cc:38:101: error: expected primary-expression before 'return'
38 | rep(i,N) if((sum/itido-A[(i+1)%N]-A[i... |
s324016361 | p03808 | C | #pragma GCC optimize("Ofast")
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
using namespace std;
#define INF 1LL<<62
#define MAX 100000
#define MOD 100000... | main.c:2:9: fatal error: cstdio: No such file or directory
2 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s502630092 | p03808 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s373403385 | p03808 | C++ | #include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using ll = long long;
int main() {
ll N;
cin >> N;
vector<ll> A(N + 1)
ll Asum = 0;
rep(i, N) {
cin >> A[i];
Asum += A[i];
}
A[N] = A[0];
if (Asum % (N * (N + 1) / 2) != 0) {
cou... | a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'll'
11 | ll Asum = 0;
| ^~
a.cc:14:9: error: 'Asum' was not declared in this scope
14 | Asum += A[i];
| ^~~~
a.cc:17:9: error: 'Asum' was not declared in this scope
17 | if (Asum % (N * (N + 1)... |
s940825243 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
long long a[100005], sum=0, d, diff, x;
bool flag = 1;
scanf("%d", &n);
if(n%2 == 0) d = n/2LL * (n+1LL);
else d = (n+1LL)/2LL * n;
for(int i=0; i<n; i++) {
scanf("%lld", &a[i]);
sum += a[i];
}
if(sum%d == 0) printf("YES\n");
else {
x = s... | a.cc: In function 'int main()':
a.cc:27:18: error: expected '}' at end of input
27 | return 0;
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s412165914 | p03808 | C++ | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long ... | a.cc: In lambda function:
a.cc:45:41: error: expected primary-expression before '<' token
45 | if (operationNum - diff[i]) < 0)
| ^
|
s263319105 | p03808 | C++ | #include <iostream>
#include <string>
#include <utility>
#include <stack>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <climits>
#include <set>
#include <cmath>
using namespace std;
long long A[100000];
long long diff_A[100000];
long long x[100000];
long long y[100000];
int main(){
... | a.cc: In function 'int main()':
a.cc:30:23: error: 'accumulate' was not declared in this scope
30 | long long sum_A = accumulate(A, A + N, (long long) 0);
| ^~~~~~~~~~
|
s307315795 | p03808 | C++ | //#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>
#include<bitset>
#include <iomanip>
using namespace std;
#define modd 1000000007
typedef pair<long long... | a.cc: In function 'int main()':
a.cc:161:9: error: 'else' without a previous 'if'
161 | else if (b >= a / c) {
| ^~~~
|
s095387259 | p03808 | C++ | #include <bits/stdc++.h>
int main() {
cout<<"NO"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
5 | cout<<"NO"<<endl;
| ^~~~
| std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/... |
s800014838 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int min=1000000001;
int minum=0;
int A[N];
for(int i=0;i<N;i++){
cin >> A[i];
}
while(true){
for(int i=0;i<N;i++){
if(A[i]>min){
min=A[i];
minum=i;
}
}
if(min==0){
cout << "YES... | a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s601151158 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll N;
cin>>N;
vector<ll> A(N);
ll S=0;
for(int i=0;i<N;i++){
cin>>A[i];
S+=A[i];
}
if(S%(N*(N+1)/2)){
cout<<"NO"<<endl;
return 0;
}
S/=(N*(N+1)/2);
ll cnt=0;
for(int i=0;i<N;i++){
//t回のうちk回、iを選んだとする。... | a.cc: In function 'int main()':
a.cc:27:10: error: 't' was not declared in this scope
27 | ll c=t-(b-a);
| ^
|
s595228740 | p03808 | C++ | /*
_ _ _ _ _ _ _ _ _ _ _
/ /\ / /\ / /\ / /\ / /\ /\ \ /\_\/\_\ _ /\ \ /\ \ _ /\ \
/ / \ / / \ / / \ / / / / / ... | a.cc: In function 'int main()':
a.cc:59:32: error: expected ';' before '{' token
59 | if((times-diff[i] % N != 0){
| ^
| ;
a.cc:63:31: error: expected ')' before ';' token
63 | cnt += (times-diff[i]) / N;
| ... |
s153990611 | p03808 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
int main(){
int n;
cin >> n;
long long a[n];
long long sum = 0;
... | a.cc: In function 'int main()':
a.cc:29:73: error: expected primary-expression before '>=' token
29 | if(((a[(i+1)%n] - a[i])-t)%n != 0 || (a[(i+1)%n] - a[i])-t) >= 0){
| ^~
|
s048641915 | p03808 | C++ | #include <stdio.h>
#include <iostream>
#include <vector>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define vecll vector<ll>
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
string strin(){string s;cin>>s;return s;}
bool func(ll n){
ll sum=0,cn... | a.cc: In function 'int main()':
a.cc:26:39: error: expected ')' before ';' token
26 | string ans=func((lin())?"YES":"NO";
| ~ ^
| )
|
s178339052 | p03808 | C++ | #include <iostream>
#include <vector>
using namespace std;
bool solve(long long N, const vector<long long> &a) {
long long S = 0;
for (int i = 0; i < N; ++i) S += a[i];
if (S % (N * (N+1)/2) != 0) return false;
long long num = S / (N * (N+1)/2);
for (int i = 0; i < N; ++i) {
b[i] = a[i] - a... | a.cc: In function 'bool solve(long long int, const std::vector<long long int>&)':
a.cc:11:9: error: 'b' was not declared in this scope
11 | b[i] = a[i] - a[(i-1+N)%N];
| ^
|
s654134647 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin >> n;
long long a[100010];
long long so = 0;
for(int i = 0;i < n;i++){
cin >> a[i];
so += a[i];
}
long long wa = 0;
for(int i = 0;i < n;i++){
wa += a[(i+1)%n] - a[i];
}
if(wa == ... | a.cc: In function 'int main()':
a.cc:25:14: error: expected '}' at end of input
25 | return 0;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s099605317 | p03808 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
#include <numeric>
#include<stdio.h>
#include <queue>
#include <iomanip>
#include <float.h>
#include <set>
#include<functional>
#include <stack>
#include <tim... | a.cc: In function 'int main()':
a.cc:148:1: error: jump to label 'owari'
148 | owari:
| ^~~~~
a.cc:135:34: note: from here
135 | ans = "NO"; goto owari;
| ^~~~~
a.cc:137:19: note: crosses initialization of 'long long int ima'
137 | long long... |
s066189250 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)
const ll MOD = 1000000007;
const ll INF = (ll)1e15;
ll A[100005];
ll B[100005];
ll C[100005];
... | a.cc: In function 'int main()':
a.cc:7:22: error: expected ',' or ';' before 'for'
7 | #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
| ^~~
a.cc:8:19: note: in expansion of macro 'FOR'
8 | #define REP(i, n) FOR(i, n, 0)
| ^~~
a.cc:27:16: note: in expa... |
s502706361 | p03808 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
u... | a.cc: In function 'int main()':
a.cc:38:5: error: expected ',' or ';' before 'for'
38 | for(int i=0;i<n;i++){
| ^~~
a.cc:38:17: error: 'i' was not declared in this scope
38 | for(int i=0;i<n;i++){
| ^
|
s627882098 | p03808 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define pb push_back
#define pob pop_back
#define mp make_pair
#define fi first
#define se second
#define endl '\n'
#define Ptest(x) return cout << x << endl, 0;
typedef vector <int> vi;
typedef pair <int, int> ii;
typedef v... | a.cc: In function 'int main()':
a.cc:29:16: error: 'a' was not declared in this scope
29 | cin >> a[i];
| ^
a.cc:35:5: error: 'k' was not declared in this scope
35 | k = sum / m;
| ^
a.cc:37:9: error: 'd' was not declared in this scope
37 | d = a[(i + 1) % n] ... |
s284241739 | p03808 | C | #include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define llong long long
#define fr(i,l,r) for(i=(l);i<(r);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
int main(void)
{
//変数の宣言
long long int n;
long long int a[100010];
long long int sum;
//よく使う変数
int i... | main.c: In function 'main':
main.c:58:63: error: expected ')' before 'n'
58 | if((temp+a[i]-a[i+1])%n!=0&&(temp+a[i]-a[i+1])n<0){
| ~ ^
| )
|
s445818909 | p03808 | C++ | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
typedef long long ll;
bool solve(const int n, const vector<int> & in){
ll sum = accumulate(in.begin(), in.end(), 0LL);
if (sum % ((static_cast<long long>(n) * static_cast<long long>(n+1))/2)
!= 0){
return false;
}
ll k =... | a.cc: In function 'bool solve(int, const std::vector<int>&)':
a.cc:24:14: error: expected ';' before '}' token
24 | return true
| ^
| ;
25 | }
| ~
|
s636616473 | p03808 | C++ | // Why am I so dumb? :c
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
const int MAXN = (int)1e5 + 5;
int arr[MAXN];
int n;
void solve() {
scanf("%d", &n);
ll subt = n ... | a.cc: In function 'void solve()':
a.cc:43:17: error: redeclaration of 'll subt'
43 | ll sum = 0, subt = n * (n + 1ll) / 2;
| ^~~~
a.cc:24:8: note: 'll subt' previously declared here
24 | ll subt = n * (n + 1ll) / 2;
| ^~~~
|
s454956830 | p03808 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 1e5;
int N;
ll a[MAX_N+5];
int main(){
cin >> N;
for(int i=0;i<N;i++) cin >> a[i];
bool flg = true;
if(N==1 && a[0] != 1) flg = false;
ll sum = 0, p = N * (N+1) / 2, sy = 0, m;
for(int i=0;i<N;i++) sum += a[... | a.cc: In function 'int main()':
a.cc:25:32: error: expected primary-expression before '||' token
25 | if((m-d)%N || m < d || || m<(m-d)/N) flg = false;
| ^~
|
s604525324 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
long sum = accumulate(a, a + n, 0);
long div = n * (n + 1) / 2;
if (sum % div != 0) {
cout << "NO\n";
return 0;
}
long k = sum / div;
long b[n];
... | a.cc: In function 'int main()':
a.cc:26:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
26 | cnt += (b[i] - k) / -n;
| ^~~
| int
a.cc:32:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
32 ... |
s913705575 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[n];
int n,sousa;
bool check2(){
int ma = 0, mi = 1e9;
for(int i = 0; i < n; i++){
ma = max(ma, a[i]);
mi = min(mi, a[i]);
}
if(ma > sousa * n || mi < sousa)return false;
else return true;
}
int main() {
cin >> n;
for (int i = 0;... | a.cc:4:7: error: 'n' was not declared in this scope; did you mean 'yn'?
4 | int a[n];
| ^
| yn
a.cc: In function 'bool check2()':
a.cc:9:22: error: 'a' was not declared in this scope
9 | ma = max(ma, a[i]);
| ^
a.cc: In function 'int main()':
a.cc:19:24... |
s083695979 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[n];
int n;
bool check2(){
int ma = 0, mi = 1e9;
for(int i = 0; i < n; i++){
ma = max(ma, a[i]);
mi = min(mi, a[i]);
}
if(ma > sousa * n || mi < sousa)return false;
else return true;
}
int main() {
cin >> n;
for (int i = 0; i < n... | a.cc:4:7: error: 'n' was not declared in this scope; did you mean 'yn'?
4 | int a[n];
| ^
| yn
a.cc: In function 'bool check2()':
a.cc:9:22: error: 'a' was not declared in this scope
9 | ma = max(ma, a[i]);
| ^
a.cc:12:13: error: 'sousa' was not declare... |
s961992957 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[n];
int n;
bool check2(){
ll ma = 0, mi = 1e18;
for(int i = 0; i < n; i++){
ma = max(ma, a[i]);
mi = min(mi, a[i]);
}
if(ma > sousa * n || mi < sousa)return false;
else return true;
}
int main() {
cin >> n;
for (int i = 0; i < n... | a.cc:4:7: error: 'n' was not declared in this scope; did you mean 'yn'?
4 | int a[n];
| ^
| yn
a.cc: In function 'bool check2()':
a.cc:7:5: error: 'll' was not declared in this scope
7 | ll ma = 0, mi = 1e18;
| ^~
a.cc:9:9: error: 'ma' was not declared in this scope; did yo... |
s181533915 | p03808 | C++ | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
//-------------------------↓↓↓↓↓↓------------------------
ll n, a[100002], sousa;
bool check1(){
ll sum = 0, summ = 0;
for(int i = 0; i < n; i++){
sum += a[i];
summ += (i + 1);
}
sousa = sum / summ;
if(sum % s... | a.cc: In function 'int main()':
a.cc:60:18: error: 'Cout' was not declared in this scope
60 | if(n == 1)Cout("YES");
| ^~~~
|
s240313487 | p03808 | C++ | #include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(int)(a); i!=(int)(b); i++)
#define RFOR(i, a, b) for(int i=(int)(a); i!=(int)(b); i--)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
using ll = long long;
int main(){
lln; cin >> n;
ll a[n], sum = 0;
REP(i, n){
cin >> a[i];
sum += a[i];
}
... | a.cc: In function 'int main()':
a.cc:9:3: error: 'lln' was not declared in this scope; did you mean 'll'?
9 | lln; cin >> n;
| ^~~
| ll
a.cc:9:15: error: 'n' was not declared in this scope; did you mean 'yn'?
9 | lln; cin >> n;
| ^
| yn
a.cc:12:12: err... |
s591588412 | p03808 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[n+1];
for (int i=0; i<n; i++){
cin >> a[i];
}
a[n]=a[0];
int d[n];
for (int i=0, i<n; i++){
d[i]=a[i+1]-a[i];
}
int k=n*(n+1)/2;
for (int i=0; i<n; i++){
if (d[i]>k || (k-d[i]... | a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before '<' token
12 | for (int i=0, i<n; i++){
| ^
| ;
a.cc:12:20: error: expected primary-expression before '<' token
|
s514702808 | p03808 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[n+1]
for (int i=0; i<n; i++){
cin >> a[i];
}
a[n]=a[0];
int d[n];
for (int i=0, i<n; i++){
d[i]=a[i+1]-a[i];
}
int k=n*(n+1)/2;
for (int i=0; i<n; i++){
if (d[i]>k || (k-d[i])... | a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'for'
7 | for (int i=0; i<n; i++){
| ^~~
a.cc:7:19: error: 'i' was not declared in this scope
7 | for (int i=0; i<n; i++){
| ^
a.cc:10:5: error: 'a' was not declared in this scope
10 | a... |
s431722576 | p03808 | C++ | #include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define int long long
#defi... | a.cc: In function 'int main()':
a.cc:45:38: error: 'diff' was not declared in this scope; did you mean 'dif'?
45 | if((s - dif) % N != 0 || s < diff){
| ^~~~
| dif
|
s222955109 | p03808 | C++ | #include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
ll int MOD=998244353;
#define N 3000000
using n... | a.cc:16:11: warning: missing terminating " character
16 | cout<<"NO;
| ^
a.cc:16:11: error: missing terminating " character
16 | cout<<"NO;
| ^~~~
a.cc:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
15 | main(){
| ^~~~
a.cc: In fu... |
s686634106 | p03808 | C++ | #include <bits/stdc++.h>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int,int>
#define MA make_pair
#define LLI long long int
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout... | a.cc: In function 'int main()':
a.cc:8:13: error: expected initializer before 'long'
8 | #define LLI long long int
| ^~~~
a.cc:24:5: note: in expansion of macro 'LLI'
24 | LLI sum=0;
| ^~~
a.cc:26:14: error: 'a' was not declared in this scope
26 | cin>>a[i];
| ... |
s904393454 | p03808 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
typedef long long int ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<signed(n);i++)
#define EREP... | a.cc: In function 'int main()':
a.cc:58:35: error: lvalue required as left operand of assignment
58 | else if(B[(i+1)%N]-B[i]!=0&&B[(i+1)%N]-B[i]=!N)f=false;
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
|
s769708828 | p03808 | C++ | #include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
struct pp{ll x,y;};
const... | a.cc: In function 'int main()':
a.cc:72:6: error: expected primary-expression before ')' token
72 | })
| ^
a.cc:74:32: error: 'x' was not declared in this scope
74 | for(ll i=0;i<n;i++)if(a[i]<x){
| ^
a.cc:80:24: error: 'x' was not declared in this scope
... |
s506882401 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
ll n, sum a[10001];
int main () {
cin >> n;
for (int i = 1; i <= n; i ++) cin >> a[i], sum += a[i];
if (sum % (n * (n + 1) / 2) != 0) cout << "NO", exit (0);
sum /= (n * (n + 1) / 2);
a[n + 1] = a[1];
for (int i = 1; i <= n; i ++) {
if (a[i + 1] - a[i] - sum > 0 ... | a.cc:5:1: error: 'll' does not name a type
5 | ll n, sum a[10001];
| ^~
a.cc: In function 'int main()':
a.cc:8:16: error: 'n' was not declared in this scope; did you mean 'yn'?
8 | cin >> n;
| ^
| yn
a.cc:9:46: error: 'a' was not declared in this scope
... |
s648787863 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int main() {
int n;
cin >> n;
ll sum = 0;
vector<ll> a(n),d(n);
for(int i = 0; i < n; i++){
cin >> a[i];
sum += a[i];
}
ll k;
if(sum % ((ll)n*(n+1)/2)==0){
k = sum / (... | a.cc: In function 'int main()':
a.cc:26:19: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
26 | d[i] = max(a[i] - a[(i+1)%n] + k,0);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/... |
s078169890 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int main() {
ll n;
cin >> n;
ll sum = 0;
vector<ll> a(n),d(n);
for(int i = 0; i < n; i++){
cin >> a[i];
sum += (ll)a[i];
}
ll k;
if((sum % (n*(n+1)/2))==0){
k = sum / ... | a.cc: In function 'int main()':
a.cc:18:30: error: expected ';' before ')' token
18 | k = sum / (n*(n+1)/2));
| ^
| ;
|
s193375452 | p03808 | C++ | #include<bits/stdc++.h>
#define N 100050
#define INF 0x3fff
#define ll long long
using namespace std;
ll n,a[N+5],sum=0;
int main()
{
int maxx = 0,t;
scanf("%lld",&n);
for(int i=1; i<=n; i++)
{
scanf("%lld",&a[i]);
if(a[i]>maxx) {
maxx = a[i];
t = i;
}
... | a.cc: In function 'int main()':
a.cc:20:16: error: redeclaration of 'int t'
20 | int flag=1,t,m;
| ^
a.cc:9:18: note: 'int t' previously declared here
9 | int maxx = 0,t;
| ^
|
s283759135 | p03808 | C++ | #include<iostream>
#include<algorithm>
#define LL long long
int N;
int A[100010];
LL sum;
int main() {
std::cin >> N;
for (int i = 1; i <= N; i++) {
scanf_s("%d",&A[i]);
sum += A[i];
if (i == 0)A[0] = A[N];
}
LL D = ((N + 1)*N) / 2;
if (sum%D) {
printf("%s\n", "NO");
return 0;
}
int ave = sum / D;
fo... | a.cc: In function 'int main()':
a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
11 | scanf_s("%d",&A[i]);
| ^~~~~~~
| scanf
|
s658733421 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,a) for(int i=0;i<(a);i++)
#define MOD 1000000007
int main(){
int N;
cin>>N;
ll a[N];
ll sum=0;
for(int i=0;i<N;i++){
cin>>a[i];
sum+=a[i];
}
ll x=N*(N+1)/2,k=sum/x;
bool flag=(sum%x... | a.cc: In function 'int main()':
a.cc:22:11: error: expected primary-expression before '=' token
22 | flag&&=(d<=0&&d%N==0);
| ^
|
s944115038 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
long long a[400001];
long long d[400001];
int main () {
long long n, k = 0, c, ok = 0;
cin >> n;
for (int i = 1;i <= n;i ++) {
cin >> a[i];
k += a[i];
}
if (k % (n * (n + 1) / 2)) {
cout << "NO";
return 0;
}
... | a.cc: In function 'int main()':
a.cc:25:47: error: expected ';' before 'cout'
25 | ok += (abs (d[i]) / n)
| ^
| ;
26 | cout << "NO";
| ... |
s494945365 | p03808 | C++ | #include <iostream>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
int n,i,j
long long tt=0;
long long sum=0,a[100001],dis;
cin >> n;
for (i=1;i<=n;i++)
{
cin >> a[i];
sum += a[i];
tt += i;
}
if ( sum%tt!=0)
{
co... | a.cc: In function 'int main()':
a.cc:10:5: error: expected initializer before 'long'
10 | long long tt=0;
| ^~~~
a.cc:17:9: error: 'tt' was not declared in this scope; did you mean 'tm'?
17 | tt += i;
| ^~
| tm
a.cc:20:14: error: 'tt' was not declared in this scop... |
s317156204 | p03808 | C++ | #include <iostream>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
int n,i,j;
long long tt = 0;
long long sum=0,a[100001],dis;
cin >> n;
for (i=1;i<=n;i++)
{
cin >> a[i];
sum += a[i];
tt += i;
}
sum = sum / tt;
... | a.cc: In function 'int main()':
a.cc:47:23: error: expected '}' at end of input
47 | else cout << "NO";
| ^
a.cc:8:1: note: to match this '{'
8 | {
| ^
|
s087645914 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define PQ priority_queue
#define UM unordered_map
#define ALL(a) (a).begin(),(a).end()
typedef vector<ll> vi;
typedef... | a.cc: In function 'int main()':
a.cc:35:6: error: 'sm' was not declared in this scope; did you mean 'tm'?
35 | if(sm%(N*(N-1)/2)) {cout<<"NO"<<endl; return 0;}
| ^~
| tm
|
s794276082 | p03808 | C++ | // Example program
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 1;
typedef long long int ll;
ll a[MAXN];
int main()
{
ll n;
ll x = 0;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i];
x += a[i];
}
if (x % ((n * (n + 1)) / 2) == 0)
{
... | a.cc: In function 'int main()':
a.cc:33:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
33 | return ;
| ^~~~~~
|
s663925676 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
void NO(){cout<<"NO"<<endl;exit(0);}
int main(){
ll n;cin>>n;ll x[100001];ll s=0;for(int i=0;i<n;++i)cin>>x[i],s+=x[i];
ll n2=n*(n+1)/2;ll k=s/n2;if(n2*k!=s)NO();
ll j=0;for(int i=0;i+1<N;++i){ll d=x[i+1]-x[i];if((d-k)%n!=0)NO();j+=k+(d-k)/n;}
if(j!=n)NO... | a.cc: In function 'int main()':
a.cc:8:24: error: 'N' was not declared in this scope
8 | ll j=0;for(int i=0;i+1<N;++i){ll d=x[i+1]-x[i];if((d-k)%n!=0)NO();j+=k+(d-k)/n;}
| ^
|
s224011584 | p03808 | C++ | #include "bits/stdc++.h"
using namespace std;
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl
typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#defi... | a.cc: In function 'int main()':
a.cc:64:12: error: expected '}' at end of input
64 | return 0;
| ^
a.cc:24:11: note: to match this '{'
24 | int main(){
| ^
|
s370122063 | p03808 | C++ | #include <iostream>
using namespace std;
typedef long long int lint;
const int NMAX = 100000 + 5;
int N;
lint A[NMAX];
lint APrim[NMAX];
lint mars[2 * NMAX];
int main()
{
//ios_base :: sync_with_stdio(false);
//cin.tie(0);
cin >> N;
for (int i = 1; i <= N; ++ i)
cin >> A[i];
lint S = ... | a.cc:55:17: warning: missing terminating " character
55 | cout << "YES\";
| ^
a.cc:55:17: error: missing terminating " character
55 | cout << "YES\";
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:56:9: error: expected primary-expression before 'return'
... |
s985387625 | p03808 | C++ | #include <iostream>
//#include <sstream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <cmath>
//#include <functional>
//#define LL long long
using namespace std;
const int maxn = 100005;
int a[maxn];
long long b[... | a.cc: In function 'int main()':
a.cc:61:51: error: expected ')' before '{' token
61 | if(b[i] != 0 && (b[i] % n != 0|| b[i] < 0)
| ~ ^
| )
62 | {
| ~ ... |
s896579330 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool solve(vector<ll> A) {
}
int main() {
// メインプログラムここから
ll n; cin >> n;
vector<ll> A(n);
REP(i, n) {
cin >> A[i];
}
ll n = A.size();
// ΣA[i] を求める
ll sum = 0;
REP(i, n) {
sum += A[i];
}
... | a.cc: In function 'bool solve(std::vector<long long int>)':
a.cc:8:1: warning: no return statement in function returning non-void [-Wreturn-type]
8 | }
| ^
a.cc: In function 'int main()':
a.cc:14:9: error: 'i' was not declared in this scope
14 | REP(i, n) {
| ^
a.cc:14:5: error: 'REP' was... |
s530193364 | p03808 | C | #include <stdio.h>
int a[100001];
int b[100001];
int n;
long long int sum;
int main(int argc, const char * argv[]) {
scanf("%d",&n);
for (int i = 0; i < n; i++){
scanf("%d",&a[i]);
sum += a[i];
}
if ((2*sum/n/(n+1) != 2.0*sum/n/(n+1))){
printf("NO\n");
return 0;
}
... | main.c: In function 'main':
main.c:16:13: error: expected expression before 'int'
16 | int t = int(2*sum/n/(n+1));
| ^~~
|
s086703796 | p03808 | C++ | #include<cstdio>
#include<iostream>
int s[100005];
int dis[100005];
int main(){
int n;
while(scanf("%d",&n)==1)
{
int sum=0;
for(int i=0;i<n;i++)
{
scanf("%d",&s[i]);
sum+=s[i];
}
if(((2*sum)%(n*(n+1)))!=0)
{
printf("NO\n");
continue;
}
sum/=(n*(n+1))/2;
dis[1]=a[1]-a[n];
for(i=2;... | a.cc: In function 'int main()':
a.cc:21:24: error: 'a' was not declared in this scope
21 | dis[1]=a[1]-a[n];
| ^
a.cc:22:21: error: 'i' was not declared in this scope
22 | for(i=2;i<=n;i++)
| ^
a.cc:25:21: error: 'i' was not de... |
s764151075 | p03808 | C++ | b | a.cc:1:1: error: 'b' does not name a type
1 | b
| ^
|
s404080363 | p03808 | C++ | #include<bits/stdc++.h>
using namespace std;
ll a[200000];
ll d[200000];
#define ll long long
int main()
{
ll n;
ll sum=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
sum+=a[i];
}
for(int i=0;i<n-1;i++)
{
d[i]=a[i+1]-a[i];
}
d[n-1]=a[0]-a[n-1];
if(sum%(... | a.cc:3:1: error: 'll' does not name a type
3 | ll a[200000];
| ^~
a.cc:3:1: note: the macro 'll' had not yet been defined
a.cc:5:10: note: it was later defined here
5 | #define ll long long
| ^~
a.cc:4:1: error: 'll' does not name a type
4 | ll d[200000];
| ^~
a.cc:4:1: note: the... |
s716375311 | p03808 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
int n;
cin >> n;
vector<int> a(n);
for(int i=0;i<n;i++){
cin >> a[n];
}
bool ok = true;
int hoge = ((a[1]-a[0])%n + n)%n;
for(int i=0;i+1<n;i++){
if ((a[i+1]-a[i])%n + n)%n != hoge) ok = false;
}
cout << (ok ? "YES" : "NO") << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:25: error: expected primary-expression before '%' token
15 | if ((a[i+1]-a[i])%n + n)%n != hoge) ok = false;
| ^
|
s624098872 | p03808 | C++ | #include <cstdio>
#include <vector>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define rep(i,n) FOR(i,0,n)
int main(){
ll n;
scanf("%lld", &n);
vector<ll> a(n+2);
ll tot = 0;
rep(i,n) {
scanf("%lld", &a[i]);
tot += a[i];
}
... | a.cc: In function 'int main()':
a.cc:30:33: error: expected primary-expression before 'break'
30 | if(d[i] > 0) f = false, break;
| ^~~~~
|
s928160864 | p03808 | C++ | #include <iostream>
#include <vector>
#include <cstdint>
using namespace std;
int main()
{
int_least32_t n;
cin >> n;
int_fast64_t sum{ 0 };
vector<int_least32_t> a( n + 1 );
for(auto i = 0; i < n; ++i) {
cin >> a[i];
sum += a[i];
}
a[n] = a[0];
if((sum % (n * (n + 1) / 2) != 0) {
cout << "NO" << end... | a.cc: In function 'int main()':
a.cc:21:42: error: expected ';' before '{' token
21 | if((sum % (n * (n + 1) / 2) != 0) {
| ^~
| ;
a.cc:26:26: error: expected initializer before ',' token
26 | int_fast64_... |
s207316403 | p03808 | C++ | #include <iostream>
#include <vector>
#include <cstdint>
using namespace std;
int main()
{
int_least32_t n;
cin >> n;
int_fast32_t sum{ 0 };
vector<int_least32_t> a( n );
for(auto& x : a) {
cin >> x;
sum += x;
}
int_fast32_t temp, k{ sum / (n * (n + 1) / 2) };
bool isok{ true };
for(auto i = 0; i < n... | a.cc: In function 'int main()':
a.cc:23:51: error: expected primary-expression before ')' token
23 | if(temp > 0 && -1 * temp % n != 0)) {
| ^
|
s193936766 | p03808 | C++ | #include <iostream>
#include <vector>
#include <cstdint>
using namespace std;
int main()
{
int_least32_t n;
cin >> n;
int_fast32_t sum{ 0 };
vector<int_least32_t> a( n );
for(auto& x : v) {
cin >> x;
sum += x;
}
int_least32_t k{ sum / (n * (n + 1) / 2) };
int_fast32_t temp;
bool isok{ true };
for(au... | a.cc: In function 'int main()':
a.cc:14:23: error: 'v' was not declared in this scope
14 | for(auto& x : v) {
| ^
a.cc:19:30: warning: narrowing conversion of '(sum / ((int_fast32_t)((n * (n + 1)) / 2)))' from 'int_fast32_t' {aka 'long int'} to 'int_least32_t' {aka 'int'} [-Wnarro... |
s903310004 | p03808 | C++ | int_least32_t n;
cin >> n;
int_fast32_t sum{ 0 };
vector<int_least32_t> a( n );
for(auto& x : v) {
cin >> x;
sum += x;
}
int_least32_t k{ sum / (n * (n + 1) / 2) };
int_fast32_t temp;
bool isok{ true };
for(auto i = 0; i < n - 1; ++i) {
temp = a[i + 1] - a[i] - k;
if(temp >= 0 || -1 * temp % n != 0... | a.cc:1:1: error: 'int_least32_t' does not name a type
1 | int_least32_t n;
| ^~~~~~~~~~~~~
a.cc:2:9: error: 'cin' does not name a type
2 | cin >> n;
| ^~~
a.cc:4:9: error: 'int_fast32_t' does not name a type
4 | int_fast32_t sum{ 0 };
| ^~~~~~~~~~~~
a.cc:5:9... |
s302539593 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int n;
int main() {
cin >> n;
vector<ll> v(n);
for (auto& i : v) cin >> i;
ll sum = 0;
for (auto i : v) sum += i;
if (sum % (n * (n+1) / 2)) {
cout << "NO" << endl;
return 0;
}
int k = sum / (n *... | a.cc: In function 'int main()':
a.cc:24:21: error: 'zoro' was not declared in this scope; did you mean 'zero'?
24 | if (d == 0) zoro++;
| ^~~~
| zero
|
s955961622 | p03808 | C++ | #include<cstdio>
int n, w[101000];
long long s, K;
int main(){
int i;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&w[i]);
s += w[i];
}
K = 1ll*n*(n+1)/2;
if(s%K) goto f;
s/=K;
long long t=0;
for(i=1;i<=n;i++){
if((w[i%n+1]%n-w[i]%n+n)%n != s%n)goto f;
... | a.cc: In function 'int main()':
a.cc:23:1: error: jump to label 'f'
23 | f:
| ^
a.cc:12:18: note: from here
12 | if(s%K) goto f;
| ^
a.cc:14:15: note: crosses initialization of 'long long int t'
14 | long long t=0;
| ^
|
s192826238 | p03808 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cstring>
#include <string>
#include <cmath>
#include <functional>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int M = 1e9 + 7;
con... | a.cc: In function 'int main()':
a.cc:51:21: error: 'd' was not declared in this scope
51 | if (!(cnt - d[i] >= 0 && (cnt - d[i]) % n == 0)) {
| ^
|
s983839970 | p03808 | C++ | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define CLEAR(a) memset(a,0,sizeof a)
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define fr freopen("input.txt", "r", stdin);
#define fw freopen("output.txt", "w",... | a.cc:20:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
20 | main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:34:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
34 | return;
| ^~~~~~
|
s166398049 | p03808 | C++ | #include<iostream>
using namespace std;
int mian(){
cout<<"NO"<<endl;} | a.cc: In function 'int mian()':
a.cc:4:18: warning: no return statement in function returning non-void [-Wreturn-type]
4 | cout<<"NO"<<endl;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
... |
s011001334 | p03808 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#define ll long long
#define N 100005
#define inf 0x3f3f3f3f
using namespace std;
ll sum,a[N],t,tmp,n;
int main() {
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
sum+=a[i];
t+=i;
}
if(sum%t)cout<<"NO";
... | a.cc: In function 'int main()':
a.cc:30:14: error: expected '}' at end of input
30 | return 0;
| ^
a.cc:10:12: note: to match this '{'
10 | int main() {
| ^
|
s946013039 | p03808 | Java | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
long long array[n + 1];
long long diff[n];
long long sum = 0;
for(int i = 1;i <= n;i++){
scanf("%lld",&array[i]);
sum += array[i];
}
array[0] = array[n];
if(sum % ((long)n * (n + 1)... | Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
^
Main.java:8: error: not a statement
long long array[n + 1];
^
Main.java:8: error: not a statement
long long array[n + 1];
... |
s244312725 | p03808 | C++ | #include <iostream>
#include <vector>
#include <set>
using namespace std;
int main(){
int N, sum=0, k;
cin>>N;
vector<int> A(N), A2(N);
for(int i=0; i<N; i++){
cin>>A[i];
sum+=A[i];
}
if(sum%(N*(N+1)/2)!=0){
cout<<"NO"<<endl;
rteurn 0;
}
k=sum/(N*(N+1)/2);
for(int i=0; i<N; i++){
A2[i]=A[(i+1)%N]-... | a.cc: In function 'int main()':
a.cc:17:17: error: 'rteurn' was not declared in this scope
17 | rteurn 0;
| ^~~~~~
|
s894901648 | p03808 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#de... | a.cc:97:9: error: expected unqualified-id before 'if'
97 | if ((num[0] - inc) % addr) {
| ^~
a.cc:102:9: error: 'rad' does not name a type
102 | rad = num[0] - inc;
| ^~~
a.cc:18:20: error: expected unqualified-id before 'for'
18 | #define rep(i,s,n) for(int i = (s); ... |
s956501994 | p03808 | C++ | #include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
const int N=1e5+100;
int a[N];
const int Max=1e5+10;
bool prime[N];
void IsPrime(){
prime[0]=prime[1]=0;prime[2]=1;
for(int i=3;i<Max;i++)
prime[i]=i%2==0?0:1;
int t=(int)sqrt(Max*1... | a.cc: In function 'int main()':
a.cc:54:33: error: expected primary-expression before ')' token
54 | if((!flag1||!flag2)&&) puts("YES");
| ^
|
s504273513 | p03808 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
vector<int> a;
int b = 0;
int sum = 0;
int c = 0;
int x;
cin >> N;
for(int i = 0; i < N; i++){
cin >> b;
a.push_back(b);
sum += b;
}
int trial = sum / (N*(N+1)/2);
if (sum % (N*(N+1)/2) != 0){
cout <<... | a.cc:35:3: error: expected unqualified-id before 'if'
35 | if((a[N-1] + trial - a[0]) % N != 0 || a[N-1] + trial - a[0]){
| ^~
a.cc:41:3: error: 'cout' does not name a type
41 | cout << "YES" << endl;
| ^~~~
a.cc:43:3: error: expected unqualified-id before 'return'
43 | return 0;
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.