submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s448328480 | p03814 | Java | import java.util.*;
import java.io.*;
//A to Z String
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.nextLine();
int aPos = -1;
int zPos = u.length();
for(int i = u.length() - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.... | Main.java:8: error: cannot find symbol
String u = input.nextLine();
^
symbol: variable input
location: class Main
1 error
|
s290404579 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.nextLine();
int aPos = -1;
int zPos = u.length();
for(int i = u.length() - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.equals("A"))
aPos = i;
... | Main.java:15: error: illegal start of expression
public class Main{
^
Main.java:36: error: illegal start of type
for(int j = aPos; j < u.length() - 1; j++){
^
Main.java:36: error: > or ',' expected
for(int j = aPos; j < u.length() - 1; j++){
^
Main.java:36: error: ';' expected
for(i... |
s536459014 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.next();
int aPos = -1;
int zPos = u.length();
for(int i = u.length() - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.equals("A"))
aPos = i;
}... | Main.java:6: error: cannot find symbol
String u = input.next();
^
symbol: variable input
location: class Main
1 error
|
s355487758 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.nextln();
int aPos = -1;
int zPos = u.length();
for(int i = u.length() - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.equals("A"))
aPos = i;
... | Main.java:6: error: cannot find symbol
String u = input.nextln();
^
symbol: variable input
location: class Main
1 error
|
s128821389 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.nextln();
int aPos = -1;
int zPos = u.length();
for(int i = u.length() - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.equals("A"))
aPos = i;
... | Main.java:14: error: illegal start of expression
}public class Main{
^
Main.java:36: error: illegal start of type
for(int j = aPos; j < u.length() - 1; j++){
^
Main.java:36: error: > or ',' expected
for(int j = aPos; j < u.length() - 1; j++){
^
Main.java:36: error: ';' expecte... |
s121156945 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.next();
int aPos = -1;
int zPos = u.length;
for(int i = u.length - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.equals("A"))
aPos = i;
}
f... | Main.java:6: error: cannot find symbol
String u = input.next();
^
symbol: variable input
location: class Main
Main.java:8: error: cannot find symbol
int zPos = u.length;
^
symbol: variable length
location: variable u of type String
Main.java:9: error: cannot find symbol
for(... |
s172889420 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.next();
int aPos = -1;
int zPos = u.length;
for(int i = u.length - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.equals("A"))
aPos = i;
}
f... | Main.java:15: error: ';' expected
for(int j = aPos; j < u.length - 1){
^
1 error
|
s702329130 | p03814 | Java | import java.util.*
public class Main{
public static void main(String[] args){
Scanner inp = new Scanner(System.in);
String u = input.next();
int aPos = -1;
int zPos = u.length;
for(int i = u.length - 1; i > 0; i--){
String chr = u.substring(i - 1,i);
if(chr.equals("A"))
aPos = i;
}
fo... | Main.java:1: error: ';' expected
import java.util.*
^
Main.java:15: error: ';' expected
for(int j = aPos; j < u.length - 1){
^
2 errors
|
s103597853 | p03814 | Java | import java.io.*;
import java.util.*;
public class Exp { // "Main" should be used for most online judges
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
int index = str.indexOf('A');
String ans = "";
for (int i = index; i < str.length(); i++ )
{
... | Main.java:4: error: class Exp is public, should be declared in a file named Exp.java
public class Exp { // "Main" should be used for most online judges
^
1 error
|
s697663990 | p03814 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int maxL = 0;
int start;
for (int i = 0; i < s.length(); i++) {
int L = 0;
if (s.ch... | Main.java:22: error: variable start might not have been initialized
L = i - start;
^
1 error
|
s307003085 | p03814 | C++ | #include <string>
using namespace std;
int main(){
string s;
cin >> s;
int l = -1, r = -1;
for(int i = 0; i < s.size(); i++)
if(s[i] == 'A'){
l = i;
break;
}
for(int i = s.size()-1; i >= 0; i--)
if(s[i] == 'Z'){
r = i;
break;
}
if(l == -1 || r == -1 || r < l)
cout << 0 << endl;
else
cout... | a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin >> s;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <string>
+++ |+#include <iostream>
2 | using n... |
s474634382 | p03814 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <iomanip>
int main()
{
std::string s;
std::cin >> s;
long long start = -1;
long long ans ... | a.cc: In function 'int main()':
a.cc:28:39: error: no matching function for call to 'max(long long int&, long long unsigned int)'
28 | ans = std::max(ans, i - start + 1);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s380841106 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
char ch[200010];
gets(ch);
int len=strlen(ch);
int ansa=0,ansb;
for(int i=0;i<len;i++){
if(ch[i]=='A'){
if(ansa) continue;
ansa=i;
}
if(!ansa) continue;
if(ch[i]=='Z'){
ansb=i... | a.cc: In function 'int main()':
a.cc:5:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
5 | gets(ch);
| ^~~~
| getw
|
s141085550 | p03814 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
char s[200002];
int s;
int i,j,k,max=0,count=0;
while((c=getchar())!='\n'){
s[i]=c;
i++;
}
for(j=0;j=i;j++){
if(s[i]='A'){
k=i;
while(s[k]!='Z'){
count++;
k++;
... | main.c: In function 'main':
main.c:6:9: error: conflicting types for 's'; have 'int'
6 | int s;
| ^
main.c:5:10: note: previous declaration of 's' with type 'char[200002]'
5 | char s[200002];
| ^
main.c:8:12: error: 'c' undeclared (first use in this function)
8 | whi... |
s766939794 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
char AZ[] = { "A", "Z" };
int x, y;
cin >> s;
for (int i = 0; i < s.size(); i++){
if (s[i] == AZ[0]){ x = i; }
}
for (int j = 0; j < s.size(); j++){
if (s[j] == AZ[1]){ y = j; }
}
cout << y - x << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:32: error: too many initializers for 'char []'
6 | char AZ[] = { "A", "Z" };
| ^
|
s658520045 | p03814 | Java | import java.io.BufferedReader;
import java.io.InputStream;
import java.io.IOException;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(
new InputStream(System.in));
String s = br.readLine();
int idxA =0;
for(int i=0; i<s.length(); i+... | Main.java:8: error: InputStream is abstract; cannot be instantiated
new InputStream(System.in));
^
1 error
|
s673476364 | p03814 | Java |
import java.util.Scanner;
public class B {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
char A[] = new char[200000];
A = sc.next().toCharArray();
int max=1;
int count=0;
boolean flag=false;
for(int i=0;i<A.length;i++){
if(A[i]=='... | Main.java:4: error: class B is public, should be declared in a file named B.java
public class B {
^
1 error
|
s783097418 | p03814 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
string a;
int A,s,e;
int main(void){
A=0;
cin>>a;
for(int i=0;i<a.size();i++){
if(a[i]=='A'){
s=i;
break;
}
for(int i=0;i<a.size();i++){
if(a[i]=='Z'){
e=i;
}
}
cout<<e-s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:7:15: note: to match this '{'
7 | int main(void){
| ^
|
s789840704 | p03814 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
string a;
int A,s,e;
int main(void){
A=0;
cin>>a;
for(int i=0;i<a.size();i++){
if(a[i]=='A'){
s=i;
for(i=a.size();i>0();i--){
if(a[i]=='Z'){
e=i;
break;
}
}
}
}
cout<<e-s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:35: error: expression cannot be used as a function
13 | for(i=a.size();i>0();i--){
| ~^~
|
s546461663 | p03814 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
string a;
int A,s,e;
int main(void){
A=0;
cin>>a;
for(int i=0;i<a.size();i++){
if(a[i]=='A'){
s=i;
for(i=a.size();i>0();i--){
if(a[i]=='Z'){
e=i;
break;
}
}
}
cout<<e-s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:35: error: expression cannot be used as a function
13 | for(i=a.size();i>0();i--){
| ~^~
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:7:15: note: to match this '{'
7 | int main(void){
... |
s148898406 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
int t,u;
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=="A")i=t;
if(s[i]=="Z")i=u;
}
cout<<u-t;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(s[i]=="A")i=t;
a.cc:14:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(s[i]=="Z")i=u;
|
s994291985 | p03814 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
typedef long long ll;
using namespace std;
const ll INF = 1000000000000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;
int main()
{
char S[2000000];
cin >> S;
int a=0,z=0;
bool af=0;
for(int i=0;i<s... | a.cc: In function 'int main()':
a.cc:23:23: error: 'strlen' was not declared in this scope
23 | for(int i=0;i<strlen(S);i++){
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <vector>
+++... |
s576862483 | p03814 | Java | import java.util.Scanner;
public class B_53{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str = sc.next();
int s = -1;
for(int i = 0; i < str.length(); i++){
if(str.charAt(i) == 'A'){
s = i;
break;
}
}
int t = -1;
for(in... | Main.java:3: error: class B_53 is public, should be declared in a file named B_53.java
public class B_53{
^
1 error
|
s272581881 | p03814 | C++ | import java.util.Scanner;
public class Main {
private static Scanner sc=new Scanner(System.in);
private static String line=sc.next();
private static int start,end;
public static void main(String[] args){
char[] c=line.toCharArray();
for(int i=0;i<=c.length-1;i++){
if(c[i]=='A') start=i;
}
for(int i=c.le... | 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:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s767695599 | p03814 | C++ | #include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned long ... | a.cc: In function 'int main()':
a.cc:56:12: error: 'n' was not declared in this scope
56 | rep(i, n)if(s[i] == 'A')break;
| ^
a.cc:26:33: note: in definition of macro 'rep'
26 | #define rep(i, n) for(i = 0;i < n;++i)
| ^
a.cc:57:12: error: 'n' was not dec... |
s823822221 | p03814 | C++ | # coding: utf-8
words=input().rstrip()
a=words.find("A")
z=words.rfind("Z")
print(z-a+1)
| a.cc:1:3: error: invalid preprocessing directive #coding
1 | # coding: utf-8
| ^~~~~~
a.cc:3:1: error: 'words' does not name a type
3 | words=input().rstrip()
| ^~~~~
|
s401827075 | p03814 | C | #include <string.h>
#include<stdio.h>
const int MAX_LEN = 200000;
int main()
{
int x;
char s[MAX_LEN];
printf("Input string s: ");
fgets(s, MAX_LEN, stdin);
int len = strlen(s);
int index = 0, indexA;
strcpy(s, strupr(s));
while(index < len)
{
if (s[index] == 'A')
break;
printf("%c,", s[index]) ;
i... | main.c: In function 'main':
main.c:12:20: error: implicit declaration of function 'strupr'; did you mean 'strstr'? [-Wimplicit-function-declaration]
12 | strcpy(s, strupr(s));
| ^~~~~~
| strstr
main.c:12:20: error: passing argument 2 of 'strcpy' makes pointe... |
s930984948 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int a_index = z_index = -1, S_length = S.size();
for (int i = 0; i < S_length; i++) {
if ( S[i] == "A" && a_index != -1) a_index = i;
if ( S[S_length - i - 1] == "Z" && z_index != -1 ) z_index = S_length - i - 1;
if ( a_ind... | a.cc: In function 'int main()':
a.cc:9:15: error: 'z_index' was not declared in this scope; did you mean 'a_index'?
9 | int a_index = z_index = -1, S_length = S.size();
| ^~~~~~~
| a_index
a.cc:11:21: error: 'S_length' was not declared in this scope
11 | for (int i = 0; i ... |
s020863948 | p03814 | C++ | #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main() {
// your code goes here
string x;
cin >> x;
int ans = x.find_last_of("Z") - x.find_first_of("A")+1;
cout << ans;
return 0; | a.cc: In function 'int main()':
a.cc:12:18: error: expected '}' at end of input
12 | return 0;
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s471165530 | p03814 | C++ | #include<bits/stdc++.h>
#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define ... | a.cc: In function 'int main()':
a.cc:33:21: error: expected unqualified-id before 'int'
33 | int a = 0 , int z = sz(s) - 1;
| ^~~
a.cc:35:17: error: 'z' was not declared in this scope
35 | while(s[z] != 'Z')--z;
| ^
a.cc:36:13: error: 'z' was not dec... |
s500965888 | p03814 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
int a = 0;
int b = 0;
for(int i = 0; i < s.length(); i++) {
if(s.charAt(i) == 'A') {
a = i;
break;
}
}
for(int i = s.leng... | Main.java:21: error: incompatible types: unexpected return value
return b - a + 1;
^
1 error
|
s028409052 | p03814 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>
#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;
typedef long long ll;
ty... | a.cc: In function 'std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)':
a.cc:26:44: error: 'ostream_iterator' is not a member of 'std'
26 | std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
| ^~~~~~~~~~~~~~~~
a.cc:14:1: note: 's... |
s956341671 | p03814 | Java | package AtCoder;
import java.io.*;
public class Main {
public static void main(String[]args){
BufferedReader reader = new BufferedReader (new InputStreamReader (System.in));
String line;
String [] array;
array = line.split("");
int startNumber=0;
int endNumbe... | Main.java:11: error: variable line might not have been initialized
array = line.split("");
^
1 error
|
s783561125 | p03814 | C | #include <stdio.h>
int main(void)
{
char s[200000];
long a,i = 0;
scanf("%s",s);
while(1){
if(text[i] == "A"){
a = i;
i = 200000;
break;
}
else{i++;}
}
while(1){
if(text[i] == "Z"){
a = i - a + 1;
break;
}
else{i--;}+
}
printf("%d",a)
return 0;
} | main.c: In function 'main':
main.c:9:20: error: 'text' undeclared (first use in this function)
9 | if(text[i] == "A"){
| ^~~~
main.c:9:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:9: error: expected expression before '}... |
s892834658 | p03814 | C++ | #include<iostream>
using namespace std;
int main()
{
string str;
int max;
int s = -1;
cin >> str;
for(int i = str.size(); i != 0; --i){
char c = str[i];
if(c == 'a' && s == -1){
s = i;
}
if(c == 'z'){
max = i - s;
}
}
cout >> ma... | a.cc: In function 'int main()':
a.cc:18:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
18 | cout >> max >> endl;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:1... |
s667701193 | p03814 | C++ | #include<iostream>
using namespace std;
int main()
{
int max;
int s = -1;
cin >> str;
for(int i = str.size(); i != 0; --i){
char c = str[i];
if(c == 'a' && s == -1){
s = i;
}
if(c == 'z'){
max = i - s;
}
}
cout >> max >> endl;
} | a.cc: In function 'int main()':
a.cc:7:12: error: 'str' was not declared in this scope; did you mean 'std'?
7 | cin >> str;
| ^~~
| std
a.cc:17:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
17 | cout >>... |
s381134358 | p03814 | C | #include <stdio.h>
int main(void){
char s[200000];
scanf("%s",s);
int i,j,k,l;
for(i=0;i<200000;i++){
if(s[i]=='A'){
j=i;
break;
}
}
for(k=j;k<2000000;k++){
if(s[k]=='Z'){
l=k;
}else if(s[k]=='\n'){
break;
}
int length;
... | main.c: In function 'main':
main.c:22:1: error: expected declaration or statement at end of input
22 | }
| ^
|
s910150872 | p03814 | C | #include <stdio.h>
int main(void){
char s[200000];
scanf("%199999s",s);
int i,j,k,l;
for(i=0;i<200000;i++){
if(s[i]=='A'){
j=i;
break;
}
}
for(k=j;k<2000000;k++){
if(s[k]=='Z'){
l=k;
}
}
int length;
length=l-j+1;
... | main.c: In function 'main':
main.c:19:5: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
19 | prinf(%d,length);
| ^~~~~
| printf
main.c:19:11: error: expected expression before '%' token
19 | prinf(%d,length);
| ... |
s162594423 | p03814 | C | #include <stdio.h>
int main(void){
char s[200000];
scanf("%199999s",s);
int i,j,k,l;
for(i=0;i<200000;i++){
if(s[i]=="A"){
j=i;
break;
}
}
for(k=j;k<2000000;k++){
if(s[k]=="Z"){
l=k;
}
}
int length;
length=l-j+1;
... | main.c: In function 'main':
main.c:7:16: warning: comparison between pointer and integer
7 | if(s[i]=="A"){
| ^~
main.c:13:16: warning: comparison between pointer and integer
13 | if(s[k]=="Z"){
| ^~
main.c:19:5: error: implicit declaration of function 'p... |
s957529087 | p03814 | C | #include <stdio.h>
int main(void){
char s[200000];
scanf("%199999s",s);
int i,j,k,l;
for(i=0;i<200000;i++){
if(s[i]==A){
j=i;
break;
}
}
for(k=j;k<2000000;k++){
if(s[k]==Z){
l=k;
}
}
int length;
length=l-j+1;
pri... | main.c: In function 'main':
main.c:7:18: error: 'A' undeclared (first use in this function)
7 | if(s[i]==A){
| ^
main.c:7:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:18: error: 'Z' undeclared (first use in this function)
13 |... |
s541763983 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int s;
cin >> s;
int a = s.find("a");
int z = s.rfind("z");
cout << z - a + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:19: error: request for member 'find' in 's', which is of non-class type 'int'
9 | int a = s.find("a");
| ^~~~
a.cc:10:19: error: request for member 'rfind' in 's', which is of non-class type 'int'
10 | int z = s.rfind("z");
| ... |
s995691648 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int s;
cin >> s;
int a = s.find();
int z = s.rfind();
cout << z - a + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:19: error: request for member 'find' in 's', which is of non-class type 'int'
9 | int a = s.find();
| ^~~~
a.cc:10:19: error: request for member 'rfind' in 's', which is of non-class type 'int'
10 | int z = s.rfind();
| ... |
s304438364 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int s;
cin >> s;
int a = str.find();
int z = str.rfind();
cout << z - a + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'str' was not declared in this scope; did you mean 'std'?
9 | int a = str.find();
| ^~~
| std
|
s258598119 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int a = -1, z;
for (int i = 0; i < s.size(); i++) {
if (a == -1 && s[i] == "A") {
a = i;
}
if (s[i] == "Z") {
z = i;
}
}
cout << (z - a + 1) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (a == -1 && s[i] == "A") {
a.cc:13:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if (s[i] == "Z") {
|
s572628133 | p03814 | C | #include <stdio.h>
#include <string.h>
int main(void){
char s[200100]={"\0"};
scanf("%s",s);
int loop1;
int st=-1;
int go=-1;
for(loop1=0;loop1<200001;loop1++){
if(st==-1){
if(s[loop1]=="A"){
st=loop1;
}
}
if(st!=-1){
if(s[loop1]=="Z"){
go==loop1;
}
}
}
int ans=go-st;
print("%d\n"... | main.c: In function 'main':
main.c:11:36: warning: comparison between pointer and integer
11 | if(s[loop1]=="A"){
| ^~
main.c:16:36: warning: comparison between pointer and integer
16 | if(s[loop1]=="Z"){
| ... |
s576099139 | p03814 | C++ | # -*- coding: utf-8 -*-
s = input()
l = 1000000
r = 0
for i, c in enumerate(s):
if c == "A":
l = min(l, i)
if c == "Z":
r = i
print(r - l + 1) | a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:2:1: error: 's' does not name a type
2 | s = input()
| ^
|
s472725391 | p03814 | C++ | # -*- coding: utf-8 -*-
s = input()
l = 1000000
r = 0
for i, c in enumerate(s):
if c == "A":
l = min(l, i)
if c == "Z":
r = i
print(r - l + 1) | a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:2:1: error: 's' does not name a type
2 | s = input()
| ^
|
s950726509 | p03814 | C++ | s = input()
l = 1000000
r = 0
for i, c in enumerate(s):
if c == "A":
l = min(l, i)
if c == "Z":
r = i
print(r - l + 1) | a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s964380668 | p03814 | C++ | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#... | a.cc: In function 'int main()':
a.cc:31:47: error: expected primary-expression before 'break'
31 | REP(i,s.length()) if (s[i] == 'A') l = i, break;
| ^~~~~
|
s000286035 | p03814 | C | #include <stdio.h>
#include <string.h>
int main(){
char str[200010];
int len,i,ans=0,flag=0;
scanf("%s",str);
len=strlen(str);
for(i=0;i<len;i++){
if(str[i]=='A' && flag==0){
flag=1;
}
if(flag==1){
count++;
if(str[i]=='Z'){
ans=count;
}
}
}
printf("%d\n... | main.c: In function 'main':
main.c:18:7: error: 'count' undeclared (first use in this function)
18 | count++;
| ^~~~~
main.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
|
s809945518 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In function 'void solve()':
a.cc:23:38: error: no matching function for call to 'min(int&)'
23 | if(S[i]=='A') mia=min(mia);
| ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits... |
s818977185 | p03814 | C++ | #include <stdio.h>
int main(void)
{
int a,b=0,c=0,ans;
char s[200000];
scanf("%s",&s);
for(a=0;a<strlen(s);a++){
if(s[a]=='A'&&c==0){
c=1;
}
if(c==1){
b++;
if(s[a]=='Z'){
ans=b;
}
}
}
printf("%d",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:19: error: 'strlen' was not declared in this scope
8 | for(a=0;a<strlen(s);a++){
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#incl... |
s499223966 | p03814 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
long memo1 = 114514810;
int memo2 = 0;
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.length(); i++) {
if (s[i] == 'A') memo1 = min(memo1, i);
}
for (int j = 0; j < s.length(); j++) {
if (s[j] == 'Z') memo2... | a.cc: In function 'int main()':
a.cc:13:45: error: no matching function for call to 'min(long int&, int&)'
13 | if (s[i] == 'A') memo1 = min(memo1, i);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/includ... |
s591019769 | p03814 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int memo1 = 0;
int memo2 = 0;
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.length; i++) {
if (s[i] == 'A') memo1 = max(memo1, i);
}
for (int j = 0; j < s.length; j++) {
if (s[j] == 'Z') memo2 = max(memo2,... | a.cc: In function 'int main()':
a.cc:12:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s668774815 | p03814 | C++ |
int main() {
string A;
cin >> A;
int a,z;
for (int i = 0; i <= A.size(); i++) {
if (A[i] == 'A') {
a = i;
}
if (A[i] == 'Z') {
z = i;
}
}
cout << z - a+1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
4 | string A;
| ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin >> A;
| ^~~
a.cc:6:16: error: 'A' was not declared in this scope
6 | cin >> A;
... |
s811118892 | p03814 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
char s[200000];
scanf("%s",s);
int i;
while(s[i]!=A)
{
i++;
if(i==strlen(s))
{printf("0"):
return 0;}
}
int t=i;
while(s[t]!=Z)
{
t++;
if(t==strlen(s)&&s[t]!=Z)
{printf("0");
return 0;}
}
printf("%d",t-i+1);
return... | a.cc: In function 'int main()':
a.cc:8:15: error: 'A' was not declared in this scope
8 | while(s[i]!=A)
| ^
a.cc:12:17: error: expected ';' before ':' token
12 | {printf("0"):
| ^
| ;
a.cc:16:15: error: 'Z' was not declared in this scope
16... |
s498107139 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String s=sc.next();
String rev=new StringBuffer(s).reverse().toString();
int l=s.length();
int ctr=0;
int fA=0;
int fZ=0;
while(fA==0){
if(s.charAt(ctr)=='A'){fA=ctr;ctr=0;break;}
ctr++;
}
while(fZ==0){
if(... | Main.java:16: error: bad operand types for binary operator '=='
if(rev==0){fZ=ctr;break;}
^
first type: String
second type: int
1 error
|
s142138166 | p03814 | C++ | #include<stdio.h>
#include<string.h>
int main(){
char ch[200000];
gets(ch);
unsigned a, b;
for(a = 0; ch[a] != 'A'; a++);
for(b = strlen(ch); ch[b] != 'Z'; b--);
printf("%d\n", b - a + 1);
} | a.cc: In function 'int main()':
a.cc:6:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(ch);
| ^~~~
| getw
|
s906789690 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
int loop = 0;
char s[200001];
int len;
int front, back;
front = back = 0;
cin >> s;
len = strlen(s);
while (s[loop++] != 'A')front++;
loop = len + 1;
while (s[loop--] != 'Z')back++;
cout << len - front - back + 2 << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:13:15: error: 'strlen' was not declared in this scope
13 | len = strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring... |
s361200704 | p03814 | C++ | #include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <map>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <set>
#include <queue>
#include <list>
using namespace std;
char s[200010];
int main()
{
int... | a.cc: In function 'int main()':
a.cc:21:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
21 | gets(s);
| ^~~~
| getw
|
s192443316 | p03814 | C++ | #include<bits/stdc++.h>
#define F first
#define S second
#define INF (1<<30)
#define LINF (1LL<<60)
using namespace std;
typedef pair<long long,long long> P;
long long a,b,c,d;
string s,s2,s3;
long long sum=0,ans=0,pos=0;
long long n,m,h,w;
main(){
cin>>s;
n=s.size();
a=0;
b=0;
for(int i=0;i<n;i++){
if(s... | a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
12 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:22:4: error: expected '}' at end of input
22 | }
| ^
a.cc:12:7: note: to match this '{'
12 | main(){
| ^
|
s730806762 | p03815 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void)
{
long long x;
cin >> x;
cout << (2*x + 10)/11; << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:28: error: expected primary-expression before '<<' token
8 | cout << (2*x + 10)/11; << endl;
| ^~
|
s825669453 | p03815 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pi> vpi;
typedef vector<vi> vii;
typedef map<int, int> mp;
typedef multiset<int> mset;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef ... | a.cc: In function 'int main()':
a.cc:76:10: error: statement cannot resolve address of overloaded function
76 | endl;
| ^
|
s144145358 | p03815 | C++ |
#include<bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using hea... | a.cc: In function 'int main()':
a.cc:111:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
111 | ans = 1;
| ^~~
| abs
|
s656505804 | p03815 | 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()
{
int x;
cin >> x;
ll ans;
if(x<=6) ans = 1;
else if(x<=11) ans = 2;
else{
ans = (x/11)*2;
x%11 <= 6 ? ans++ : ans+=2;
if(x%11 == 0) ans--;
}
... | a.cc: In function 'int main()':
a.cc:17:24: error: expected ';' before 'return'
17 | cout << ans << endl
| ^
| ;
18 | return 0;
| ~~~~~~
|
s208680454 | p03815 | 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()
{
int x;
cin >> x;
ll ans;
if(x<=6) ans = 1;
else if(x<=11) ans = 2;
else{
ans = (x/11)*2;
x%11 <= 6 ? ans++ : ans+=2;
if(n%11 == 0) ans--;
}
... | a.cc: In function 'int main()':
a.cc:15:12: error: 'n' was not declared in this scope
15 | if(n%11 == 0) ans--;
| ^
a.cc:17:24: error: expected ';' before 'return'
17 | cout << ans << endl
| ^
| ;
18 | return 0;
| ... |
s828868197 | p03815 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll x;
cin >> x;
ll ans = (x/11) * 2;
if (x % 11 == 0) {
continue;
} else if (x % 11 <= 5) {
ans += 1;
} else {
ans += 2;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:12:5: error: continue statement not within a loop
12 | continue;
| ^~~~~~~~
|
s806092164 | p03815 | C++ | #include <bits/stdc++.h>
#include <math.h>
#define ALL(a) a.begin(), a.end()
#define rep(i, K, N) for(int i = K; i < N; i++)
#define ll long long int
using namespace std;
int main() {
ll K;cin >> x;
if(x%11 <= 6)cout << (x/11)*2 + 1;
else cout << (x/11)*2 + 2;
} | a.cc: In function 'int main()':
a.cc:8:13: error: 'x' was not declared in this scope
8 | ll K;cin >> x;
| ^
|
s085269310 | p03815 | C | #include <stdio.h>
int main(){
long x, z, y=0;
scanf("%ld",&x);
z=x;
result+=(z/11)*2;
z=z%11;
if(7<=z){
result+=2;
} else if(1<=z && z<7) {
result+=1;
}
printf("%ld",y);
} | main.c: In function 'main':
main.c:8:3: error: 'result' undeclared (first use in this function)
8 | result+=(z/11)*2;
| ^~~~~~
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
|
s434328090 | p03815 | C | #include <stdio.h>
int main(){
long x, z, y=0;
scanf("%ld",&x);
tmp=x;
result+=(z/11)*2;
z=z%11;
if(7<=z){
result+=2;
} else if(1<=z && z<7) {
result+=1;
}
printf("%ld",y);
} | main.c: In function 'main':
main.c:6:3: error: 'tmp' undeclared (first use in this function)
6 | tmp=x;
| ^~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:3: error: 'result' undeclared (first use in this function)
8 | result+=(z/11)*2;
... |
s290957257 | p03815 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int x;
cin>>x;
int ans=0;sum=0;
while(true){
sum+=6;
ans++;
if(sum>=x){
break;
}
sum+=5;
ans++;
if(sum>=x){
break;
}
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:6:13: error: 'sum' was not declared in this scope
6 | int ans=0;sum=0;
| ^~~
|
s498065261 | p03815 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
long x = Long.parseLong(sc.next());
long ans = (x / 11) * 2;
if(x % 11 == 0)
else if(x % 11 <= 6) ans++;
else ans += 2;
Sys... | Main.java:9: error: 'else' without 'if'
else if(x % 11 <= 6) ans++;
^
1 error
|
s629830288 | p03815 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < n; ++i)
using namespace std;
const int INF = 2147483647;
using ll = long long;
int main() {
ll x;
cin >> x;
ll a=0;
ll ans;
long double b =11;
if(x %b>0 && x%b<=6) a=1;
if(x % b == 0)
ans = (x/b)*2-a;
else
ans =... | a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'll' {aka 'long long int'} and 'long double' to binary 'operator%'
13 | if(x %b>0 && x%b<=6) a=1;
| ~ ^~
| | |
| | long double
| ll {aka long long int}
a.cc:13:19: error: invalid op... |
s132556485 | p03815 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < n; ++i)
using namespace std;
const int INF = 2147483647;
using ll = long long;
int main() {
ll x;
cin >> x;
ll a=0;
ll ans;
long double b =11;
if(x %b>0 && x%b<6) a=1;
if(x % b == 0)
ans = (x/b)*2-a;
else
ans = ... | a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'll' {aka 'long long int'} and 'long double' to binary 'operator%'
13 | if(x %b>0 && x%b<6) a=1;
| ~ ^~
| | |
| | long double
| ll {aka long long int}
a.cc:13:19: error: invalid ope... |
s638016988 | p03815 | C++ | #include<bits/stdc++.h>
long long n,ans=0,x;
int main(){
return std::cin>>x,n=std::ceil(n/11.0),ans=std::ceil(n/11.0)*2,std::cout<<ans-*(bool)(x*11-n>=5)<<std::endl,0;
} | a.cc: In function 'int main()':
a.cc:4:81: error: invalid type argument of unary '*' (have 'bool')
4 | return std::cin>>x,n=std::ceil(n/11.0),ans=std::ceil(n/11.0)*2,std::cout<<ans-*(bool)(x*11-n>=5)<<std::endl,0;
| ^~~~~~~~~~~~... |
s671021081 | p03815 | C++ | #include<bits/stdc++.h>
int main(int n,int ans=0,int x){
return std::cin>>x,n=std::ceil(n/11.0),ans=std::ceil(n/11.0)*2,std::cout<<ans-(x*11-n>=5)<<std::endl,0;
} | a.cc:2:5: warning: second argument of 'int main(int, int, int)' should be 'char **' [-Wmain]
2 | int main(int n,int ans=0,int x){
| ^~~~
a.cc:2:5: warning: third argument of 'int main(int, int, int)' should probably be 'char **' [-Wmain]
a.cc:2:30: error: default argument missing for parameter 3 of 'int m... |
s564227903 | p03815 | C++ | #include<bits/stdc++.h>
int main(long long n,long long ans=0,long long x){
return std::cin>>x,n=std::ceil(n/11.0),ans=std::ceil(n/11.0)*2,std::cout<<ans-(x*11-n>=5)<<std::endl,0;
} | a.cc:2:5: warning: first argument of 'int main(long long int, long long int, long long int)' should be 'int' [-Wmain]
2 | int main(long long n,long long ans=0,long long x){
| ^~~~
a.cc:2:5: warning: second argument of 'int main(long long int, long long int, long long int)' should be 'char **' [-Wmain]
a.c... |
s816813762 | p03815 | C++ | #include<bit/stdc++.h>
using namespace std;
int main()
{
long long a;
while(cin>>a)
{
long long mod=11,s=a/11*2;
a%=1;
if(a>=1&&a<=6)s++;
if(a>=7&&a<=10)s+=2;
cout<<s<<endl;
}
} | a.cc:1:9: fatal error: bit/stdc++.h: No such file or directory
1 | #include<bit/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s332638865 | p03815 | C++ | #include<bit/stdc++.h>
using namespace std;
int main()
{
long long a;
while(cin>>a)
{
long long mod=11,s=a/11*2;
a%=1;
if(a>=1&&a<=6)s++;
if(a>=7&&a<=10)s+=2;
cout<<s<<endl;
}
} | a.cc:1:9: fatal error: bit/stdc++.h: No such file or directory
1 | #include<bit/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s168083358 | p03815 | C++ | #include<bit/stdc++.h>
using namespace std;
int main()
{
long long a;
while(cin>>a)
{
long long mod=11,s=a/11*2;
a%=1;
if(a>=1&&a<=6)s++;
if(a>=7&&a<=10)s+=2;
cout<<s;
}
} | a.cc:1:9: fatal error: bit/stdc++.h: No such file or directory
1 | #include<bit/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s417677184 | p03815 | C++ | #include <bits/stdc++.h>
#define PI 3.141592653
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size()) //size() unsigned -> int
#define descSort(a) sort(a.begin(),a.end(),std::greater<int>())
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;
ll gcd(ll x,ll y){
if(x%y==0)return... | a.cc: In function 'int main()':
a.cc:20:8: error: redeclaration of 'll tmp'
20 | ll tmp=11*(ans-1);
| ^~~
a.cc:16:14: note: 'll tmp' previously declared here
16 | ll ans=0,tmp=0;
| ^~~
|
s654990152 | p03815 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric>
#include <set>
#include <cstdlib>
#include <queue>
#include <map>
using namespace std;
typedef long long llint;
typedef long double ld;
#define inf 1e18
#define mod 1000000007
priority_queue<llint,vector<l... | a.cc: In function 'void solve()':
a.cc:28:20: error: expected ';' before 'else'
28 | if(x%11==0)ans+=0
| ^
| ;
29 | else if(x%11>6)ans+=2;
| ~~~~
|
s539496395 | p03815 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<vector<int>> vvi;
typedef vector<vector<string>> vvs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef pair<i... | a.cc: In function 'int main()':
a.cc:24:33: error: expected ';' before '}' token
24 | if(b <= 6){b = 1;}else{b = 2};
| ^
| ;
|
s597008680 | p03815 | C++ | //
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
long long x; cin>>x;
long long ans = x /11;
if(ans*11 == x){a
cout<<ans*2<<endl;
}
else if(x-ans*11 > 6){
ans++;
cout<<ans*2<<endl;
}
else{
ans = ans*2;
ans++;
cout<<ans<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:25: error: 'a' was not declared in this scope
11 | if(ans*11 == x){a
| ^
|
s261257950 | p03815 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll n;cin>>n;cout<<(ll)2*(n/11)+1+(n%11)/6;
} | a.cc:5:1: error: extended character is not valid in an identifier
5 | ll n;cin>>n;cout<<(ll)2*(n/11)+1+(n%11)/6;
| ^
a.cc: In function 'int main()':
a.cc:5:1: error: 'll\U00003000n' was not declared in this scope
5 | ll n;cin>>n;cout<<(ll)2*(n/11)+1+(n%11)/6;
| ^~~~~
a.cc:5:12: error: 'n' was not ... |
s079788185 | p03815 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#in... | a.cc: In function 'void solve()':
a.cc:78:11: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
78 | cout<0<<endl;
| ~^~~~~~
|
s321848024 | p03815 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
int main () {
long long x;
ans, k;
cin >> x;
ans += (x/11)*2;
k = x%11;
if (0<k && k<=6) {
ans += 1;
}
else if (6<k){
ans += 2;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
7 | ans, k;
| ^~~
| abs
a.cc:7:10: error: 'k' was not declared in this scope
7 | ans, k;
| ^
|
s718123741 | p03815 | C++ | #include<iostream>
using namespace std;
int main () {
long long x;
ans, k;
cin >> x;
ans += (x/11)*2;
k = x%11;
if (k>0) {
if (k<=6){
ans += 1;
}
else {
ans += 2;
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
6 | ans, k;
| ^~~
| abs
a.cc:6:10: error: 'k' was not declared in this scope
6 | ans, k;
| ^
|
s236580212 | p03815 | C++ | #include<iostream>
using namespace std;
int main () {
long long x;
ans, k;
cin >> x;
ans += (x/11)*2;
k = x%11;
if (k!=0) {
if (0<k && k<=6){
ans += 1;
}
else {
ans += 2;
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
6 | ans, k;
| ^~~
| abs
a.cc:6:10: error: 'k' was not declared in this scope
6 | ans, k;
| ^
|
s030480624 | p03815 | C++ | #include<iostream>
using namespace std;
int main (){
long long x;
ans=0,k=0;
cin >> x;
ans += (x/11)*2;
k = x%11;
if (k!=0) {
if (0<k && k<=6){
ans += 1;
}
esle {
ans += 2;
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
6 | ans=0,k=0;
| ^~~
| abs
a.cc:6:11: error: 'k' was not declared in this scope
6 | ans=0,k=0;
| ^
a.cc:16:9: error: 'esle' was not declared in this scope
16 ... |
s168506238 | p03815 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long x;
cin>>x;
long long ans=x/11;
if(x%11==0){
cout<<2*ans<<endl;
}else(x%11<=6){
cout<<2*ans+1<<endl;
}else{
cout<<2*ans+2<<endl;
}
} | a.cc: In function 'int main()':
a.cc:11:17: error: expected ';' before '{' token
11 | }else(x%11<=6){
| ^
| ;
a.cc:13:4: error: 'else' without a previous 'if'
13 | }else{
| ^~~~
|
s055134504 | p03815 | C++ | //#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0... | a.cc: In function 'int main()':
a.cc:8:13: error: expected primary-expression before 'long'
8 | #define int long long
| ^~~~
a.cc:20:15: note: in expansion of macro 'int'
20 | ans = int(x / 11) * 2;
| ^~~
|
s962004696 | p03815 | C++ | //#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0... | a.cc: In function 'int main()':
a.cc:8:13: error: expected primary-expression before 'long'
8 | #define int long long
| ^~~~
a.cc:20:15: note: in expansion of macro 'int'
20 | ans = int(x / 11) * 2;
| ^~~
|
s748250459 | p03815 | C++ | import sys
x = int(input())
a = (x // 11) * 2
if x % 11 == 0 :
print(a)
elif x%11 <= 6 :
print(a+1)
else :
print(a+2) | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s321971190 | p03815 | C++ | <?php
$n = fgets(STDIN);
$ans = floor($n / 11) * 2;
$t = $n % 11;
if($t > 6){
$ans+=2;
}
else if($t > 0){
$ans++;
}
echo $ans;
?> | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:3:1: error: '$ans' does not name a type
3 | $ans = floor($n / 11) * 2;
| ^~~~
a.cc:4:1: error: '$t' does not name a type
4 | $t = $n % 11;
| ^~
a.cc:5:1: error: expected unqualified-id before 'if'
5 | if($t > ... |
s235987245 | p03815 | C++ | int main(void) {
LL x;
cin >> x;
LL ans = x/11*2;
if((x-x/11*11) <= 6){
ans += 1;
}else{
ans += 2;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:2:5: error: 'LL' was not declared in this scope
2 | LL x;
| ^~
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> x;
| ^~~
a.cc:3:12: error: 'x' was not declared in this scope
3 | cin >> x;
| ^
a.cc:5:7: erro... |
s315145686 | p03815 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n,count,ans;
cin>>n;
ans=2*(n/11);
count=x%11;
if(0<count && count<7){
ans+=1;
}else if(7<=count){
ans+=2;
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: 'x' was not declared in this scope
8 | count=x%11;
| ^
|
s932228030 | p03815 | C++ | #include <iostream>
using namespace std;
int main(){
unsigned long long int x;
cin >> x;
//6→5,5→6
unsigned long long int a, b;
a = (x / 11) * 2;
if(x % 11 <= 5) a += 1
else a += 2;
b = (x / 11) * 2;
if(x % 11 <= 6) b += 1;
else b += 2;
cout << min(a, b);
} | a.cc: In function 'int main()':
a.cc:12:25: error: expected ';' before 'else'
12 | if(x % 11 <= 5) a += 1
| ^
| ;
13 | else a += 2;
| ~~~~
|
s917533850 | p03815 | C++ | #include<bits/stdc++.h>
int main(){long long N;cin>>N;long long a=N/11*2,b=N%11;if(1<=b and b<=6)a++;else a+=2;
std::cout<<a<<std::endl;} | a.cc: In function 'int main()':
a.cc:2:24: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
2 | int main(){long long N;cin>>N;long long a=N/11*2,b=N%11;if(1<=b and b<=6)a++;else a+=2;
| ^~~
| std::cin
In file included from /usr/include/x... |
s010104849 | p03815 | C++ | #include <iostream>
#include <cstring>
#include <math.h>
using namespace std;
int main()
{
long long x;
cin >> x;
if (x <= 6)
{
cout << 1;
}
if (x <= 11)
{
cout << 2;
}
if (x > 11)
{
if (x % 11 == 0)
{
cout << (long long)(x / 11 * 2);
... | a.cc: In function 'int main()':
a.cc:26:29: error: overloaded function with no contextual type information
26 | remainder = x / 11
| ^~
a.cc:28:17: error: 'rest' was not declared in this scope
28 | if (rest > 6)
| ^~~~
a.cc:30:47: err... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.