submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s561589244 | p04019 | C++ | import java.io.*;
import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String path = r.readLine();
int p = 0;
for (int j = 0; j < path.length(); j++)
p |= (path.char... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
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.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: ... |
s251307944 | p04019 | C++ | fn main() {
let s = next_line();
let mut v = vec![false; 4];
for c in s.chars() {
match c {
'N' => v[0] = true,
'E' => v[1] = true,
'W' => v[2] = true,
'S' => v[3] = true,
_ => continue,
}
}
let mut ok = true;
f... | a.cc:15:14: error: too many decimal points in number
15 | for x in 0..4 {
| ^~~~
a.cc:1:1: error: 'fn' does not name a type
1 | fn main() {
| ^~
a.cc:24:1: error: 'fn' does not name a type
24 | fn next_line() -> String {
| ^~
|
s697038772 | p04019 | C++ | n main() {
let s = next_line();
let mut v = vec![false; 4];
for c in s.chars() {
match c {
'N' => v[0] = true,
'E' => v[1] = true,
'W' => v[2] = true,
'S' => v[3] = true,
_ => continue,
}
}
let mut ok = true;
fo... | a.cc:15:14: error: too many decimal points in number
15 | for x in 0..4 {
| ^~~~
a.cc:1:1: error: 'n' does not name a type
1 | n main() {
| ^
a.cc:24:1: error: 'fn' does not name a type
24 | fn next_line() -> String {
| ^~
|
s839025354 | p04019 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = 0,S = 0,E = 0,W = 0;
String s = scanner.nextLine();
for(int i = 0; i < s.length(); i++){
if (s.charAt(i) =='N') {
N++;
}else if (s.charAt(i) =='E'){
E++;
}else if... | Main.java:25: error: reached end of file while parsing
}
^
1 error
|
s189399276 | p04019 | C++ | using System;
using System.Collections.Generic;
class Program {
static void Main(string[] args){
string s = Console.ReadLine();
Dictionary<char, int> map = new Dictionary<char, int>();
map['N'] = map['S'] = map['W'] = map['E'] = 0;
foreach(var e in s){
map[e] = map[e] +... | 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:5:22: error: 'string' has not been declared
5 | static void Main(string[]... |
s021149884 | p04019 | Java | /*
* Copyright © 2016. Throput Limited. All rights reserved.
* Unless otherwise indicated, this file is subject to the
* terms and conditions specified in the 'LICENSE.txt' file,
* which is part of this source code package.
*/
import java.util.*;
/**
*
* @author thomaslee
*/
public class WannaGoBackHome {
... | Main.java:14: error: class WannaGoBackHome is public, should be declared in a file named WannaGoBackHome.java
public class WannaGoBackHome {
^
1 error
|
s148124340 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a=0,b=0;
string s;
cin>>s;
int l=s.length();
for(i=0;i<l;i++){
if(s[i]=='N')b++;
else if(s[i]=='S')b--;
else if(s[i]=='E')a++;
else a--;
}
if(a==0 && b==0)cout<<"Yes\n";
else cout<<"No\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'i' was not declared in this scope
8 | for(i=0;i<l;i++){
| ^
|
s307438989 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
int len=s.size();
int a[300] = {0};
for(int i=0;i<len;i++}
{
a[s[i]]++;
}
if(a['N']!=a['S'])
puts("NO");
else if(a['S']!=a['E'])
puts("NO");
else
puts("YES");
return 0;
} | a.cc: In function 'int main()':
a.cc:9:22: error: expected ')' before '}' token
9 | for(int i=0;i<len;i++}
| ~ ^
| )
a.cc:9:22: error: expected primary-expression before '}' token
a.cc: At global scope:
a.cc:10:1: error: expected unqualified-id before '{' token
... |
s758246395 | p04019 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
String str = sc.next();
if((str.contains("N") && !str.contains("S")) || (str.contains("S") && !str.contains("N"))){
System.out.println("NO");
return;
... | Main.java:18: error: reached end of file while parsing
}
^
1 error
|
s456075225 | p04019 | C++ | #include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
using namespace std;
#de... | a.cc: In function 'int main()':
a.cc:76:17: error: expected '}' at end of input
76 | cout << res;
| ^
a.cc:29:12: note: to match this '{'
29 | int main() {
| ^
|
s338445235 | p04019 | C++ | import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
public class Main {
public static void main(String args[]) {
Sc sc = new Sc(System.in);
String st = sc.... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.StringTokenizer;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.BufferedReader;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available wit... |
s034508801 | p04019 | C++ | #include <iostream >
#include <string>
using namespace std;
int main(){
string s;
cin>>s;
bool n,s,e,w;
for(int i=0;i<s.length();i++){
if(s[i]=='W') w=true;
if(s[i]=='E') e=true;
if(s[i]=='S') s=true;
if(s[i]=='N') n=true;
}
if(w^e) cout<<"No\n";
else if(n^s) cout<<"No\n";
else cout<<"Yes\n";
return... | a.cc:1:10: fatal error: iostream : No such file or directory
1 | #include <iostream >
| ^~~~~~~~~~~
compilation terminated.
|
s561832618 | p04019 | C | #include <iostream>
#include <string>
using namespace std;
int main()
{
bool flg[4]={false,false,false,false};
string S;
cin >> S;
for(int i=0;i<S.size();++i){
if(S[i]=='E') flg[0]=true;
else if(S[i]=='W') flg[1]=true;
else if(S[i]=='S') flg[2]=true;
else if(S[i]=='N') f... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s417951062 | p04019 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | a.cc: In function 'int main()':
a.cc:39:11: error: conflicting declaration 'int s'
39 | int n,w,e,s;
| ^
a.cc:37:10: note: previous declaration as 'std::string s'
37 | string s;
| ^
a.cc:40:9: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__... |
s799840063 | p04019 | Java | //package codechef;
import java.io.*;
import java.math.*;
import java.util.*;
/**
*
* @author Pradyumn Agrawal coderbond007
*/
public class Codechef{
public static InputStream inputStream = System.in;
public static OutputStream outputStream = System.out;
public static FastReader in = new FastReader(inputStream);... | Main.java:9: error: class Codechef is public, should be declared in a file named Codechef.java
public class Codechef{
^
1 error
|
s402737769 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
/*
JSR
Mistakes -
0) Dont rush to conclusion on seeing a question , keep yourself relaxed and go easy on ques .
1) To see at each step if integer is not causing an error , best way is to use long long always.
2) To see if my solution can be verified , if yes... | a.cc: In function 'int main()':
a.cc:46:7: error: conflicting declaration 'bool s'
46 | bool s = false ;
| ^
a.cc:43:9: note: previous declaration as 'std::string s'
43 | string s ;
| ^
a.cc:56:26: error: 'w' was not declared in this scope
56 | if( s[i] == 'W') w = true ;... |
s913375626 | p04019 | C | #include<stdio.h>
#include<stdlib.h>
int main(void)
{
int i,n,e;
char S[];
scanf("%s\n",S);
int N = sizeof(S);
if(1 <= N && N <= 1000) {
for (i = 1; i <= N; i++) {
if (S[i] == "N") n = n + 1;
if (S[i] == "S") n = n - 1;
if (S[i] == "E") e = e + 1;
if (S[i] == "W") e = e - 1;
}... | main.c: In function 'main':
main.c:7:8: error: array size missing in 'S'
7 | char S[];
| ^
main.c:12:16: warning: comparison between pointer and integer
12 | if (S[i] == "N") n = n + 1;
| ^~
main.c:13:16: warning: comparison between pointer and integer
13 | if (... |
s443387051 | p04019 | C++ | #include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long LL;
LL a[110000];
vector<LL> p1, p2;
map<LL,int> r;
void gen(LL k){
if(r.find(k) == r.end()){
r[k] = rand() << 12 + rand();
}
}
int main(){
srand(150);
int n;
cin >> n;
for(int i = 0; i < n; i++) cin >> a[i];
map<LL,int> d;... | a.cc: In function 'int main()':
a.cc:64:27: error: invalid operands of types 'LL [110000]' {aka 'long long int [110000]'} and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to binary 'operator*'
64 | a *= p1[i];
a.cc:64:27: note: ... |
s693560070 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
vector<int> primes;
map<vector<pair<int,int>>,int> mp;
bool isPrime(int n) {
for (int i = 2; i * i <= n; ++i)
if (n % i == 0)
return false;
return true;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(... | a.cc: In function 'int main()':
a.cc:54:13: error: expected ',' or ';' before 'if'
54 | if (1LL * y * y != x) {
| ^~
a.cc:56:15: error: expected '}' before 'else'
56 | } else {
| ^~~~
a.cc:43:20: note: to match this '{'
43 | if (x > 1) {
... |
s352979219 | p04019 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new Strin... | Main.java:22: error: incompatible types: possible lossy conversion from long to int
a[i] = v-e*2;
^
1 error
|
s945863482 | p04019 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string S;
int n=0,s=0,w=0,e=0,yn=0;
cin>>S;
for(int i=0;i<S.size();i++){
if(S[i]=="N"&&n=0){n=1;}
else if(S[i]=="S"&&s=0){s=1;}
else if(S[i]=="W"&&w=0){w=1;}
else if(S[i]=="E"&&e=0){e=1;}
}
if(n == s&&w == e){cout<<"Yes"<<endl;}
else{c... | a.cc: In function 'int main()':
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(S[i]=="N"&&n=0){n=1;}
a.cc:10:15: error: lvalue required as left operand of assignment
10 | if(S[i]=="N"&&n=0){n=1;}
a.cc:11:15: error: ISO C++ forbids comparison between pointer an... |
s099004960 | p04019 | Java | /**
* Created by abhishek on 7/29/2016.
*/
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args)throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
int north= 0,east = 0,west = ... | Main.java:17: error: bad operand types for binary operator '&&'
if(north != 0 && south == 0 || south != 0 && north = 0 || east != 0 && west = 0 || west != 0 && east == 0)
^
first type: boolean
second type: int
Main.java:17: error: bad operand types for bina... |
s083928491 | p04019 | C | #include <stdio.h>
#include <string.h>
int main() {
char S[1234] = { '\0' };
int str_long, x = 0, y = 0, n = -1, w = -1, s = -1, e = -1;
bool flag = false;
scanf("%s", &S);
str_long = strlen(S);
for (int i = 0; i < str_long - 1; i++) {
switch (S[i]) {
case 'N':
y++;
n = 1;
break;
case 'W':
... | main.c: In function 'main':
main.c:8:9: error: unknown type name 'bool'
8 | bool flag = false;
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include <string.h>
+++ |+#include <stdbool.h>
3 |
main.c:... |
s165155841 | p04019 | C++ | #include <iostream>
using namespace std;
int main(){
int i,n = 0,so = 0,e = 0,w = 0;
char s;
while(cin != !EOF){
if(s == 'N'){
n += 1;
}else if(s == 'S'){
so += 1;
}else if(s == 'W')
w += 1;
else
e += 1;
}
... | a.cc: In function 'int main()':
a.cc:8:15: error: no match for 'operator!=' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'bool')
8 | while(cin != !EOF){
| ^
a.cc:8:15: note: candidate: 'operator!=(int, int)' (built-in)
a.cc:8:15: note: no known conversion for argu... |
s815683796 | p04019 | C++ | #include <iostream>
using namespace std;
int main(){
int i,n = 0,so = 0,e = 0,w = 0;
char s;
while(cin >> s)
if(s == 'N'){
n += 1;
//cout << "N" << endl;
}else if(s == 'S'){
so += 1;
//cout << "S" << endl;
}else if(s == 'W')
... | a.cc:21:5: error: expected unqualified-id before 'if'
21 | if(n - so== 0){
| ^~
a.cc:24:6: error: expected unqualified-id before 'else'
24 | }else{
| ^~~~
a.cc:27:5: error: expected unqualified-id before 'return'
27 | return 0;
| ^~~~~~
a.cc:28:1: error: expected decl... |
s851001599 | p04019 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<set>
#include<map>
#include<sstream>
#include<iomanip>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
string ss;
cin>>ss;
set<char> s;
string sss=ss[0];
for(int... | a.cc: In function 'int main()':
a.cc:18:20: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
18 | string sss=ss[0];
| ^
|
s971212728 | p04019 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<set>
#include<map>
#include<sstream>
#include<iomanip>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
string ss;
cin>>ss;
set<char> s;
string sss=ss[0];
for(int... | a.cc: In function 'int main()':
a.cc:18:20: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
18 | string sss=ss[0];
| ^
|
s696876627 | p04019 | C++ | x = raw_input()
n = x.count('N')
e = x.count('E')
w = x.count('W')
s = x.count('S')
if (n == s) and (e == w):print "Yes"
else: print "No" | a.cc:1:1: error: 'x' does not name a type
1 | x = raw_input()
| ^
|
s184217300 | p04019 | C++ | # include <iostream>
# include <cstdio>
# include <cstring>
using namespace std;
char s[1000+10];
int memo[150];
int main(){
while(gets(s)!=NULL){
memset(memo,0,sizeof(memo));
for(int i = 0;s[i]!='\0';++i){
if(memo[s[i]] == 0)
memo[s[i]] = 1;
}
if(memo['N'... | a.cc: In function 'int main()':
a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | while(gets(s)!=NULL){
| ^~~~
| getw
|
s215435637 | p04019 | C | #include <stdio.h>
#include <string.h>
int main(void){
int i=0;
int n=0,w=0;
char s[1001];
scanf("%s",s);
for(;strlen(s)>=i ;i++){
if(s[i]=='N')n++;
if(s[i]=='S')n--;
if(s[i]=='W')w++;
if(s[i]=='E')w--;
}
if(n==0&&w==0){
printf("Yes\n");
}else{
printf("No\n");
}
return 0; | main.c: In function 'main':
main.c:22:9: error: expected declaration or statement at end of input
22 | return 0;
| ^~~~~~
|
s919109696 | p04019 | C | #include <stdio.h>
#include <string.h>
int main(void){
char S[1000];
int i, len;
int x = 0;
int y = 0;
scanf("%s", S);
len= stlen(S);
for (i = 0; i <= len; i++){
if(S[i] == 'N'){
x++;
}
if(S[i] == 'S'){
x--;
}
if(S[i] == 'W'){
y--;
}
if(S[i] == 'E'){
... | main.c: In function 'main':
main.c:11:8: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
11 | len= stlen(S);
| ^~~~~
| strlen
|
s439399900 | p04019 | C++ | # include <iostream>
# include <cstdio>
# include <cstring>
using namespace std;
char s[1000+10];
int memo[150];
int main(){
while(gets(s)){
memset(memo,0,sizeof(memo));
for(int i = 0;s[i]!='\0';++i){
if(memo[s[i]] == 0)
memo[s[i]] = 1;
}
if(memo['N'] == 1... | a.cc: In function 'int main()':
a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | while(gets(s)){
| ^~~~
| getw
|
s994947623 | p04019 | C++ | # include <cstdio>
# include <cstring>
char s[1000+10];
int memo[150];
int main(){
while(gets(s)){
memset(memo,0,sizeof(memo));
for(int i = 0;s[i]!='\0';++i){
if(memo[s[i]] == 0)
memo[s[i]] = 1;
}
if(memo['N'] == 1&&memo['W'] == 1&&memo['E'] == 1&&memo['S'... | a.cc: In function 'int main()':
a.cc:6:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | while(gets(s)){
| ^~~~
| getw
|
s552167042 | p04019 | C++ | # include <cstdio>
# include <cstring>
char s[1000+10];
int memo[150];
int main(){
while(gets(s)){
memset(memo,0,sizeof(memo));
for(int i = 0;s[i]!='\0';++i){
if(memo[s[i]] == 0)
memo[s[i]] = 1;
}
if(memo['N'] == 1&&memo['W'] == 1&&memo['E'] == 1&&memo['S'... | a.cc: In function 'int main()':
a.cc:6:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | while(gets(s)){
| ^~~~
| getw
|
s565617255 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin()... | a.cc: In function 'int main()':
a.cc:39:11: error: lvalue required as left operand of assignment
39 | if(in==0&&is=0&&iw==0&&ie==0){
| ~~~~~^~~~
|
s399336189 | p04019 | C++ | # include <cstdio>
# include <cstring>
char s[1000+10];
int memo[150];
int main(){
while(gets(s)){
memset(memo,0,sizeof(memo));
for(int i = 0;s[i]!='\0';++i){
if(memo[s[i]] == 0)
memo[s[i]] = 1;
}
if(memo['N'] == 1&&memo['W'] == 1&&memo['E'] == 1&&memo['S'... | a.cc: In function 'int main()':
a.cc:6:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | while(gets(s)){
| ^~~~
| getw
|
s916880407 | p04019 | C++ | #include <iostream>
#include <string>
#include <alogorithm>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <tuple>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=a;i>=n;i--)
#de... | a.cc:3:10: fatal error: alogorithm: No such file or directory
3 | #include <alogorithm>
| ^~~~~~~~~~~~
compilation terminated.
|
s022565818 | p04019 | C++ | #include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef pair<int,int> P;
int a;
char a[1001];
int w,n,s,e;
int main()
{
cin>>a;
scanf("%s",a);
for(int i=0;i<n;i++... | a.cc:14:6: error: conflicting declaration 'char a [1001]'
14 | char a[1001];
| ^
a.cc:13:5: note: previous declaration as 'int a'
13 | int a;
| ^
a.cc: In function 'int main()':
a.cc:21:9: error: invalid types 'int[int]' for array subscript
21 | if(a[i]=='W') w++;
| ^
a.c... |
s972997972 | p04019 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
int x = 0, y = 0;
for(int i = 0; i < s.length(); i++){
if(s.at(i) == 'N') y++;
else if(s.at(i) == 'S') y--;
else if((s.at(i) == 'E')) x++;
else x--
}
if(x == 0 && y == 0) cout << "Yes";
else cout << "No";
return ... | a.cc: In function 'int main()':
a.cc:13:25: error: expected ';' before '}' token
13 | else x--
| ^
| ;
14 | }
| ~
|
s603214223 | p04019 | Java | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int ns = 0;
int we = 0;
String str = sc.nextLine();
for (int i = 0, max = str.length(); i < max; i++) {
char ch = str.charAt(i);
... | Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s883082042 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int x = 0, y = 0;
for (int unsigned i = 0; i < s.size(); i++) {
if (s[i] == 'S') y++;
if (s[i] == 'N') y--;
if (s[i] == 'W') x++;
if (s[i] == 'E') x--;
}
if (x == 0 && y == 0) {
cout << "Yes" << endl;
}
else {
cout <<... | a.cc: In function 'int main()':
a.cc:7:38: error: 's' was not declared in this scope
7 | for (int unsigned i = 0; i < s.size(); i++) {
| ^
|
s787723615 | p04019 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<set>
#include<map>
#include<sstream>
#include<iomanip>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
string ss;
cin>>ss;
int x=0,y=0;
for(int i=0;i<ss.size();i++)... | a.cc: In function 'int main()':
a.cc:29:16: error: expected ';' before '}' token
29 | x++
| ^
| ;
30 | }
| ~
|
s440385428 | p04019 | C++ | #include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <fstream>
using namespace std;
#define M_PI 3.14159265358979323846264338327950288
int main()
{
... | a.cc:19:9: warning: "M_PI" redefined
19 | #define M_PI 3.14159265358979323846264338327950288
| ^~~~
In file included from /usr/include/c++/14/cmath:47,
from a.cc:12:
/usr/include/math.h:1121:10: note: this is the location of the previous definition
1121 | # define M_PI 3.141... |
s364626396 | p04019 | Java | import java.io.*;
import java.util.*;
public class R3qA {
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
PrintWriter w = new PrintWriter(System.out);
char s[] = in.readString().toCharArray();
boolean t[] = new boolean[500];
for (char ... | Main.java:4: error: class R3qA is public, should be declared in a file named R3qA.java
public class R3qA {
^
1 error
|
s997684834 | p04019 | C++ | #include <cstdio>
#include <cstring>
using namespace std;
const int N = 1000500;
char buf[N];
bool was[256];
int main() {
gets(buf);
int n = strlen(buf);
for (int i = 0; i < n; i++) {
was[buf[i]] = true;
}
bool ans = was['N'] == was['S'] && was['E'] == was['W'];
puts(ans ? "Yes" : "No... | a.cc: In function 'int main()':
a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(buf);
| ^~~~
| getw
|
s339803622 | p04019 | C++ | // {{{ by shik
#include <bits/stdc++.h>
#include <unistd.h>
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define FOR(it,c) for ( auto it=(c).begin(); it!=(c).end(); it++ )
#define MP make_pair
#define... | a.cc: In function 'int main()':
a.cc:109:14: error: 'gets' was not declared in this scope; did you mean 'getw'?
109 | n=strlen(gets(s));
| ^~~~
| getw
|
s395615834 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int x = 0, y = 0;
int main() {
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s[i] == "N") y++;
else if (s[i] == "S") y--;
else if (s[i] == "E") x++;
else x--;
}
if (x == 0 && y == 0) cout << "Yes" << endl;
... | a.cc: In function 'int main()':
a.cc:9:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (s[i] == "N") y++;
a.cc:10:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | else if (s[i] == "S") y--;
a.cc:11:23: error: ISO C++ for... |
s177808711 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
vector<int> a(n + 1, 0);
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
int res = 0;
int curr = 0;
bool ct = 1;
for (int i = 1; i <= n; i++) {
int ds = a[i];
int prs = (ds + curr) / 2;
res += prs;
if (y == 0) {
curr = 0... | a.cc: In function 'int main()':
a.cc:20:21: error: 'y' was not declared in this scope
20 | if (y == 0) {
| ^
|
s895692329 | p04020 | C++ | f | a.cc:1:1: error: 'f' does not name a type
1 | f
| ^
|
s981145098 | p04020 | C++ | // -----------------------------------
// author : MatsuTaku
// country : Japan
// created : 09/11/20 07:34:59
// -----------------------------------
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr); ios::sync_with_stdio(false);
int n; ... | a.cc:8:10: fatal error: atcoder/all: No such file or directory
8 | #include <atcoder/all>
| ^~~~~~~~~~~~~
compilation terminated.
|
s380270517 | p04020 | C++ | // -----------------------------------
// author : MatsuTaku
// country : Japan
// created : 09/11/20 07:34:59
// -----------------------------------
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr); ios::sync_with_stdio(false);
int n; ... | a.cc:8:10: fatal error: atcoder/all: No such file or directory
8 | #include <atcoder/all>
| ^~~~~~~~~~~~~
compilation terminated.
|
s663284812 | p04020 | C++ | ERROR: type should be string, got "https://atcoder.jp/contests/agc003/submit?taskScreenName=#include <bits/stdc++.h>\nusing namespace std;\nusing ll = long long;\nusing P = pair<int,int>;\n#define rep(i,s,n) for(int i = s; i < (int)(n); i++)\n\nint main() {\n int n;\n cin >> n;\n ll ans = 0;\n vector<bool>o(n);\n rep(i,0,n){\n int a;\n cin >> a;\n ans += a/2;\n if(a%2 == 1) o[i] = 1;\n if(i > 0){\n if(o[i-1] && o[i]){\n ans++;\n o[i] = 0;\n o[i-1] = 0;\n }\n }\n }\n cout << ans << endl;\n}" | a.cc:1:1: error: 'https' does not name a type
1 | https://atcoder.jp/contests/agc003/submit?taskScreenName=#include <bits/stdc++.h>
| ^~~~~
a.cc:4:11: error: 'pair' does not name a type
4 | using P = pair<int,int>;
| ^~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not decla... |
s274201234 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vchar = vector<char>;
using vvchar = vector<vchar>;
using vp = vector<P>;
using vpp = vector<pair<P, P>>;
using vvp ... | a.cc: In function 'int main()':
a.cc:58:23: error: no matching function for call to 'max(int, ll&)'
58 | leftover = max(0, leftover);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51... |
s114451709 | p04020 | C++ | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define si short int
#define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pill pair<ll,ll>
#define f first
#define s second
#define pilc pair<ll,char>
#define all(a) (a).begin(),(a).end()
#define rep(s,e,step) for(int i = (s); i < (... | a.cc: In function 'int main()':
a.cc:33:24: error: expected primary-expression before '=' token
33 | a[i] % = 2;
| ^
a.cc:35:35: error: invalid types 'long long int[int]' for array subscript
35 | ans++, ans[i + 1]--;
| ... |
s072025188 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> a;
int n;
signed main() {
cin >> n;
int suma = 0;
int ans = 0;
for(int i = 0;i < n;i++){
int j;cin >> j;
if(j == 0){
ans += suma/2;
suma = 0;
continue;
}
suma... | a.cc: In function 'int main()':
a.cc:24:18: error: expected '}' at end of input
24 | return 0;
| ^
a.cc:9:15: note: to match this '{'
9 | signed main() {
| ^
|
s996011416 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> a;
int n;
int ans = 0;
signed main() {
cin >> n;
int suma = 0;
int ans = 0;
for(int i = 0;i < n;i++){
int j;cin >> j;
if(j == 0){
ans += suma/2;
suma = 0;
continue;
}... | a.cc: In function 'int main()':
a.cc:25:18: error: expected '}' at end of input
25 | return 0;
| ^
a.cc:10:15: note: to match this '{'
10 | signed main() {
| ^
|
s357414608 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
long long ans=0;
int A[N+1];
int B[N+1];
for(int i=1;i<=N;i++){
cin>>A[i];
}
for(int i=1;i<=N;i++){
B[i]=0;
}
for(int i=1;i<=N;i++){
ans+=A[i]/2;
if(A[i]%2 ==1){
B[i]=1;
}
}
for(int i=1;i<N;i++... | a.cc: In function 'int main()':
a.cc:29:9: error: 'setprecisitn' was not declared in this scope
29 | cout<<setprecisitn(20)<<ans<<endl;
| ^~~~~~~~~~~~
|
s366008458 | p04020 | C++ | using LL = long long;
int main() {
int N;
cin >> N;
vector<LL> A(N + 1, 0);
for (int i = 0; i < N; i++) cin >> A[i];
LL ans = 0;
for (int i = 0; i < N; i++) {
ans += A[i] / 2;
A[i] %= 2;
if (A[i] & (A[i + 1] > 0)) {
ans++;
A[i + 1]--;
}
}
cout << ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> N;
| ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
8 | vector<LL> A(N + 1, 0);
| ^~~~~~
a.cc:8:12: error: expected primary-expression before '>' token
8 | vector<LL> A(N + 1,... |
s974093296 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
struct edge {
int to; // 辺の行き先
int weight; // 辺の重み
edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string Yes="Yes";
string YES="YES";
string NO="NO";
string No="No";
template<class T> inline bool chmax... | a.cc: In function 'int main()':
a.cc:56:10: error: expected primary-expression before 'if'
56 | (if(a[i]!=0))a[i]+=a[i-1];
| ^~
a.cc:56:10: error: expected ')' before 'if'
56 | (if(a[i]!=0))a[i]+=a[i-1];
| ~^~
| )
|
s376911756 | p04020 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
ll N,A;
cin >> N;
ll i;
ll ans=0;
ll t=0;
for(i=0;i<N;i++... | a.cc: In function 'int main()':
a.cc:24:5: error: expected primary-expression before '}' token
24 | }
| ^
|
s782868895 | p04020 | 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
|
s254887512 | p04020 | C++ | #include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<... | a.cc: In function 'int main()':
a.cc:64:18: error: expected ';' before '}' token
64 | i++
| ^
| ;
65 | }
| ~
|
s082095559 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
#define sz size
#define pb push_back
#define int long long
const int N = 1e5 + 123;
int n, a[N], sum, ans;
int main() {
//freopen("input.txt", "r", stdin);
cin >> n;
for(int i = 1; i <= n; ++i) {
cin >> a[i];
sum += a[i];
if(a[i] == 0) {
ans += (sum / 2);
... | cc1plus: error: '::main' must return 'int'
|
s649434027 | p04020 | C++ | #include<bits/stdc++.h>
using namespace std;
int a[100005],b[100005];
int main()
{
int n,s=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
b[i]=a[i];
s+=a[i]/2;
a[i]=a[i]%2;
}
for(int i=1;i<n-1;i++)
{
if(a[i]==1)
{
if(a[i+1]==1)
{
s++;
a[i]--;
a[i+1]--;
}
if(a[i-1]... | a.cc: In function 'int main()':
a.cc:33:13: error: 'i' was not declared in this scope
33 | for(i=0;i<n;i++)
| ^
a.cc:37:14: error: 'i' was not declared in this scope
37 | if(a[i]<1)
| ^
a.cc:65:16: error: expected '}' at end of input
65 | }
| ... |
s625185514 | p04020 | C++ | include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[100005];
bool vis[100005];
while(scanf("%d",&n)!=EOF)
{
long long ans=0;
memset(vis,false,sizeof(vis));
for(int i=0; i<n; i++)
{
scanf("%d",&a[i]);
if(a[i])vis[i]=true;
an... | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:11: error: 'scanf' was not declared in this scope
7 | while(scanf("%d",&n)!=EOF)
| ^~~~~
a.cc:7:27: error: 'EOF' was not declared in this scope
7 | while(... |
s563563684 | p04020 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
int n;
int a[100010];
signed main(){
cin>>n;
rep(i,n)cin>>a[i];
int ans=a[0]/2,f=a[0]%2;
for(int i=1;i<n;i++){
if(f&&a[i]){
a[i]--;
ans++;
}
ans+=a[i]/2;
f=a[i]%2;
}
cout<<ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
9 | rep(i,n)cin>>a[i];
| ^
a.cc:9:9: error: 'rep' was not declared in this scope
9 | rep(i,n)cin>>a[i];
| ^~~
|
s976963777 | p04020 | C++ | \#include<bits/stdc++.h>
using namespace std;
int n,a[100001],ans;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
{
ans+=a[i]/2;
a[i]%=2;
if(i<n-1&&a[i]&&a[i+1])
ans++,a[i]--,a[i+1]--;
}
cout<<ans;
return 0;
} | a.cc:1:1: error: stray '\' in program
1 | \#include<bits/stdc++.h>
| ^
a.cc:1:2: error: stray '#' in program
1 | \#include<bits/stdc++.h>
| ^
a.cc:1:3: error: 'include' does not name a type
1 | \#include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was... |
s833956071 | p04020 | C++ | #include<bits/stdc++.h>
using namespace std;
int A[i];
int main()
{
int N;
cin>>N;
long long ans=0;
for(int i=0;i<N;i++)
{
cin>>A[i];
ans+=A[i]/2;
A[i]%=2;
if(i>0)
if(A[i]==A[i-1])
ans+=A[i],
A[i]=0;
}
cout<<ans<<endl;
return 0;
} | a.cc:3:7: error: 'i' was not declared in this scope
3 | int A[i];
| ^
a.cc: In function 'int main()':
a.cc:11:22: error: 'A' was not declared in this scope
11 | cin>>A[i];
| ^
|
s577567627 | p04020 | C++ | #include<bits/stdc=+>h>
using namespace std;
#define N 100010
#define ll long long
int n,a[N];
ll ans;
int main(){
ios::sync_with_stdio(false);
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++){
ans+=a[i]/2;
a[i]%=2;
if(i<n&&a[i]&&a[i+1]){
ans++;
... | a.cc:1:23: warning: extra tokens at end of #include directive
1 | #include<bits/stdc=+>h>
| ^
a.cc:1:9: fatal error: bits/stdc=+>: No such file or directory
1 | #include<bits/stdc=+>h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s824760559 | p04020 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int a[100010];
int ans =0;
for(int i=0;i<n;i++){
cin >> a[i] ;
}
for(int i=0;i<n;i++){
ans += a[i]/2;
if(a[i]%2 != 0 && a[i+1] != 0){
ans++;
a[i+1]--;
}
... | a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
29 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s508333189 | p04020 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int a[100010];
for(int i=0;i<n;i++){
cin >> a[i] ;
ans += a[i]/2;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:12:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | ans += a[i]/2;
| ^~~
| abs
a.cc:16:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
16 | cout << ans << endl;
| ^~~
| abs
|
s774008172 | p04020 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] A = new long[n];
for (int i = 0; i < n; ++i) {
A[i] = sc.nextLong();
}
long res = 0L
for (int... | Main.java:12: error: ';' expected
long res = 0L
^
1 error
|
s955254152 | p04020 | C++ | #include <iostream>
using namespace std;
const int maxn = 100100100;
typedef long long int ll;
int n;
ll int a[maxn];
ll sum = 0;
int main(){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> a[i];
}
for(int i = 1; i <= n - 1; i = i + 2){
if(a[i] >= a[i + 1]){
sum += a[i + 1];
... | a.cc:6:1: error: two or more data types in declaration of 'a'
6 | ll int a[maxn];
| ^~
a.cc: In function 'int main()':
a.cc:11:16: error: 'a' was not declared in this scope
11 | cin >> a[i];
| ^
a.cc:14:12: error: 'a' was not declared in this scope
14 | if(a[i] >= a[... |
s541539419 | p04020 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <ioman... | a.cc:59:13: error: macro "sortv" passed 2 arguments, but takes just 1
59 | sortv(a, n);
| ^
a.cc:38:9: note: macro "sortv" defined here
38 | #define sortv(xs) sort(xs.begin(), xs.end())
| ^~~~~
a.cc: In function 'int main()':
a.cc:59:3: error: 'sortv' was not declared in this sco... |
s554413649 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> A(N+1);
for(int i=0; i<N; i++){
cin >> A.at(i);
}
A.at(N)=0;
int ans=0;
for(int i=0; i<N; i++){
ans+= (A.at(i)+A.at(i+1))/2;
A.at(i+1)-= (A.at(i)+A.at(i+1))/2*2-A.at(i));
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:15:48: error: expected ';' before ')' token
15 | A.at(i+1)-= (A.at(i)+A.at(i+1))/2*2-A.at(i));
| ^
| ;
|
s328463500 | p04020 | C++ | #include<bits/stdc++.h>
using namespace std;
#define se second
#define fi first
#define ll long long
#define ld long double
#define pll pair<ll ,ll >
#define pii pair<int, int>
#define mod 1000000007
ll power(ll a,ll b){
ll res=1;
while(b>0){
if(b%2!=0) res=(res*a);
a=(a*a);
b/=2;
... | a.cc: In function 'int main()':
a.cc:60:22: error: expected ';' before 'i'
60 | x+=arr[i]
| ^
| ;
61 | i++;
| ~
|
s959814145 | p04020 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long long result = , sum = 0;
for (int i = 0, a; i < n; i++) {
cin >> a;
if (a == 0) {
result += sum / 2;
sum = 0;
} else {
sum += a;
}
}
result += sum / 2;... | a.cc: In function 'int main()':
a.cc:7:24: error: expected primary-expression before ',' token
7 | long long result = , sum = 0;
| ^
a.cc:11:23: error: 'sum' was not declared in this scope
11 | result += sum / 2;
| ^~~
a.cc:14:13: error: 's... |
s997963046 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
int n,a[1000000005],ans=0,duishu;
void dui(int x)
{
int left=n;
int min=n;
duishu=0;
for(int j=x+1;j<n;j++)
{
if(a[x]-a[j]>=-1 && a[x]-a[j]<=1)
{
duishu++;
left=left-2;
}
if(left<min)
{
ans=duishu;
}
duishu=0;
}
}
int main()
{
int max=0;
cin>>... | /tmp/ccoTCRJs.o: in function `dui(int)':
a.cc:(.text+0x1b): relocation truncated to fit: R_X86_64_PC32 against symbol `duishu' defined in .bss section in /tmp/ccoTCRJs.o
a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `duishu' defined in .bss section in /tmp/ccoTCRJs.o
a.cc:(.text+0xa6): re... |
s555473697 | p04020 | C++ | /* it was worth becoming a chemist */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ld;
typedef unsigned int uni;
typedef unsigned long long unll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<long long, int> pli;
typedef ... | a.cc: In function 'int main()':
a.cc:44:16: error: 'i' was not declared in this scope; did you mean 'vi'?
44 | dp[1] = (a[i] >> 1ll);
| ^
| vi
|
s778579646 | p04020 | C++ | 8
2
0
1
6
0
8
2
1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 8
| ^
|
s555792805 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
bool odd=false;
long sum=0;
for(int i=0;i<N;i++){
int a;
cin >> a;
if(odd){
sum++;
a--:
}
sum+=a/2;
if(a%2==1)odd=true;
else odd=false;
}
cout << sum;
} | a.cc: In function 'int main()':
a.cc:14:10: error: expected ';' before ':' token
14 | a--:
| ^
| ;
|
s325827163 | p04020 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
using namespace std;
int main(void){
int n;cin>>n;vector<int>v(n);
... | cc1plus: error: '::main' must return 'int'
|
s735158843 | p04020 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
using namespace std;
int main(void){
int n;vector<int>v(n);
int an... | cc1plus: error: '::main' must return 'int'
|
s085757891 | p04020 | C++ | #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>
#include <cstdio>
#include <iomanip>
#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... | a.cc: In function 'int main()':
a.cc:39:30: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int, std::vector<long long int>)'
39 | vector<vec> dp(2,vecll(n));
| ^
In file included from /usr/include/c++/14/vector:66,
from /usr/inc... |
s338607480 | p04020 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define LINF 1e18
#define MOD 1000000007
using ... | a.cc: In function 'int main()':
a.cc:42:12: error: 'A' was not declared in this scope
42 | if(A[i]>0&&A[i+1]>0){
| ^
|
s404723465 | p04020 | C++ | #include<bits/stdc++.h>
using namespace std;
define int long long
signed main(){
int n;cin>>n;
vector<int>a(n);
for(auto&& w:a)cin>>w;
int sm=0,cnt=0;
for(int i=0;i<n;i++){
sm+=a[i]/2;
}
for(int i=0;i<n;i++){
if(a[i]%2==1)cnt++;
else {sm+=cnt/2;cnt=0;}
}
if(cnt>0)sm+=cnt/2;
cout<<sm<<endl;
} | a.cc:3:1: error: 'define' does not name a type
3 | define int long long
| ^~~~~~
|
s672457099 | p04020 | C++ | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
using namespace std;
typedef long long ll;
int main(){
int n;
cin>>n;
int val[n];
rep(i, n){
cin>>val[i];}
sort(val,val+n,grater<int>());
... | a.cc: In function 'int main()':
a.cc:15:18: error: 'grater' was not declared in this scope
15 | sort(val,val+n,grater<int>());
| ^~~~~~
a.cc:15:25: error: expected primary-expression before 'int'
15 | sort(val,val+n,grater<int>());
| ^~~
|
s206538807 | p04020 | C++ | #include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using llong = long long;
using ullong = unsigned long long;
#i... | a.cc: In member function 'void AGC003B::Run()':
a.cc:65:39: error: 'i' was not declared in this scope
65 | ans_ += a_collection_[i] / 2;
| ^
|
s145115440 | p04020 | C++ | #include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using llong = long long;
using ullong = unsigned long long;
#i... | a.cc:43:9: warning: #pragma once in main file
43 | #pragma once
| ^~~~
a.cc:45:10: fatal error: Macro.h: No such file or directory
45 | #include "Macro.h"
| ^~~~~~~~~
compilation terminated.
|
s918188917 | p04020 | C++ | #include<bits/stdc++.h>
typedef long long ll;
int n;
ll a[100005];
ll dp[100005][2];
int main(){
cin>>n;
for (int i=1;i<=n;i++) cin>>a[i];
if(a[1]!=0)dp[1][1]=(a[1]-1ll)/2ll;
else dp[1][1]=-1e9;
dp[1][0]=a[1]/2ll;
for (int i=2;i<=n;i++){
if(a[i]==0ll) dp[i][1]=-1e9,dp[i][0]=dp[i-1][0];
else{
dp[i][1]=(a[i... | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>n;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62... |
s541358827 | p04020 | C | #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右
const int N=100005,M=1000005,m... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s521577593 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pll pair<ll,ll>
#define speed_up ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod 1000000007
#define inf 1000000000000000000LL
#define vl vector... | a.cc: In function 'void solve()':
a.cc:35:22: error: invalid operands of types 'long long int [100005]' and 'int' to binary 'operator%'
35 | prv = a%2;
| ~^~
| | |
| | int
| long long int [100005]
|
s356888516 | p04020 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define... | a.cc: In function 'int main()':
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
23 | ans += (a[i]/2);
| ^~~
| abs
|
s043192990 | p04020 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define... | a.cc: In function 'int main()':
a.cc:27:8: error: redeclaration of 'll ans'
27 | ll ans = 0;
| ^~~
a.cc:21:8: note: 'll ans' previously declared here
21 | ll ans = 0;
| ^~~
|
s607664962 | p04020 | 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];
int main()
{
int N;
... | a.cc:40:2: error: stray '#' in program
40 | }#include <bits/stdc++.h>
| ^
a.cc:40:3: error: 'include' does not name a type
40 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:50:10: error: redefinition of 'const ll MOD'
50 | const ll MOD = 1000000007;
| ^~~
a.cc:11:10: note: 'const ll M... |
s088990453 | p04020 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define rep(i, n) for(ll i = 0;i < n;i++)
template<class T, class U> void cmax(T& a, U b) { if (a<b) a = b; }
template<class T, class U> void cmin(T& a, U b) { if (a>b) a = b; }
int main() {
cin.tie(0); ios::sync_with_std... | a.cc: In function 'int main()':
a.cc:19:20: error: 'enld' was not declared in this scope
19 | cout << n/2 << enld;
| ^~~~
|
s797792475 | p04020 | C++ | #include<iostream>
using namespace std;
int arr[100000+50];
int main(){
int n; cin>>n;
long long cnt=0;
for(int i=0;i<n;i++) cin>>arr[i];
for(int i=0;i<n-1;i++){
if(arr[i]%2!=0 && arr[i+1]>0){
cnt+=arr[i]/2+1; arr[i+1]--;
}
else {
cnt+=arr[i]/2;
}
}
cout<<count;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:9: error: 'count' was not declared in this scope; did you mean 'cnt'?
16 | cout<<count;
| ^~~~~
| cnt
|
s880253425 | p04020 | C++ | /*
Author: CNYALI_LK
LANG: C++
PROG: b.cpp
Mail: cnyalilk@vip.qq.com
*/
#include<bits/stdc++.h>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define all(x) x.begin(),x.end()
#... | a.cc:14:13: error: '::main' must return 'int'
14 | #define int ll
| ^~
a.cc:100:1: note: in expansion of macro 'int'
100 | int main(){
| ^~~
|
s750947354 | p04020 | C++ | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int n, a[100500], ans;
int main(){
cin >> n;
for(int i=1;i<=n;i++){
cin >> a[i];
}int cnt = 0;
for(int i=1;i<=n;i++){
if(a[i] == 0){
ans += cnt / 2;
cnt = 0;
continue;
}
cnt += a[i];
}
if(cnt > 0)ans +... | a.cc: In function 'int main()':
a.cc:20:21: error: 's' was not declared in this scope
20 | if(cnt > 0)ans += s / 2;
| ^
|
s323307254 | p04020 | C++ | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int n, a[100500], ans;
int main(){
cin >> n;
for(int i=1;i<=n;i++){
cin >> a[i];
}int cnt = 0;
for(int i=1;i<=n;i++){
if(a[i] == 0){
ans += cnt / 2;
cnt = 0;
continue;
}
cnt += a[i];
}
if(s > 0)ans += ... | a.cc: In function 'int main()':
a.cc:20:6: error: 's' was not declared in this scope
20 | if(s > 0)ans += s / 2;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.