submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s959124260 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int a=0;
for(int i=0; i < s.size(); i++){
if(s.at(i)=="A"){
int b=0;
for(int j=s.at(i); j < s.size(); j++){
b++;
if(s.at(i)=="Z"){
if(a < b) b=a;
break;
}
}
}
}
... | a.cc: In function 'int main()':
a.cc:8:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(s.at(i)=="A"){
| ~~~~~~~^~~~~
a.cc:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(s.at(i)=="Z"){
| ... |
s949717614 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int a=0;
for(int i=0; i < s.size(); i++){
if(s.at(i)==A){
int b=0;
for(int j=s.at(i); j < s.size(); j++){
b++;
if(s.at(i)==Z){
if(a < b) b=a;
break;
}
}
}
}
cou... | a.cc: In function 'int main()':
a.cc:8:17: error: 'A' was not declared in this scope
8 | if(s.at(i)==A){
| ^
a.cc:12:21: error: 'Z' was not declared in this scope
12 | if(s.at(i)==Z){
| ^
|
s159282668 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
return m;
}... | a.cc: In function 'int main()':
a.cc:31:14: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
31 | string s,a=200010,z=0;
| ^~~~~~
a.cc:34:24: error: no matching function for call to 'min(std::string&, int&)'
34 | if(s[i]=='A'... |
s579683330 | p03814 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main() {
bool flag = false;
string s;
cin >> s;
int i = 0;
int n = 1;
while (s[i] != 'Z') { | a.cc: In function 'int main()':
a.cc:16:30: error: expected '}' at end of input
16 | while (s[i] != 'Z') {
| ~^
a.cc:16:30: error: expected '}' at end of input
a.cc:9:12: note: to match this '{'
9 | int main() {
| ^
|
s209007834 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
string s;
cin >> s;
vector<int> As, Zs;
for (int i = 0; i < s.length(); i++){
if (s[i] == 'A'){
... | a.cc: In function 'int main()':
a.cc:19:19: error: 'class std::vector<int>' has no member named 'length'
19 | cout << Zs[Zs.length() - 1] - As[0] + 1 << endl;
| ^~~~~~
|
s440558101 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int A,Z;
for (int i = 0; i < s.size(); i++){
if (s[i]=='A'){
A = i;
break;
}
}
for (int i = s.size - 1; i >= 0; i--){
if (s[i]=='Z'){
Z = i;
break;
}
}
cout << Z-A+1;
} | a.cc: In function 'int main()':
a.cc:13:18: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig... |
s986890104 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
char s[200001];
cin >> s;
int len = strlen(s)
int a_idx, z_idx;
for(int i = 0; i < len; ++i){
if(s[i] == 'A'){
a_idx = i;
break;
}
}
for(int i = 0; i < len; ++i){
if(s[i] == ... | a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'int'
9 | int a_idx, z_idx;
| ^~~
a.cc:14:13: error: 'a_idx' was not declared in this scope
14 | a_idx = i;
| ^~~~~
a.cc:22:13: error: 'z_idx' was not declared in this scope
22 | ... |
s205627777 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
char s[200001];
cin >> s;
int a_idx, z_idx;
for(int i = 0; i < s.length(); ++i){
if(s[i] == 'A'){
a_idx = i;
break;
}
}
for(int i = 0; i < s.length(); ++i){
if(s[i] == 'Z'){
... | a.cc: In function 'int main()':
a.cc:10:26: error: request for member 'length' in 's', which is of non-class type 'char [200001]'
10 | for(int i = 0; i < s.length(); ++i){
| ^~~~~~
a.cc:18:26: error: request for member 'length' in 's', which is of non-class type 'char [200001]'
... |
s279896902 | p03814 | Java | static Scanner sc = new Scanner(System.in);public static void main(String args[]){String s = sc.next();System.out.println(s.lastIndexOf('Z')-s.indexOf('A')+1);}} | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
static Scanner sc = new Scanner(System.in);public static void main(String args[]){String s = sc.next();System.out.println(s.lastIndexOf('Z')-s.indexOf('A')+1);}}
^
(use --enable-preview to enable unnamed classes)
Main.java:1... |
s080490284 | p03814 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
string s;
cin >> s;
int foundA = 0;
int mini = 0;
int maxi = 0;
int length = s.length()
for (int i = 0; i < length; i++)
{
if (s[i] == 'A' && foundA == 0)
{
mini = i;
foundA... | a.cc: In function 'int main()':
a.cc:14:5: error: expected ',' or ';' before 'for'
14 | for (int i = 0; i < length; i++)
| ^~~
a.cc:14:21: error: 'i' was not declared in this scope
14 | for (int i = 0; i < length; i++)
| ^
|
s237277276 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin >> s;
int a, b; a = b = 0;
for (int i = 0; i < N; i++) {
if (s.at(i) = 'A') {
a = i;
break;
}
}
for (int i = 0; i < N; i++) {
if (s.at(s.size() - 1 - i) = 'Z') {
b = i;
break;
}
}
cout << s.si... | a.cc: In function 'int main()':
a.cc:7:23: error: 'N' was not declared in this scope
7 | for (int i = 0; i < N; i++) {
| ^
a.cc:13:23: error: 'N' was not declared in this scope
13 | for (int i = 0; i < N; i++) {
| ^
|
s120729612 | p03814 | C++ | #include <bits/stdc++.h>
#include <math.h>
#include <cmath>
using namespace std;
using std::cout;
using ll =long long;
bool is_int_lround(double x){
return std::lround(x)==x;
}
int ketasuu(int x){
int n=0;
while(x>0){
x /=10 ;
n ++;
}
return n;
}
ll gcd11(ll x, ll y){
long long a= max(x,y), b=min(... | a.cc: In function 'int main()':
a.cc:39:10: error: conflicting declaration 'std::string s'
39 | string s;
| ^
a.cc:38:7: note: previous declaration as 'int s'
38 | int s;
| ^
a.cc:41:19: error: request for member 'size' in 's', which is of non-class type 'int'
41 | for(int i=0;... |
s249040837 | p03814 | C++ | #include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include<bitset>
#include<math.h>
using namespace std;
#define INF 110000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
int main(){
string s;
cin>>s
int numA,numZ;
for(numA=0... | a.cc: In function 'int main()':
a.cc:17:9: error: expected ';' before 'int'
17 | cin>>s
| ^
| ;
18 | int numA,numZ;
| ~~~
a.cc:19:7: error: 'numA' was not declared in this scope
19 | for(numA=0;;numA++){
| ^~~~
a.cc:23:7: error: 'numZ' was not declared ... |
s858418451 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
int a,z;
if(n==1){printf("0"); return 0;}
for(int i=0;i<n;i++){
if(s[i]=='A'){
a=i;
break;
}
}
for(int i=0;i<n;i++){
if(s[i]=='Z'){
z=i;
}
}
... | a.cc: In function 'int main()':
a.cc:10:8: error: 'n' was not declared in this scope
10 | if(n==1){printf("0"); return 0;}
| ^
a.cc:11:19: error: 'n' was not declared in this scope
11 | for(int i=0;i<n;i++){
| ^
a.cc:17:19: error: 'n' was not declared in this scope
... |
s864056822 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int main () {
cin >> s;
int number_a = 0, number_b = 0;
for (int i = 0; i < s.length(); i++){
if (s[i] == 'A'){
number_a = i;
break;
}
}
for (int i = s.length(); i>=0; i--){
if (s[i] == 'Z'){
number_z = i;
break;
... | a.cc: In function 'int main()':
a.cc:17:7: error: 'number_z' was not declared in this scope; did you mean 'number_b'?
17 | number_z = i;
| ^~~~~~~~
| number_b
a.cc:21:11: error: 'number_z' was not declared in this scope; did you mean 'number_b'?
21 | cout << number_z - number_a + 1... |
s353787660 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std;
index_a=0, index_z=0;
int main(){
string s;cin>>s;
for(int i=0;i<s.size();i++){if(s[i]=='A'){index_a=i;break;}}
for(int i=0;i<s.size();i++){if(s[i]=='Z')index_z=i;}
cout<<index_z-index_a+1<<endl;
} | a.cc:4:1: error: 'index_a' does not name a type
4 | index_a=0, index_z=0;
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:45: error: 'index_a' was not declared in this scope
7 | for(int i=0;i<s.size();i++){if(s[i]=='A'){index_a=i;break;}}
| ^~~~~~~
a.cc... |
s210135234 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string S;cin>>S;
int N=S.size();
for (int i =0;i<N;++i){
if (S[i]=='A'){
int SA=i;
break;
}
}
for (int j =N;j>0;--j){
if (S[j]=='Z'){
int SZ=N-j;
break;
}
}
cout<<SZ-SA<<endl;
}
| a.cc: In function 'int main()':
a.cc:21:9: error: 'SZ' was not declared in this scope; did you mean 'S'?
21 | cout<<SZ-SA<<endl;
| ^~
| S
a.cc:21:12: error: 'SA' was not declared in this scope; did you mean 'S'?
21 | cout<<SZ-SA<<endl;
| ^~
| S
|
s463609928 | 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 s = S.length();
int a = -1, z = 0;
for(int i = 0; i < s; i++){
if(S.charAt(i) == 'A' && a == -1){
a = i;
}else if(S.charAt('Z')){
... | Main.java:12: error: incompatible types: char cannot be converted to boolean
}else if(S.charAt('Z')){
^
1 error
|
s189532078 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
string s;
cin>>s;
int a,z;
rep(i,N){
if (s[i]=='A') a=i;
if (s[s.size()-1-i]=='Z') z=i;
}
cout<<z-a+1<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:9: error: 'N' was not declared in this scope
10 | rep(i,N){
| ^
a.cc:3:45: note: in definition of macro 'rep'
3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
| ^
|
s969087499 | p03814 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s = sc.next();
char[] array = s.toCharArray();
int first = 0;
int end = s.length();
for(int i = 0;i < end;i++){
if(s.substring(i,i+1).equals("A")){
... | Main.java:16: error: incompatible types: String cannot be converted to boolean
if(s.substring(i-1,i)){
^
1 error
|
s208244432 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std ;
int main(){
string s,rs ;
int i,j_1,j_2 ;
cin >> s ;
rs = reverse(s.bigin(),s.end()) ;
for(i=0;i<s.length();i++){
if(s[i]=='A'){
j_1=i;
break ;
}
}
for(i=0;i<rs.length();i++){
if(s[i]=='Z'){
j_2=i;
... | a.cc: In function 'int main()':
a.cc:11:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'bigin'; did you mean 'begin'?
11 | rs = reverse(s.bigin(),s.end()) ;
| ^~~~~
| begin
a.cc:11:8: error: 'reverse' was not declared in thi... |
s315169657 | p03814 | C++ | #include<iostream>
#include<cstring>
int main(){
string s,rs ;
int i,j_1,j_2 ;
std::cin >> s ;
rs = reverse(s.bigin(),s.end()) ;
for(i=0;i<s.length();i++){
if(s[i]=='A'){
j_1=i;
break ;
}
}
for(i=0;i<rs.length();i++){
if(s[i]=='Z'){
j_2=i;
break ;
}
... | a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s,rs ;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostre... |
s141114849 | p03814 | C++ | #include<iostream>
#include<cstring>
using namespace std ;
int main(){
string s,rs ;
int i,j_1,j_2 ;
cin >> s ;
rs = reverse(s.bigin(),s.end()) ;
for(i=0;i<s.length();i++){
if(s[i]=='A'){
j_1=i;
break ;
}
}
for(i=0;i<rs.length();i++){
if(s[i]=='Z'){
j_2=i;
... | a.cc: In function 'int main()':
a.cc:11:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'bigin'; did you mean 'begin'?
11 | rs = reverse(s.bigin(),s.end()) ;
| ^~~~~
| begin
a.cc:11:8: error: 'reverse' was not declared in thi... |
s612186560 | p03814 | C++ | #include<iostream>
#include<cstring>
using namespace std ;
int main(){
string s,rs ;
int i,j_1,j_2 ;
cin >> s ;
rs = reverse(s.bigin(),s.end())
for(i=0;i<s.length();i++){
if(s[i]=='A'){
j_1=i;
break ;
}
}
for(i=0;i<rs.length();i++){
if(s[i]=='Z'){
j_2=i;
... | a.cc: In function 'int main()':
a.cc:11:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'bigin'; did you mean 'begin'?
11 | rs = reverse(s.bigin(),s.end())
| ^~~~~
| begin
a.cc:11:8: error: 'reverse' was not declared in this ... |
s711085597 | p03814 | C++ | #include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
stirng s;
cin >> s;
int n=s.size();
int i,j;
for(int k=0;k<n;k++){
if(s.at(k) == 'A'){
i = k;
break;
}
}
for(int k=n-1;k>0;k--){
if(s.at(k) =='Z'){
j = k;
break;
}
}
... | a.cc: In function 'int main()':
a.cc:7:3: error: 'stirng' was not declared in this scope
7 | stirng s;
| ^~~~~~
a.cc:8:10: error: 's' was not declared in this scope
8 | cin >> s;
| ^
|
s874441329 | p03814 | C++ | #include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
using namespace std;
int main(){
string s;
int front = 0;
int back = n-1;
for(int i = 0; i < n; i++){
... | a.cc: In function 'int main()':
a.cc:17:14: error: 'n' was not declared in this scope
17 | int back = n-1;
| ^
|
s274364864 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
int main(){
string S;
cin >> S;
int N = S.size();
int a, b;
for(int i = 0; i < N; i++){
if(S.at(i) == 'A'){
a = i;
break;
}
}
for(int i = N - 1; i >= 0; i--){
if(S.at(i) == 'Z'){
b = i;
break;
}
... | a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
24 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s630114063 | p03814 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
string s
cin >> s;
auto posA = s.find("A");
auto posB = s.rfind("Z");
cout << posB - posA + 1 << endl;
}
| a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'cin'
10 | cin >> s;
| ^~~
a.cc:12:15: error: 's' was not declared in this scope
12 | auto posA = s.find("A");
| ^
|
s240168033 | p03814 | C++ | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
// your code goes her
string s;
cin >> s;
vector<char> vec;
for (int i=0;i<s.length();i++){
vec.push_back(s[i]);
}
int a_cnt=0;
int z_cnt =0;
for (int i=0;i<s.length();i++){
if (vec[i]==“A”){
a_cnt =i;
break;
}
}
... | a.cc:20:13: error: extended character “ is not valid in an identifier
20 | if (vec[i]==“A”){
| ^
a.cc:20:13: error: extended character ” is not valid in an identifier
a.cc:26:15: error: extended character “ is not valid in an identifier
26 | if (vec[i] == “Z”)z_cnt =i;
| ^
a.... |
s275878481 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin >> s;
int start=0,end=0,ans=0,count=0;
for(int i=0;i<s.size();i++) {
int count=0;
if(s[i]=="A"){
start=i;
}
if(s[i]=="Z"){
end=i;
count=end-start;
ans=max(count,ans);
start=200001; end=0;
}
}
cout << a... | a.cc: In function 'int main()':
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(s[i]=="A"){
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(s[i]=="Z"){
|
s276650449 | p03814 | C++ | int main() {
string s;
cin >> s;
vector<char> S(s.size());
for (int i=0;i<s.size();i++) {
S.at(i) = s[i];
}
bool cntchk = false;
int cnt,cnta,cntz;
int i = 0;
while (true) {
cnta = i;
if (S.at(i) == 'A') break;
i++;
}
reverse(S.begin(),S.end())... | a.cc: In function 'int main()':
a.cc:2:5: error: 'string' was not declared in this scope
2 | string s;
| ^~~~~~
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> s;
| ^~~
a.cc:3:12: error: 's' was not declared in this scope
3 | cin >> s;
| ^
a.... |
s314818996 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int x, y;
for( int i=0; i<s.length(); i++){
if (s[i]=='A'){
x=s.find_first_of("A");
}
if (s[i]=='z'){
y=s.find_last_of ("z")
}
}
cout <<y-x+1;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:31: error: expected ';' before '}' token
16 | y=s.find_last_of ("z")
| ^
| ;
17 |
18 | }
| ~
|
s789691549 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int a,z;
for(int i = 0; true; i++){
if(s.at(i) == 'A'){
a = i + 1;
break;
}
}
for(int i = n - 1; true; i--){
if(s.at(i) == 'Z'){
z = i + 1;
break;
}
}
cout << z - a + 1 << endl;
}
| a.cc: In function 'int main()':
a.cc:14:15: error: 'n' was not declared in this scope
14 | for(int i = n - 1; true; i--){
| ^
|
s172778302 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int a=0,z=0;
for(int i = 0; i <= s.size() ; i++){
if(s[i] == 'A' and a <= i){a = i;}
else if(s[i] == 'Z'and z <= i){z =i;}
}
cout << z-a+1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:21: error: unable to find character literal operator 'operator""and' with 'char' argument
11 | else if(s[i] == 'Z'and z <= i){z =i;}
| ^~~~~~
a.cc:11:27: error: expected ')' before 'z'
11 | else if(s[i] == 'Z'and z <= i){z =i;}
| ... |
s720961999 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int a=0,z=0;
for(int i = 0; i <= s.size() ; i++){
if(s[i] == 'A' and a <= i){a = i;}
else if(s[i] == 'Z'and z <= i){z =i;}
}
cout << z-a+1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:21: error: unable to find character literal operator 'operator""and' with 'char' argument
11 | else if(s[i] == 'Z'and z <= i){z =i;}
| ^~~~~~
a.cc:11:27: error: expected ')' before 'z'
11 | else if(s[i] == 'Z'and z <= i){z =i;}
| ... |
s043451408 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int a=0,z=0;
for(int i = 0; i <= s.size() ; i++){
if(s[i] == 'A' and i <= a){a = i;}
else if(s[i] == 'Z'and z <= i){z =i;}
}
cout << z-a+1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:21: error: unable to find character literal operator 'operator""and' with 'char' argument
11 | else if(s[i] == 'Z'and z <= i){z =i;}
| ^~~~~~
a.cc:11:27: error: expected ')' before 'z'
11 | else if(s[i] == 'Z'and z <= i){z =i;}
| ... |
s148295039 | p03814 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
char s[200001];
int i,l,a,z;
gets(s);
l = strlen(s);
for(i=0; ; i++){
if(s[i]=='A'){
a=i;
break;
}
}
for(i=l-1; ; i--){
if(s[i]=='Z'){
z=i;
break;
}
}
printf("%d", (z-a)+1);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s814730928 | p03814 | C++ | #include<iostream>
using namespace std;
int main()
{
string s;
int ans=0;
getline(cin,s);
for(int i=0 ;i<=s.length() ;i++ ){
if(s[i]=='A'){
for(int j=0 ;j<=s.length() ;j++ ){
if(s[i]=='Z'){
ans=(j-i)+1;
... | a.cc: In function 'int main()':
a.cc:22:3: error: expected '}' at end of input
22 | }}
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s679798707 | p03814 | C++ | string s;
int c=0;
getline(cin,s);
for(int i=0 ;i<=s.length() ;i++ )
if(s[i]=='A'){
for(int j=0 ;j<=s.length() ;j++ ){
if(s[i]=='Z'){
c =(j-i)+1;
}
}
}
if(c !=0){
... | a.cc:1:1: error: 'string' does not name a type
1 | string s;
| ^~~~~~
a.cc:3:13: error: expected constructor, destructor, or type conversion before '(' token
3 | getline(cin,s);
| ^
a.cc:4:5: error: expected unqualified-id before 'for'
4 | for(int i=0 ;i<=s.length() ;i++ )
... |
s795499823 | p03814 | C++ | #include<iostream>
#include<string>
int main() {
std::string s;
std::cin >> s;
int N = s.size();
int st = 0;
int ed = 0;
for (int i = 0; i < N; i++) {
if (s[i] == 'A') {
st = i;
break;
}
}
reverse(s.begin(), s.end());
for (int i = 0; i < N; i++) {
if (s[i] == 'Z') {
ed = i;
break;
}
... | a.cc: In function 'int main()':
a.cc:20:9: error: 'reverse' was not declared in this scope
20 | reverse(s.begin(), s.end());
| ^~~~~~~
|
s306633737 | p03814 | C++ | #include<iostream>
#include<string>
int main() {
std::string s;
std::cin >> s;
int N = s.size();
int st = 0;
int ed = 0;
for (int i = 0; i < N; i++) {
if (s[i] == 'A') {
st = i;
break;
}
}
std::reverse(s.begin(), s.end());
for (int i = 0; i < N; i++) {
if (s[i] == 'Z') {
ed = i;
break;... | a.cc: In function 'int main()':
a.cc:20:14: error: 'reverse' is not a member of 'std'
20 | std::reverse(s.begin(), s.end());
| ^~~~~~~
|
s436770785 | p03814 | C++ | #include<iostream>
#include<string>
int main() {
std::string s;
std::cin >> s;
int N = s.size();
int st = 0;
int ed = 0;
for (int i = 0; i < N; i++) {
if (s[i] == 'A') {
st = i;
break;
}
}
std::reverse(s.begin(), s.end());
for (int i = 0; i < N; i++) {
if (s[i] == 'Z') {
ed = i;
break;... | a.cc: In function 'int main()':
a.cc:20:14: error: 'reverse' is not a member of 'std'
20 | std::reverse(s.begin(), s.end());
| ^~~~~~~
|
s236918767 | p03814 | C++ | #include<iostream >
#include<string>
using namespace std;
int main()
{
int st,n;
string s;
cin>>s;
int l=s.length();
for(int i=0;i<l;i++)
{
if(s[i]=='A')
{
st=i+1;
break;
}
}
for(int i=0;i<l;i++)
{
if(s[i]=='Z')
{
... | a.cc:1:9: fatal error: iostream : No such file or directory
1 | #include<iostream >
| ^~~~~~~~~~~
compilation terminated.
|
s280966085 | p03814 | C++ | #include<iostream >
using namespace std;
int main()
{
int st,n;
string s;
cin>>s;
int l=s.length();
for(int i=0;i<l;i++)
{
if(s[i]=='A')
{
st=i+1;
break;
}
}
for(int i=0;i<l;i++)
{
if(s[i]=='Z')
{
n=i+1;
... | a.cc:1:9: fatal error: iostream : No such file or directory
1 | #include<iostream >
| ^~~~~~~~~~~
compilation terminated.
|
s032054080 | p03814 | C++ | #include<iostream>
using namespace std;
int main()
{
string s;
cin>>s;
int i=0;
for(;s[i]!='A';++i){
}
for(j=s.length();s[j]!='Z';j--){
}
j++;
cout<<j-i<<"\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:13: error: 'j' was not declared in this scope
10 | for(j=s.length();s[j]!='Z';j--){
| ^
a.cc:14:1: error: 'j' was not declared in this scope
14 | j++;
| ^
|
s496461240 | p03814 | C++ | #include<iostream >
using namespace std;
int main()
{
int st,e;
string s;
cin>>s;
int l=s.length();
for(int i=0;i<l;i++)
{
if(s[i]=='A')
{
st=i+1;
break;
}
}
for(int i=0;i<l;i++)
{
if(s[i]=='Z')
{
e=i+1;
... | a.cc:1:9: fatal error: iostream : No such file or directory
1 | #include<iostream >
| ^~~~~~~~~~~
compilation terminated.
|
s099889339 | p03814 | C++ | int max=0,counter=0,m;
string s;
cin>>s;
for(int i=0;i<s.length();i++){
if(s[i]=='A'){
m=i;
if(counter>0)
break;
for(m;m<s.length();m++){
if(s[m]=='Z'){
counter++;
if(counter>max){
max=counter;
}
}
else
counter++;
}
}
}
cout<<max;
return 0;
}
| a.cc:2:1: error: 'string' does not name a type
2 | string s;
| ^~~~~~
a.cc:3:1: error: 'cin' does not name a type
3 | cin>>s;
| ^~~
a.cc:4:1: error: expected unqualified-id before 'for'
4 | for(int i=0;i<s.length();i++){
| ^~~
a.cc:4:13: error: 'i' does not name a type
4 | for(int i=0;... |
s148661966 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a) (a).begin(),(a... | a.cc: In function 'int main()':
a.cc:41:28: error: 'z' was not declared in this scope
41 | if(s.at(n-1-i) == 'Z') z=i;
| ^
a.cc:44:13: error: 'z' was not declared in this scope
44 | int ans = z-a+1;
| ^
|
s749667505 | p03814 | C++ | l#include<bits/stdc++.h>
using namespace std;
int main()
{
int x,st,e;
string s;
cin>>s;
int l=s.length();
for(int i=0;i<l;i++)
{
if(s[i]=='A')
{
st=i+1;
break;
}
}
for(int i=0;i<l;i++)
{
if(s[i]=='Z')
{
e=i+... | a.cc:1:2: error: stray '#' in program
1 | l#include<bits/stdc++.h>
| ^
a.cc:1:1: error: 'l' does not name a type
1 | l#include<bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
6 | string s;
| ^~~~~~
a.cc:7:5: error: 'cin' ... |
s037839637 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int e,r,a=0;
string s;
cin>>s;
e=s.find("A");
x=s.rfind("Z");
a=(r-e)+1;
cout<<a;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'x' was not declared in this scope
9 | x=s.rfind("Z");
| ^
|
s347645013 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define S... | a.cc: In function 'int main()':
a.cc:35:19: error: 'S' was not declared in this scope
35 | string s;cin >> S;
| ^
|
s620206993 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
if(s.find("A")<s.rfind("Z"))
{
string y=s.substr(s.find("A"),((s.rfind("Z")-
(s.find("A"))+1);
cout<<y.length();
}
else
cout<<0;
} | a.cc: In function 'int main()':
a.cc:9:21: error: expected ')' before ';' token
9 | (s.find("A"))+1);
| ^
| )
a.cc:8:31: note: to match this '('
8 | string y=s.substr(s.find("A"),((s.rfind("Z")-
| ^
a.cc:9:21: error: exp... |
s514458853 | p03814 | C++ | #include<iostream>
using namespace std;
int main()
{
int x,y;
string s;
cin>>s;
for(int i=0;i<s;i++)
{
if(s[i]=='A')
{
x=i+1;
}
if(s[i]=='Z')
{
y=i+1;
}
}
cout<<x-y<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
8 | for(int i=0;i<s;i++)
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<c... |
s619981700 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
if(s.find("A")<s.rfind("Z"))
{
cout<<(s.rfind("Z")-(s.find("A"))+1;
}
else
cout<<0;
} | a.cc: In function 'int main()':
a.cc:8:36: error: expected ')' before ';' token
8 | cout<<(s.rfind("Z")-(s.find("A"))+1;
| ~ ^
| )
|
s721296577 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
if((s.find("A"))>(s.rfind("Z"))
{
string y=s.substr(s.find("A"),s.rfind("Z"));
cout<<y.length();
}
else
cout<<0;
} | a.cc: In function 'int main()':
a.cc:6:32: error: expected ';' before '{' token
6 | if((s.find("A"))>(s.rfind("Z"))
| ^
| ;
7 | {
| ~
a.cc:11:1: error: expected primary-expression before 'else'
11 |... |
s070193086 | p03814 | C++ | #incude<iostream>
using namespace std;
int main(){
string s;
int x,y;
iny sum=0;
X= s.find("A");
Y= s.Rfind("Z");
for(int i=x;i<=y;i++){
sum++;
}
cout<<sum;
return 0;
} | a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
1 | #incude<iostream>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined i... |
s024949318 | p03814 | C++ | #include <bit/stdc++.h>
using namespace std;
int main(){
string s,y;
cin>>s;
y=s.substr(s.find("A"),s.rfind("Z"));
cout<<y.length();
} | a.cc:1:10: fatal error: bit/stdc++.h: No such file or directory
1 | #include <bit/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s468771926 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int X,M,U,T;
string N;
cin>>N;
int len=N.length();
for(int i=0;i<len;i++){
if(N[i]=='A'){
X=i;
T=1;
}
if(T==1)
break;
}
for(int y=len;y>0;y--){
if(N[y]=='Z'){
M=y;
U=1;
}
if(U==1)
break;
}
cout<<M-X+1;
}
إنهاء الدردشة
اكتب رسالة...
| a.cc:28:1: error: '\U00000625\U00000646\U00000647\U00000627\U00000621' does not name a type
28 | إنهاء الدردشة
| ^~~~~
|
s411630335 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string x;
cin>>X;
int a=200000,b=0;
for(int i=0;i<200000;i++){
if(x[i]=='A'){
if(i<a){
a=i;
}
}
if(x[i]=='Z'){
if(i>b){
b=i;
}
}
}
if(b>a){
cout<<b-a+1<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:8: error: 'X' was not declared in this scope
5 | cin>>X;
| ^
|
s483165718 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int rem_A, rem_Z;
for (int i=0; i<s.size(); i++){
if (s.at(i) = A){
rem_A = i;
break;
}
}
for (int i=s.size()-1; i>=0; i--){
if (s.at(i) = Z){
rem_Z = i;
break;
}
}
cout << rem... | a.cc: In function 'int main()':
a.cc:10:19: error: 'A' was not declared in this scope
10 | if (s.at(i) = A){
| ^
a.cc:17:19: error: 'Z' was not declared in this scope
17 | if (s.at(i) = Z){
| ^
|
s281963623 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;cin>>s;
int a,b;
for(int i=;i<s.size();i++){
if(s[i]=='A'){a=i;break;}
}
for(int i=s.size()-1;i>=0;i--){
if(s[i=='Z'){b=i;i--;}
}
cout<<b-a+1<<endl;
} | a.cc: In function 'int main()':
a.cc:7:19: error: expected primary-expression before ';' token
7 | for(int i=;i<s.size();i++){
| ^
a.cc:11:20: error: expected ']' before ')' token
11 | if(s[i=='Z'){b=i;i--;}
| ^
| ]
|
s797270218 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int he, ta;
for (int i=0;;i++){
if(s[i]=='A'){
he=i;
}
}
for (int i=n-1;;i--){
if(s[i]=='Z'){
ta=i;
}
}
cout << ta-he+1 << endl;
}
| a.cc: In function 'int main()':
a.cc:12:14: error: 'n' was not declared in this scope
12 | for (int i=n-1;;i--){
| ^
|
s009631987 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >>s;
int l=s.size();
int mi,ma;
for (int i=0;i<l;i++){
if (s.at(i)=='A'){
mi=i;
break;
}
}
for (int i=l-1;i>-1;i--){
if (s.at(i)=='Z'){
ma=i;
break;
}
}
cout <<mi<<ma<< ma-mi+1<<endl;
}
#i... | a.cc:26:5: error: redefinition of 'int main()'
26 | int main(){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main(){
| ^~~~
|
s136391206 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
int A,B;
vector<int>ans(S.size());
int sum=0;
for(i=0;i<S.size();i++)
if(S.at(i)=='A'){
A=i;
break;
}
}
for(int i=0;i<S.size();i++){
if(S.at(i)=='Z'){
ans.at(i)++;
}
}
for(int i=S.s... | a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
12 | for(i=0;i<S.size();i++)
| ^
a.cc: At global scope:
a.cc:21:1: error: expected unqualified-id before 'for'
21 | for(int i=0;i<S.size();i++){
| ^~~
a.cc:21:13: error: 'i' does not name a type
21 | for(in... |
s243853929 | p03814 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define ... | a.cc: In function 'int main()':
a.cc:82:8: error: 'A' was not declared in this scope
82 | if(A[i]=='A') {
| ^
a.cc:88:8: error: 'A' was not declared in this scope
88 | if(A[i]=='Z'){
| ^
|
s951114455 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int i,a=0,z;
string s;
cin >> s;
for (i=s.size()-1;i>=0;i--) if (s.at(i)=='A') a=i;
for (i=0;i<size();i++) if (s.at(i)=='Z') z=i;
cout << z-a+1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:18: error: no matching function for call to 'size()'
8 | for (i=0;i<size();i++) if (s.at(i)=='Z') z=i;
| ~~~~^~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86... |
s771737087 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin >> s;
int n=s.size();
int a,b,ans,cnta=0;
for(i=0;i<n;i++){
if(s[i]=='A' &&cnta==0){
a=i;
cnta++;
}
if(s[i]=='Z')b=i;
}
cout << b-a+1 << endl;
} | a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
8 | for(i=0;i<n;i++){
| ^
|
s464852254 | p03814 | C++ | #include<iostream>
using namespace std;
int main() {
string s; cin >> s;
int a_index = -1, z_index = 0;
for (int i = 0; i < S.size(); i++) {
if (a_index == -1 && S[i] == 'A') a_index = i;
else if (S[i] == 'Z') z_index = i;
}
int length = z_index - a_index + 1;
cout << length << endl;
} | a.cc: In function 'int main()':
a.cc:7:23: error: 'S' was not declared in this scope
7 | for (int i = 0; i < S.size(); i++) {
| ^
|
s905449218 | p03814 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
typede... | a.cc: In function 'int main()':
a.cc:30:17: error: found ':' in nested-name-specifier, expected '::'
30 | string s: cin >>> s;
| ^
| ::
a.cc:30:16: error: 's' has not been declared
30 | string s: cin >>> s;
| ^
a.cc:30:23: error: qua... |
s036126882 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int n;
n = s.size();
int a = n, b = 0;
for (int i = 0; i < n; i++)
{
if (s.at[i] == 'A')
{
a = min(a, i);
}
if (s.at[i] == 'Z')
{
b = max(b, i);
... | a.cc: In function 'int main()':
a.cc:13:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
13 | if (s.at[i] == 'A')
| ^
a.cc:17:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
17 | if (s.at[i] ==... |
s584327400 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int n;
n = s.size();
int a = n, b = 0;
for (int i = 0; i < n; i++)
{
if (s.at[i] == 'A')
{
a = min(a, i);
}
if (s.at[i] == 'Z')
{
b = max(b, i);
... | a.cc: In function 'int main()':
a.cc:13:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
13 | if (s.at[i] == 'A')
| ^
a.cc:17:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
17 | if (s.at[i] ==... |
s291095140 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int n;
n = s.size();
int a = n, b = 0;
for (int i = 0; i > n; i++)
{
if (s.at[i] == 'A')
{
a = min(a, i);
}
if (s.at[i] == 'Z')
{
b = max(b, i);
... | a.cc: In function 'int main()':
a.cc:13:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
13 | if (s.at[i] == 'A')
| ^
a.cc:17:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
17 | if (s.at[i] ==... |
s443269073 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int s = 0, e;
string ss;
cin >> ss;
int l = ss.size();
for(int i = 0; i < l; i++)
{
if(s[i] == 'A')s = min(s, i);
if(s[i] == 'Z')e = i;
}
printf("%d", e-s+1);
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: invalid types 'int[int]' for array subscript
11 | if(s[i] == 'A')s = min(s, i);
| ^
a.cc:12:9: error: invalid types 'int[int]' for array subscript
12 | if(s[i] == 'Z')e = i;
| ^
|
s369387919 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int s = 0, e;
string s;
cin >> s;
int l = s.size();
for(int i = 0; i < l; i++)
{
if(s[i] == 'A')s = min(s, i);
if(s[i] == 'Z')e = i;
}
printf("%d", e-s+1);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:10: error: conflicting declaration 'std::string s'
6 | string s;
| ^
a.cc:5:7: note: previous declaration as 'int s'
5 | int s = 0, e;
| ^
a.cc:8:13: error: request for member 'size' in 's', which is of non-class type 'int'
8 | int l = ... |
s175623364 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int s = 0, e;
string s;
cin >> s;
for(int i = 0; s[i] != '\0'; i++)
{
if(s[i] == 'A')s = min(s, i);
if(s[i] == 'Z')e = i;
}
printf("%d", e-s+1);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:10: error: conflicting declaration 'std::string s'
6 | string s;
| ^
a.cc:5:7: note: previous declaration as 'int s'
5 | int s = 0, e;
| ^
a.cc:8:19: error: invalid types 'int[int]' for array subscript
8 | for(int i = 0; s[i] != '\0'; i... |
s226467100 | p03814 | C++ | #include<iostream>
using namespace std;
int main()
{
string s;
int res=0;
int count=0;
cin>>s;
>>T>>MeyasuKion;
for(int i=0;i<s.size();i++)
{
if(s.at(i)=='a')
{
for(int j=i;j<s.size();j++)
{
if(s.at(j)=='z')
{
res = (j-i)+1;
count = 1;
}
if(count ==1)
{
count = 0;... | a.cc: In function 'int main()':
a.cc:11:9: error: expected primary-expression before '>>' token
11 | >>T>>MeyasuKion;
| ^~
a.cc:11:11: error: 'T' was not declared in this scope
11 | >>T>>MeyasuKion;
| ^
a.cc:11:14: error: 'MeyasuKion' was not declared in this scope
... |
s789731667 | p03814 | C++ | #include<bits/stdc++.h>
#include<cmath>
using namespace std;
int main(){
string m,n,j,k;
cin>>n;
m=n.size();
for(int i=0;i<m;i++){
if(n[i]=='A'){
j=i
break;
}
}
for(int i=0;i<m;i++){
if(n[m-1-i]=='Z'){
k=m-1-i
break;
}
}
cout<<k-j<<endl;
}
} | a.cc: In function 'int main()':
a.cc:9:16: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
9 | for(int i=0;i<m;i++){
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
... |
s378542005 | p03814 | C++ | #include <iostream>
#include <string>
#include <iomanip>
#include <ios>
using namespace std;
int main(void){
string s;
cin >> s;
int n = s.length();
int begin = 0;
int end = 0;
for(int i=0;i<n;i++){
if(s[i] == 'A'){
begun = i;
break;
}
}
for(int i=n-1;i>=0;i--){
if(s[... | a.cc: In function 'int main()':
a.cc:17:7: error: 'begun' was not declared in this scope; did you mean 'begin'?
17 | begun = i;
| ^~~~~
| begin
|
s192216990 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N;
N = S.size();
int x = 200000;
int y = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'A') {
x = min (X, i);
}
else if (S[i] == 'Z') {
y = max (y, i);
}
}
cout << y - x + 0;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:16: error: 'X' was not declared in this scope
13 | x = min (X, i);
| ^
|
s512068920 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string N;
cin >> N;
for(int i=0;i<N.size();++i){
if(N.at(i)=="A"){
a = i;
}
}
for(int i=N.size();i>=0;--i){
if(N.at(i)=="Z"){
b = i;
}
}
cout << b-a <<endl;
} | a.cc: In function 'int main()':
a.cc:9:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(N.at(i)=="A"){
| ~~~~~~~^~~~~
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(N.at(i)=="Z"){
| ... |
s179427669 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
string N;
cin >> N;
for(int i=0;i<N.size();++i){
if(N.at(i)=='A'){
a = N.size(i);
}
}
for(int i=N.size();i>=0;--i){
if(N.at(i)=='Z'){
b = N.size(i);
}
}
cout << b... | a.cc: In function 'int main()':
a.cc:10:23: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
10 | a = N.size(i);
| ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
... |
s251385743 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
string N;
cin >> N;
for(int i=0;i<N.size();++i){
if(N.at(i)="A"){
a = N.size(i);
}
}
for(int i=N.size();i>0;--i){
if(N.at(i)="Z"){
b = N.size(i);
}
}
cout << b-a<... | a.cc: In function 'int main()':
a.cc:9:20: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
9 | if(N.at(i)="A"){
| ^~~
| |
| const char*
a... |
s407518161 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
string N;
cin >> N;
for(int i=0;i<N.size();++i){
if(N.at(i)=="A"){
a = N.size(i);
}
}
for(int i=N.size();i>0;--i){
if(N.at(i)=="Z"){
b = N.size(i);
}
}
cout << b-... | a.cc: In function 'int main()':
a.cc:9:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(N.at(i)=="A"){
| ~~~~~~~^~~~~
a.cc:10:23: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
10 | a = N.size(i);
... |
s465070094 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
string N;
cin >> N;
for(int i=0; i < N.size();++i){
if(N.at(i) == "A"){
a = i;
}
else if(N.at(i)=="Z"){
b = i;
for(int j=i+1;j<N.size();++j){
if(N.at(j)=="Z"){
... | a.cc:11:15: error: extended character is not valid in an identifier
11 | a = i;
| ^
a.cc:11:15: error: extended character is not valid in an identifier
a.cc:11:15: error: extended character is not valid in an identifier
a.cc:11:15: error: extended character is not valid in an... |
s848480770 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
string N;
cin >> N;
for(int i=0; i < N.size() ;++i){
if(N.at(i) == "A"){
a=i;
}
else if(N.at(i)=="Z"){
b =i;
for(int j=i+1;j<N.size();++j){
if(N.at(j)=="Z"){
... | a.cc:10:13: error: extended character is not valid in an identifier
10 | a=i;
| ^
a.cc:10:13: error: extended character is not valid in an identifier
a.cc:10:13: error: extended character is not valid in an identifier
a.cc:10:13: error: extended character is not valid in an ide... |
s772636937 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
string N;
cin >> N;
for(int i=0; i < N.size() ;++i){
if(N.at(i) == "A"){
a=N.size(i);
}
else if(N.at(i)=="Z"){
b =N.size(i);
for(int j=N.size(i+1);j<N.size();++j){
i... | a.cc:10:21: error: extended character is not valid in an identifier
10 | a=N.size(i);
| ^
a.cc:10:21: error: extended character is not valid in an identifier
a.cc:10:21: error: extended character is not valid in an identifier
a.cc:10:21: error: extended character is not... |
s510376631 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c; //文字数を宣言
string N; //文字列を宣言
cin >> N; //文字列を代入
for(int i=0; i < N.size() ;++i){ //N文字目までループ
if(N.at(i) == "A"){ //Aが出たときの文字数
a=N.size(i);
}
else if(N.at(i)=="Z"){ //Zが出たときの文字数
b =N.size(i... | a.cc:8:37: error: extended character is not valid in an identifier
8 | for(int i=0; i < N.size() ;++i){ //N文字目までループ
| ^
a.cc:9:27: error: extended character is not valid in an identifier
9 | if(N.at(i) == "A"){ //Aが出たときの文字数
| ... |
s704975159 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int count1,count2 = 0;
for (int i = 0; i < str.size(); i++) {
if (str.at(i) == 'A') {
count1=i+1;
break;
}
}
for(int i=str.size()-1;i>0;i--){
if(str.at(i)=='Z'){
count2=i+1;
break;
}
... | a.cc:25:3: error: 'cout' does not name a type
25 | cout << count << endl;
| ^~~~
a.cc:26:1: error: expected declaration before '}' token
26 | }
| ^
|
s263160432 | p03814 | C++ |
if(S.at(i) == 'A'){
flag = true;
ans++;
}else if(S.at(i) == 'Z' && flag == true){
ans++;
flag2 = true;
}else if(S.at(i) != 'Z' && flag2 == true){
flag = false;
flag2 = false;
max_ans = max(max_ans , ans);
ans = 0;
}else if(flag == true){
ans++;
}
}
max_ans =max(ma... | a.cc:2:17: error: expected unqualified-id before 'if'
2 | if(S.at(i) == 'A'){
| ^~
a.cc:7:18: error: expected unqualified-id before 'else'
7 | }else if(S.at(i) == 'Z' && flag == true){
| ^~~~
a.cc:10:18: error: expected unqualified-id ... |
s738894571 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
int min_x=S.size() , max_y = 0;
for(int i = 0; i < S.size(); i++){
if(S.at(i) == 'A'){
min_x = min(min_x, i);
}else if(S.at(i) == 'Z'){
max_y = (max_y, i);
}
}
if(max_y > min_x){
cout << max_y - min_x + 1 << endl;
}
}
/... | a.cc:52:1: error: expected declaration before '}' token
52 | }
| ^
|
s113966812 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
#include <string>
int main() {
string S;
cin>>S;
int A,Z;
for(int i=0 ; i<S.size() ; i++){
if(S[i] =='A'){
A=i+1;
break;
}
}
string sue=std::reverse(S.begin(), S.end());
for(int i=0 ; i<sue.size() ; i++){
if(sue[i] =='Z'){
Z =S.... | a.cc: In function 'int main()':
a.cc:15:26: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
15 | string sue=std::reverse(S.begin(), S.end());
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
|
s551673689 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
int A,Z;
for(int i=0 ; i<S.size() ; i++){
if(S[i] =='A'){
A=i+1;
break;
}
}
string sue=std::reverse(S.begin(), S.end());
for(int i=0 ; i<sue.size() ; i++){
if(sue[i] =='Z'){
Z =S.size()-i;
br... | a.cc: In function 'int main()':
a.cc:14:26: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
14 | string sue=std::reverse(S.begin(), S.end());
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
|
s891421980 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
int A,Z;
for(int i=0 ; i<S.size() ; i++){
if(S[i] =='A'){
A=i+1;
break;
}
}
string sue = reverse(S.begin(), S.end());
for(int i=0 ; i<sue.size() ; i++){
if(sue[i] =='Z'){
Z =S.size()-i;
break... | a.cc: In function 'int main()':
a.cc:14:24: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
14 | string sue = reverse(S.begin(), S.end());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
|
s352913329 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
int A,Z;
for(int i=0 ; i<S.size() ; i++){
if(S[i] =='A'){
A=i+1;
break
}
}
string sue = reverse(S.begin(), S.end());
for(int i=0 ; i<sue.size() ; i++){
if(sue[i] =='Z'){
Z =N-i;
break
}
... | a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before '}' token
11 | break
| ^
| ;
12 | }
| ~
a.cc:14:24: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
14 | string... |
s724744612 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int ans;
cin >> s;
for (int i = 0; i < s.length(); i++) {
if (s[i] - 'A' == 0)break;
for(int j=s.length();j<=0;j--){
if (s[j] - 'Z' == 0) {
ans = j - i + 1;
break;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:9:46: note: to match this '{'
9 | for (int i = 0; i < s.length(); i++) {
| ^
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:5:... |
s490073447 | p03814 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
char c;
int i=1;
int l=100000;
int r=0;
while(cin>>c){
if(c=='A'&&i<l)l=i;
if(c=='Z'&&r<i)r=i;
I++;}
cout<<max(0,r-l+1)<<endl;
} | a.cc: In function 'int main()':
a.cc:12:1: error: 'I' was not declared in this scope
12 | I++;}
| ^
|
s129707274 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int N=s.size();
int i,j
for(i=0;i<N;i++){
if(s[i]=='A'){
break;
}
}
for(j=N-1;j>=0;j--){
if(s[j]=='Z'){
break;
}
}
cout<<j-i+1<<endl;
} | a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'for'
8 | for(i=0;i<N;i++){
| ^~~
a.cc:8:18: error: expected ';' before ')' token
8 | for(i=0;i<N;i++){
| ^
| ;
a.cc:13:7: error: 'j' was not declared in this scope
13 | fo... |
s489686789 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
N=s.size();
for(int i=0;i<N;i++){
if(s[i]=='A'){
break;
}
}
for(int j=N-1;j>=0;j--){
if(s[j]=='Z'){
break;
}
}
cout<<j-i+1<<endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'N' was not declared in this scope
6 | N=s.size();
| ^
a.cc:17:9: error: 'j' was not declared in this scope
17 | cout<<j-i+1<<endl;
| ^
a.cc:17:11: error: 'i' was not declared in this scope
17 | cout<<j-i+1<<endl;
| ^... |
s392646023 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=0;i<N;i++){
if(s[i]=='A'){
break;
}
}
for(int j=N-1;j>=0;j--){
if(s[j]=='Z'){
break;
}
}
cout<<j-i+1<<endl;
} | a.cc: In function 'int main()':
a.cc:6:17: error: 'N' was not declared in this scope
6 | for(int i=0;i<N;i++){
| ^
a.cc:11:13: error: 'N' was not declared in this scope
11 | for(int j=N-1;j>=0;j--){
| ^
a.cc:16:9: error: 'j' was not declared in this scope
16 | cou... |
s057909593 | p03814 | C++ | #include<bits/stdc++>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=0;i<N;i++){
if(s[i]=='A'){
break;
}
}
for(int j=N-1;j>=0;j--){
if(s[j]=='Z'){
break;
}
}
cout<<j-i+1<<endl;
} | a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.