submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s582442396 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int l,r;
string s;
cin >> s;
for(int i=0, i<s.length(); i++) {
if(s[i]=='A') {
l=i;
break;
}
}
for(int i=s.length()-1; i>=0; i--) {
if(s[i]=='Z') {
r=i;
break;
}
}
cout << r-l+1 << endl;
}
| a.cc: In function 'int main()':
a.cc:8:17: error: expected ';' before '<' token
8 | for(int i=0, i<s.length(); i++) {
| ^
| ;
a.cc:8:17: error: expected primary-expression before '<' token
|
s293033588 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int l,r;
string s;
cin >> s;
for(int i=0, i<s.size(); i++) {
if(s[i]=='A') {
l=i;
return 0;
}
}
for(int i=s.size()-1; i>=0; i--) {
if(s[i]=='Z') {
r=i;
return 0;
}
}
cout << r-l+1 << endl;
}
| a.cc: In function 'int main()':
a.cc:8:17: error: expected ';' before '<' token
8 | for(int i=0, i<s.size(); i++) {
| ^
| ;
a.cc:8:17: error: expected primary-expression before '<' token
|
s785734383 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int l,r;
string s;
cin >> s;
for(int i=0, i<s.length(); i++) {
if(s[i]=='A') {
l=i;
return 0;
}
}
for(int i=s.length()-1; i>=0; i--) {
if(s[i]=='Z') {
r=i;
return 0;
}
}
cout << r-l+1 << endl;
}
| a.cc: In function 'int main()':
a.cc:8:17: error: expected ';' before '<' token
8 | for(int i=0, i<s.length(); i++) {
| ^
| ;
a.cc:8:17: error: expected primary-expression before '<' token
|
s232072094 | p03814 | C++ | #include <iostream>
#include <string>
#include<math.h>
using namespace std;
int main() {
string s
cin >> s;
int a=0;
int z = s.size() - 1;
while (true) {
if (s[a] == 'A') break;
++a;
}
while (true) {
if (s[z] == 'Z')break;
--z;
}
cout << z-a << endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: expected initializer before 'cin'
8 | cin >> s;
| ^~~
a.cc:10:17: error: 's' was not declared in this scope
10 | int z = s.size() - 1;
| ^
|
s432727135 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
string s;
cin >> s;
int countf = 0, countb = 0;
for(char a: s) {
if(a == 'A') break;
else countf++;
}
for(int a = s.size() - 1; i != 0; i--) {
if(s.at(i) == 'Z') break;
else countb++;
}
cout << s.size() - countf - countb << e... | a.cc: In function 'int main()':
a.cc:12:29: error: 'i' was not declared in this scope
12 | for(int a = s.size() - 1; i != 0; i--) {
| ^
|
s306423098 | p03814 | C++ | #include <bits/stdc++.h>
#include <math.h>
#include <string>
using namespace std;
int main() {
string str;
int begin,end;
cin >> str;
for(int i = 0;i < str.size();i++){
if(str.at(i) == 'A'){
begin = i;
break;
}
}
for(int i = str.size() - 1;i > 0;i--){
if(str.at(i) == 'Z'){
... | a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s072743743 | p03814 | C++ | #include <iostream>
using namespace std;
int main()
{
char s[200005];
cin >> s;
int length = strlen(s);
int begin, end;
for(int i=0; i<length; i++){
if(s[i]=='A'){
begin=i+1;
break;
}
}
for(int i=length-1; i>=0; i--){
if(s[i]=='Z'){
... | a.cc: In function 'int main()':
a.cc:8:18: error: 'strlen' was not declared in this scope
8 | int length = 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 <c... |
s565914484 | p03814 | C++ | HASFJGHOGAKZZFEGA | a.cc:1:1: error: 'HASFJGHOGAKZZFEGA' does not name a type
1 | HASFJGHOGAKZZFEGA
| ^~~~~~~~~~~~~~~~~
|
s695390435 | p03814 | C++ | #include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>... | a.cc:30:39: error: redefinition of 'template<class A, class B> bool chmax(A&, const B&)'
30 | template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
| ^~~~~
a.cc:8:39: note: 'template<class A, class B> bool chmax(A&, const B&)' previously de... |
s447762033 | p03814 | C++ | #include<bis/stdc++.h>
using namespace std;
int main(){
string s;cin>>s;
int a=s.find("A");
int b=s.find("B");
cout<<b-a+1;} | a.cc:1:9: fatal error: bis/stdc++.h: No such file or directory
1 | #include<bis/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s839358429 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
int ans,a,z;
bool flag = 0;
cin >> s;
for(int i=0;i<s.size(),i++){
if(s[i] == "A" && flag == false){
a = i;
flag = ture;
}
if(s[i] == "Z") z = i;
}
ans = z-a+1;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:9:29: error: expected ';' before ')' token
9 | for(int i=0;i<s.size(),i++){
| ^
| ;
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(s[i] == "A" && flag =... |
s370511252 | p03814 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
int a,z;
char S[200000];
scanf("%s",S);
for (int a = 0; strcmp(S[i],'A') != 0; ++a);
for (int z = strlen(S); strcmp(S[i],'Z') != 0; --z);
printf("%d\n",z - a);
return 0;
} | main.c: In function 'main':
main.c:10:34: error: 'i' undeclared (first use in this function)
10 | for (int a = 0; strcmp(S[i],'A') != 0; ++a);
| ^
main.c:10:34: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:37: error: p... |
s822884154 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int start, end;
int N = s.size();
for(int i = 0; i < N; i++){
if(s[i] == 'A'){
start == i;
break;
}
}
for(int i = 0; i < N; i++){
if(s[i] == 'Z'){
end == i;
}
}
int ans;
ans = end - start
... | a.cc: In function 'int main()':
a.cc:21:20: error: expected ';' before 'cout'
21 | ans = end - start
| ^
| ;
22 | cout << ans << endl;
| ~~~~
|
s293892570 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int start, end;
int N = s.size();
for(int i = 0; i < N; i++){
if(s[i] == "A"){
start == i;
}
if(s[i] == "Z"){
end == i;
}
}
int ans = end - start;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(s[i] == "A"){
a.cc:13:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if(s[i] == "Z"){
|
s454529483 | p03814 | C++ | #include <cstdio>
char s[200005];
int main()
{
int b,c;
scanf("%s",s);
int len=strlen(s);
for(int i=0;i<len;i++)
{
if(s[i]=='A')
{
b=i;
for (int j = i; j < len; j++)
{
if(s[j]=='Z')
{
c=j;
... | a.cc: In function 'int main()':
a.cc:7:13: error: 'strlen' was not declared in this scope
7 | int len=strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <cstdio>
+++ |+#include <cstring>
... |
s828887113 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int i,f,b,n=s.size();
for(i=0;i<n;i++){
if(s[i]=='A'){
f=i;
break;
}
}
for(i=0;i<n;i++){
if(s[n-1-i]=='Z'){
b=i;break;}
cout<<b-f+1;
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s529690303 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
const int inf = 1e9;
int main() {
string S;
cin>>S;
int N=S.size();
int ans=0;
int a=inf,b=0;
rep(i,N){
if(S[i]=='A')a = min(a,i);
else if(S[i]=='Z')b =max(b,i);
}
ans=b-a+1;
cout<<ans<<endl;
| a.cc: In function 'int main()':
a.cc:17:25: error: expected '}' at end of input
17 | cout<<ans<<endl;
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s935326041 | 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 ans=0;
int a=inf,b=0;
rep(i,N){
if(S[i]=='A')a = min(a,i);
else if(S[i]=='Z')b =max(b,i);
}
ans=b-a+1;
cout<<ans<<endl;
| a.cc: In function 'int main()':
a.cc:10:15: error: 'inf' was not declared in this scope; did you mean 'ynf'?
10 | int a=inf,b=0;
| ^~~
| ynf
a.cc:13:35: error: 'b' was not declared in this scope
13 | else if(S[i]=='Z')b =max(b,i);
| ... |
s906284718 | p03814 | C | #include<stdio.h.
int main(){
char s[200001];
int i = 0, len = 0, a[200000], j, k, count;
scanf("%s", s);
while(s[len]){
if(s[len] = 'A'){
a[i++] = len;
}
len++;
}
for (j = 0; j < i; j++){
for (k = a[j]; k < len; k++){
if(s[k] == 'Z'){
count++;
}
}
}
... | main.c:1:18: error: missing terminating > character
1 | #include<stdio.h.
| ^
main.c:1:9: fatal error: stdio.h.: No such file or directory
1 | #include<stdio.h.
| ^
compilation terminated.
|
s735242033 | p03814 | C++ | #include<iostream>
using namespace std;
int main(){
int a_i=0,z_i=0;
string str;
cin >> str;
for(int i = 0;i < str.size();+;i){
if(str[i]=='a'){
a_i = i;
break;
}
}
for(int i = 0;i < str.size();+;i){
if(str[i]=='z'){
z_i = i;
}
}
cout << a_i - z_i + 1<< endl;
} | a.cc: In function 'int main()':
a.cc:8:33: error: expected primary-expression before ';' token
8 | for(int i = 0;i < str.size();+;i){
| ^
a.cc:8:33: error: expected ')' before ';' token
8 | for(int i = 0;i < str.size();+;i){
| ~ ^
... |
s911421686 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
cin >> s;
for(int i = 0; i < s.size(); i++){
if("A" == s[i]){
for(int j = s.size() - 1; j > i; j--){
if("Z" == s[j]){
cout << j - i + 1;
}
}
... | a.cc: In function 'int main()':
a.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if("A" == s[i]){
a.cc:11:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if("Z" == s[j]){
|
s718567384 | p03814 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i = 0; i<199999; i++)
if (s[i]=='A'){
int a = i;
break;
}
for (int j = 199999; j>=0; j--)
if (s[j]=='Z'){
int b = j;
break;
}
int c = b-a+1;
... | a.cc: In function 'int main()':
a.cc:19:13: error: 'b' was not declared in this scope
19 | int c = b-a+1;
| ^
a.cc:19:15: error: 'a' was not declared in this scope
19 | int c = b-a+1;
| ^
|
s781136333 | p03814 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i = 0; i<199999; i++){
if (s[i]=='A') break;
int a = i;
}
for (int j = 199999; j>=0; j--){
if (s[j]=='Z') break;
int b = j;
}
int c = b-a+1;
cout <... | a.cc: In function 'int main()':
a.cc:17:13: error: 'b' was not declared in this scope
17 | int c = b-a+1;
| ^
a.cc:17:15: error: 'a' was not declared in this scope
17 | int c = b-a+1;
| ^
|
s855120919 | p03814 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i = 0; i<199999; i++){
if (s[i]=='A') break;
}
for (int j = 199999; j>=0; j--){
if (s[j]=='Z') break;
}
int c = j-i+1;
cout << c << endl;
} | a.cc: In function 'int main()':
a.cc:15:13: error: 'j' was not declared in this scope
15 | int c = j-i+1;
| ^
a.cc:15:15: error: 'i' was not declared in this scope
15 | int c = j-i+1;
| ^
|
s179528386 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i = 0; i<199999; i++)
if (s[i]=='A') break;
for (int j = 199999; j>=0; j--)
if (s[j]=='Z') break;
int c = j-i+1;
cout << c << endl;
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'j' was not declared in this scope
12 | int c = j-i+1;
| ^
a.cc:12:15: error: 'i' was not declared in this scope
12 | int c = j-i+1;
| ^
|
s353665103 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i = 0; i<199999; i++)
if (s[i]=='A'){ int a = i;
break;}
for (int j = 199999; j>=0; j--)
if (s[j]=='Z'){ int b = j;
break;}
int c = b-a+1;
cout << c << endl;
} | a.cc: In function 'int main()':
a.cc:14:13: error: 'b' was not declared in this scope
14 | int c = b-a+1;
| ^
a.cc:14:15: error: 'a' was not declared in this scope
14 | int c = b-a+1;
| ^
|
s152300692 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i = 0; i<199999; i++)
if (s[i]=='A'){ int a = i;
break;}
for (int j = 199999; j>=0; j--)
if (s[j]=='Z'){ int b = j;
break;
int c = b-a+1;
cout << c << endl;
} | a.cc: In function 'int main()':
a.cc:14:15: error: 'a' was not declared in this scope
14 | int c = b-a+1;
| ^
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s091679902 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i =199999; i>=0; i--)
if (s[i]=='A') int a = i;
for (int j = 0; j<199999; j++)
if (s[j]=='Z') int b = j;
int c = b-a+1;
cout << c << endl;
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'b' was not declared in this scope
12 | int c = b-a+1;
| ^
a.cc:12:15: error: 'a' was not declared in this scope
12 | int c = b-a+1;
| ^
|
s091763486 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i =199999; i>=0; i--)
if (s[i]=='A') int x = i;
for (int j = 0; j<199999; j++)
if (s[j]=='Z') int y = j;
int z = y-x+1;
cout << z << endl;
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'y' was not declared in this scope
12 | int z = y-x+1;
| ^
a.cc:12:15: error: 'x' was not declared in this scope
12 | int z = y-x+1;
| ^
|
s564112757 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i =199999; i>=0; i--)
if (s[i]='A') int x = i;
for (int j = 0; j<199999; j++)
if (s[j]='B') int y = j;
int z = y-x+1;
cout << z << endl;
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'y' was not declared in this scope
12 | int z = y-x+1;
| ^
a.cc:12:15: error: 'x' was not declared in this scope
12 | int z = y-x+1;
| ^
|
s047452350 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
for (int i =199999; i>=0; i--)
if (s[i]='A') int x = i;
for (int j = 0; j<199999; j++)
if (s[j]='B') int y = j;
cout << y-x+1 << endl;
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'y' was not declared in this scope
12 | cout << y-x+1 << endl;
| ^
a.cc:12:15: error: 'x' was not declared in this scope
12 | cout << y-x+1 << endl;
| ^
|
s590009120 | p03814 | C++ | #include <iostream>
#include <string>
use namespace std;
int main(){
string s;
cin >> s;
for (int i =199999; i>=0; i--)
if (s[i]='A') int x = i;
for (int j = 0; j<199999; j++)
if (s[j]='B') int y = j;
cout << y-x+1 << endl;
} | a.cc:3:1: error: 'use' does not name a type
3 | use namespace std;
| ^~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
6 | string s;
| ^~~~~~
a.cc:6:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
... |
s312924360 | p03814 | C++ | #include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int a = 0;
int z = 0;
for(int i = 0; i < s.length(); i++) {
if(s.at(i) == 'A') a = i;
break;
}
for(... | a.cc: In function 'int main()':
a.cc:18:21: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
18 |... |
s810822230 | p03814 | C++ | #include <iostream>
using namespace std;
int main() {
string s;
int n,i;
i = 0;
cin >> s;
while (s[i] != "\0") {
i++;
}
i--;
int a, b;
a = 0; b = i;
while (s[a] != 'A') {
a++;
}
while (s[b] != 'Z') {
b--;
}
cout << b - a + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | while (s[i] != "\0") {
|
s459429274 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int pos1=0,pos2=0,len=s.size();
len--;
while(s[pos]!='A') pos1++;
while(s[pos]!='Z') pos2--;
int p=pos2-pos1+1;
cout<<p;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:17: error: 'pos' was not declared in this scope; did you mean 'pos2'?
8 | while(s[pos]!='A') pos1++;
| ^~~
| pos2
a.cc:9:17: error: 'pos' was not declared in this scope; did you mean 'pos2'?
9 | while(s[pos]!='Z')... |
s442835115 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int A, Z;
for (int i = 0; i < S.length(); i++) {
if (S[i] == 'A') {
A = i;
break;
}
}
for (int i = S.length() - 1; i = < 0; i--) {
if (S[i] == 'Z') {
Z = i;
break;
}
}
cout << Z - A + ... | a.cc: In function 'int main()':
a.cc:14:36: error: expected primary-expression before '<' token
14 | for (int i = S.length() - 1; i = < 0; i--) {
| ^
|
s303116431 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
stirng S;
cin >> S;
int A, Z;
for (int i = 0; i < S.length(); i++) {
if (S[i] == 'A') {
A = i;
break;
}
}
for (int i = S.length() - 1; i = < 0; i--) {
if (S[i] == 'Z') {
Z = i;
break;
}
}
cout << Z - A + ... | a.cc: In function 'int main()':
a.cc:5:3: error: 'stirng' was not declared in this scope
5 | stirng S;
| ^~~~~~
a.cc:6:10: error: 'S' was not declared in this scope
6 | cin >> S;
| ^
a.cc:14:36: error: expected primary-expression before '<' token
14 | for (int i = S.length() - 1;... |
s758419942 | p03814 | C++ | #include <string>
#include <iostream>
using namespace std;
int main(){
string s,s2;
cin>>s;
s2=s;
reverse(s2.begin(), s2.end());
int i=1;
while (s[i]!='a') {
i++;
}
int k=1;
while (s2[k]!='z') {
k++;
}
int ans=(int)s.length()-i-k;
co... | a.cc: In function 'int main()':
a.cc:11:5: error: 'reverse' was not declared in this scope
11 | reverse(s2.begin(), s2.end());
| ^~~~~~~
|
s782700093 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};
int main()
{
... | a.cc: In function 'int main()':
a.cc:21:26: 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... |
s785761817 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int a,z;
int n=s.size();
for(int i=0;i<n;i++){
if(s.at(i)=='a'){a=i;}
else if(s.at(i)=='z'){z=i;}}
cout<<z-a+1<<endl;
return 0;
} | a.cc:1:1: error: '\U0000ff03include' does not name a type
1 | #include<bits/stdc++.h>
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
4 | string s;
| ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin>>s;
| ^~~
... |
s430286444 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
cin>>s;
int l=s.size();
int A=0,Z=0;
for(int i=0;i<l;i++){
if(s[i]=='A'){
A=i;
break;
}
}
for(int i=l-1,i>=0;i--){
if(s[i]=='Z'){
Z=i;
break;
}
}
cout<<Z-A<<endl;
} | a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before '>=' token
15 | for(int i=l-1,i>=0;i--){
| ^~
| ;
a.cc:15:18: error: expected primary-expression before '>=' token
15 | for(int i=l-1,i>=0;i--){
| ^~
|
s993053042 | p03814 | C++ | #include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int startNum = s.find("A");, endNum = s.rfind("Z");;
cout << s.substr(startNum, endNum); << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:30: error: expected primary-expression before ',' token
7 | int startNum = s.find("A");, endNum = s.rfind("Z");;
| ^
a.cc:7:32: error: 'endNum' was not declared in this scope; did you mean 'enum'?
7 | int startNum = s.find("A");, endN... |
s811148791 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
cout << s.rfint('Z') - s.find('A') + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'rfint'; did you mean 'rfind'?
7 | cout << s.rfint('Z') - s.find('A') + 1 << endl;
| ^~~~~
| rfind
|
s822176822 | p03814 | C++ | #include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
int dp[6][1010];//動的計画法
int prime[10000001];
char str[1010][1010];
... | a.cc: In function 'int main()':
a.cc:29:21: error: request for member 'length' in 's', which is of non-class type 'int'
29 | for(int i=s.length()-1;i>=0;i--){
| ^~~~~~
|
s685722034 | p03814 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string s;
cin>>s;
int a=0;
for(int i=0;i<s.size();++i){
if(s[i]=='A'){
a=i;
}
break;
}
int z=0;
reverse(s.begin(),s.end())
for(int i=0;i<s.size();++i){
if(s[i]=='Z'... | a.cc: In function 'int main()':
a.cc:20:29: error: expected ';' before 'for'
20 | reverse(s.begin(),s.end())
| ^
| ;
21 | for(int i=0;i<s.size();++i){
| ~~~
a.cc:21:15: error: 'i' was not declared in this scope... |
s359421883 | p03814 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string s;
cin>>s;
int a=0;
for(int i=0;i<s.size();++i){
if(s[i]=='A')
a=i;
break;
}
int z=0;
reverse(s.begin(),s.end())
for(int i=0;i<s.size();++i){
if(s[i]=='Z')
... | a.cc: In function 'int main()':
a.cc:19:29: error: expected ';' before 'for'
19 | reverse(s.begin(),s.end())
| ^
| ;
20 | for(int i=0;i<s.size();++i){
| ~~~
a.cc:20:15: error: 'i' was not declared in this scope... |
s400261515 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int a;
int b;
int c = 0;
int main() {
string str;
cin >> str;
for(int i = 0; i < (int)str.size(); ++i){
char ch = str[i];
if(ch == "A" && c == 0){
a = i;
c = 1;
}
if(ch == "Z" && c == 1){
b = i;
}
}
cout << b ... | a.cc: In function 'int main()':
a.cc:13:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if(ch == "A" && c == 0){
| ~~~^~~~~~
a.cc:17:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | if(ch == "Z" && c == 1){
... |
s131692209 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int a;
int b;
boolean c;
int main() {
string str;
cin >> str;
for(int i = 0; i < (int)str.size(); ++i){
char ch = str[i];
if(ch == "A" && c == false){
a = i;
c = true;
}
if(ch == "Z" && c == true){
b = i;
}
}
... | a.cc:6:1: error: 'boolean' does not name a type; did you mean 'bool'?
6 | boolean c;
| ^~~~~~~
| bool
a.cc: In function 'int main()':
a.cc:13:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if(ch == "A" && c == false){
| ~~~^~~~~~
a.cc:13:23:... |
s064383469 | p03814 | C++ | #include <iostream>
#include <stdio.h>
#include <sstream>
using namespace std;
int main() {
string s;
cin >> s;
int sp = -1,ep = -1;
for (int i = 0;i < s.size(),i++) {
if (s[i] == 'A'&&sp == -1) sp = i;
if (s[s.size()-i] == 'Z' && ep == -1) ep = i;
}
cout << ep - sp + 1 << endl;
} | a.cc: In function 'int main()':
a.cc:10:40: error: expected ';' before ')' token
10 | for (int i = 0;i < s.size(),i++) {
| ^
| ;
|
s369109875 | p03814 | C++ | #include <iostream>
#include <stdio.h>
#include <sstream>
using namespace std;
int main() {
string s;
cin >> s;]
int sp = -1,ep = -1;
for (int i = 0;i < s.size(),i++) {
if (s[i] == 'A'&&sp == -1) sp = i;
if (s[s.size()-i] == 'Z' && ep == -1) ep = i;
}
cout << ep - sp + 1 << endl;
} | a.cc: In function 'int main()':
a.cc:8:18: error: expected primary-expression before ']' token
8 | cin >> s;]
| ^
a.cc:10:40: error: expected ';' before ')' token
10 | for (int i = 0;i < s.size(),i++) {
| ^
| ... |
s267627175 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
char s[200005];
cin >> s;
int len = strlen(s);
int i;
for (i = 0; i < len; i++) {
if (s[i] == 'A')
break;
}
int j;
for (j = len - 1; j > i; j--) {
if (s[j] == 'Z')
break;
}
cout << j - i + 1<< endl;
} | a.cc: In function 'int main()':
a.cc:10:19: error: 'strlen' was not declared in this scope
10 | int 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 ... |
s562373625 | p03814 | C++ | #include <bits/stdc++.n>
using namespace std;
int main ()
{
int l,r;
string s;
cin>>s;
for (int i = 0;i<s.size();i++) {
if (s[i]=='A') {
l==i;
break;
}
}
for (int i = 0; i < s.size(); ++i)
{
if (s[i]=='Z') r=i;
}
cout<<r-l+1<<endl;
} | a.cc:1:10: fatal error: bits/stdc++.n: No such file or directory
1 | #include <bits/stdc++.n>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s256083665 | p03814 | C++ | #include <bits/stdc++.n>
using namespace std;
int main ()
{
int l,r;
string s;
cin>>s;
for (int i = 0;i<s.size();i++) {
if (s[i]=='A') {
i==i;
break;
}
}
for (int i = 0; i < s.size(); ++i)
{
if (s[i]=='Z') r=i;
}
cout<<r-l+1<<endl;
} | a.cc:1:10: fatal error: bits/stdc++.n: No such file or directory
1 | #include <bits/stdc++.n>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s467948809 | p03814 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a)... | a.cc: In function 'int main()':
a.cc:39:11: error: 'i' was not declared in this scope
39 | A_i = i;
| ^
|
s001061816 | p03814 | C++ | #include <algorithm>
#include <cassert>
// #include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
// #include <random>
#include <set>
#include <stack>
#include <string>
#include ... | a.cc: In function 'int main()':
a.cc:51:21: error: expected ')' before ';' token
51 | printf("%d\n", b-a;)
| ~ ^
| )
a.cc:51:22: error: expected primary-expression before ')' token
51 | printf("%d\n", b-a;)
| ^
|
s516513208 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int A,Z;
int i=0;
int Flag=0;
int L=s.size();
for(int i=0;i<L;i++){
if(s[i]=='A' && Flag=0){
A=i;
Flag=1;
}
if(s[i]=='Z')Z=i;
}
cout<<(Z-A)+1<<endl;
} | a.cc: In function 'int main()':
a.cc:13:18: error: lvalue required as left operand of assignment
13 | if(s[i]=='A' && Flag=0){
|
s335664996 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(int argc, char const *argv[])
{
string s;
int f,l;
cin>>s;
for(int i=0;i<s.length();i++){
if(s[i]=='A'){
f=i;
break;
}
}
for(int i=s.length-1;i>=0;i--){
if(s[i]=='Z'){
... | a.cc: In function 'int main(int, const char**)':
a.cc:16:17: 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>; siz... |
s759601753 | p03814 | Java | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
String a = sc.next();
int count = 0;
int flag = 0;
ArrayList<Integer> array = new ArrayList<Integer>();
St... | Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s715629264 | p03814 | C++ | #include<stdio.h>
int main(){
char a[200000];
int i=0,cnt=0,start=0,e=0,sum=0;
scanf("%s",&a);
while(a[i]!=0){
cnt+=1;
i++;
}
for(i=cnt;i>0;i--){
if(a[i]=='Z'){
e=i;
break;
}
for(i=0;i<200000;i++){
if(a[i]=='A'){
start=i;
break;
}
}
sum=(e-start)+1;
printf("%d",sum);
} | a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
23 | }
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
s268851290 | p03814 | C++ | #include <stdio.h>
int main(void){
char a[200000];
int i=0,cnt=0,start=0,e=0,sum=0;
scanf("%s",&a);
while(a[i]!=0){
cnt+=1;
i++;
}
for(i=cnt;i>0;i--){
if(a[i]=='Z'){
e=cnt;
break;
}
for(i=0;i<200000;i++){
if(a[i]=='A'){
start=i;
break;
}
}
sum=(e-start)+1;
printf("%d",sum);
} | a.cc:1:1: error: '\U0000ff03include' does not name a type
1 | #include <stdio.h>
| ^~~~~~~~~
|
s136745639 | p03814 | C++ | #include <stdio.h>
int main(void){
char a[200000];
int i=0,cnt=0,start=0,end=0,sum=0;
scanf("%s",&a);
while(a[i]!=0){
cnt+=1;
i++;
}
for(i=cnt;i>0;i--){
if(a[i]=='Z'){
end=cnt;
break;
}
for(i=0;i<200000;i++){
if(a[i]=='A'){
start=i;
break;
}
}
sum=(end-start)+1;
printf("%d",sum);
} | a.cc:1:1: error: '\U0000ff03include' does not name a type
1 | #include <stdio.h>
| ^~~~~~~~~
|
s393599245 | p03814 | C++ | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
string S;
cin >> S;
int l,r;
rep(i,0,S){
if(S[i] == 'A'){
l = i;
break;
}
}
for(int i =... | a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:2:39: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
2 | #define rep(i,a,b) for(int i=int(a);i<int(b);++i)
... |
s666881251 | p03814 | C++ | #include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
int len = 0;
cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'A') {
for (int j = i; j < s.size(); j++) {
if (s[j] == 'Z') {
len = j - i + 1;
}
}
break;
}
}
cout << len << endl;
cout << t << e... | a.cc: In function 'int main()':
a.cc:23:17: error: 't' was not declared in this scope
23 | cout << t << endl;
| ^
|
s229579035 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
int n=a.size();
int b;
int c;
for(int i=0;i<n;i++){
if(a[i]="A"){
b=i;
break;
}
}
for(int i=0;i<n;i++){
if(a[i]="Z"){
c=i;
break;
}
}
cout<<c-b+1<<endl;
return 0;
}
... | a.cc: In function 'int main()':
a.cc:10:13: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
10 | if(a[i]="A"){
| ^~~
| |
| const char*
a.cc:16:13: error: invalid c... |
s482936087 | p03814 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
char buf[200010];
int hd, tl;
hd = 200000; tl = 0;
cin >> buf;
for (char *p=buf; *p; p++){
if (*p=='A') hd = min(hd, (p-buf));
if (*p=='Z') tl = max(tl, (p-buf));
}
cout << (tl-hd+1) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:26: error: no matching function for call to 'min(int&, long int)'
10 | if (*p=='A') hd = min(hd, (p-buf));
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40... |
s776390055 | p03814 | C++ | #include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<string>
using namespace std;
string S;
cin>>S;
int x,y;
for (int i=0; i < S.size(); i++){
if(S[i]=='A')
x = i;
break;
}
for (int i=0; i < S.size(); i++){
if(S[i]=='Z')
y = i;
break;
}
cout<<y-x+1<<endl;
}
| a.cc:9:1: error: 'cin' does not name a type
9 | cin>>S;
| ^~~
a.cc:11:1: error: expected unqualified-id before 'for'
11 | for (int i=0; i < S.size(); i++){
| ^~~
a.cc:11:15: error: 'i' does not name a type
11 | for (int i=0; i < S.size(); i++){
| ^
a.cc:11:29: error: 'i' does n... |
s127987232 | p03814 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
#include<cstring>
using namespace std;
int main(){
string t;
cin >> t;
char* s = new char[t.size() +1 ];
std::char_traits<char>::copy(s, t.c_str(), t.size()+1);
int z = 'Z';
int ans;
ans = strrchr(*s,'Z') - strchr(*s,'A') + 1;
cout << ans ... | a.cc: In function 'int main()':
a.cc:17:16: error: no matching function for call to 'strrchr(char&, char)'
17 | ans = strrchr(*s,'Z') - strchr(*s,'A') + 1;
| ~~~~~~~^~~~~~~~
In file included from a.cc:3:
/usr/include/string.h:253:14: note: candidate: 'char* strrchr(char*, int)' (near match)
253 | e... |
s371082917 | p03814 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main(){
string s;
cin >> s;
int z = 'Z';
int ans;
ans = strrchr(*s,'Z') - strchr(*s,'A') + 1;
cout << ans <<endl;
} | a.cc: In function 'int main()':
a.cc:13:17: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
13 | ans = strrchr(*s,'Z') - strchr(*s,'A') + 1;
| ^~
a.cc:13:34: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cx... |
s168337778 | p03814 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main(){
string *s;
cin >> s;
int z = 'Z';
int ans;
ans = strrchr(s,'Z') - strchr(s,'A') + 1;
cout << ans <<endl;
} | a.cc: In function 'int main()':
a.cc:10:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string*' {aka 'std::__cxx11::basic_string<char>*'})
10 | cin >> s;
| ~~~ ^~ ~
| | |
| | std::string* {aka std::__cxx11::basic_st... |
s564393422 | p03814 | C++ | #include<iostream>
#include <stdio.h>
#include<string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdint>
#include <map>
#define MOD 1000000007
using namespace std;
typedef long long ll;
int main(){
string s;
int A=-1,Z;
for(int i = 0; i < s.size() && A=-1; i++){
if(s[i] == 'A') A = i;
}
... | a.cc: In function 'int main()':
a.cc:17:29: error: lvalue required as left operand of assignment
17 | for(int i = 0; i < s.size() && A=-1; i++){
| ~~~~~~~~~~~~~^~~~
|
s716917703 | p03814 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
int a;
int z;
for (int i = 0; i <s.size();i++){
if(s[i]=='A'){
a = i+1;
break;
}
}
for (int i = s.size(); i >0; i--)
{
if([i-1]=='Z'){
z = i;
... | a.cc: In function 'int main()':
a.cc:16:14: error: expected ',' before '-' token
16 | if([i-1]=='Z'){
| ^
| ,
a.cc:16:14: error: expected identifier before '-' token
a.cc: In lambda function:
a.cc:16:17: error: expected '{' before '==' token
16 | if([i-1]=='Z'... |
s760365402 | p03814 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b, c;
string s;
cin >> s;
a = s.find("A");
b = rfind("Z");
cout << a - b << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'rfind' was not declared in this scope; did you mean 'rewind'?
9 | b = rfind("Z");
| ^~~~~
| rewind
|
s953934873 | p03814 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b, c;
string s;
cin >> s;
a = s.find("A");
b = rfind("Z")
cout << a - b << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'rfind' was not declared in this scope; did you mean 'rewind'?
9 | b = rfind("Z")
| ^~~~~
| rewind
|
s444864565 | p03814 | C++ | #include <string>
using namespace std;
int main() {
int a, z, c = 0;
string s;
cin >> s;
int S = s.size();
for (int i = 0; i < S; i++) {
if (s[i] == 'A' && c == 0) {
a = i;
c++;
}
if (s[i] == 'Z') {
z = i;
}
}
int A = a+... | a.cc: In function 'int main()':
a.cc:6:5: 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 namespace... |
s835043567 | p03814 | C++ | #include <string>
using namespace std;
int main() {
int a, z, c = 0;
string s;
cin >> s;
int S = s.size();
for (int i = 0; i < S; i++) {
if (s[i] == 'A' && c == 0) {
a = i;
c++;
}
if (s[i] == 'Z') {
z = i;
}
}
int A = a+... | a.cc: In function 'int main()':
a.cc:6:5: 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 namespace... |
s184454322 | p03814 | C++ | #include <bits/stdc++.h>
#define INF (1<<30)
#define INFLL (1ll<<60)
#define EPS (1e-10)
using namespace std;
map <int,int> mp;
typedef pair<int, int> P;
typedef long long ll;
static const int MAX=100000;
static const int NMAX=100;
int main(){
string s; cin>>s;
int s1=-1,s2=-1;
for(int i=0;i<s.size();i++)... | a.cc: In function 'int main()':
a.cc:23:14: error: expected '}' at end of input
23 | return 0;
| ^
a.cc:12:11: note: to match this '{'
12 | int main(){
| ^
|
s150025459 | p03814 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _02_ABC081A
{
class Program
{
static void Main(string[] args)
{
int a = 0;
int z = 0;
bool check = false;
string str;
... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.L... |
s266791071 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
string s,R,L;
int main()
{
cin>>s;
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>R)swap(L,R);
cout<<R-L+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:25:9: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
25 | cout<<R-L+1<<endl;
| ~^~
| | |
| | basic_string<[...]>
| ... |
s065333081 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
string s,R,L;
int main()
{
cin>>s;
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>R)swap(L,R);
cout<<R-L+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:25:9: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
25 | cout<<R-L+1<<endl;
| ~^~
| | |
| | basic_string<[...]>
| ... |
s955350138 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll cnt,x[1000],y[1000];
double maxn=-99999;
inline double dist(ll ind1,ll ind2)
{
int xx=x[ind1]-x[ind2],yy=y[ind1]-y[ind2];
return sqrt(xx*xx+yy*yy);
}
int main()
{
cin>>cnt;
for(register int i=0;i<cnt;i++)
{
cin>>x[i]>>y[i];
}
for(registe... | a.cc:25:16: warning: missing terminating " character
25 | printf("%.12lf\n \",maxn);
| ^
a.cc:25:16: error: missing terminating " character
25 | printf("%.12lf\n \",maxn);
| ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:26: warning: ISO C++17... |
s314554225 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>>s;
for(int i=0;s[i]!='A';i++);
for(int j=s.size();s[j]!='Z';j--);
cout<<j-i+1;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:9: error: 'j' was not declared in this scope
9 | cout<<j-i+1;
| ^
a.cc:9:11: error: 'i' was not declared in this scope
9 | cout<<j-i+1;
| ^
|
s163728280 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int i, j;
cin>>s;
for(i=0;s[i]!='A';i++){
for(j=s.size();s[j]!='Z';j--){
cout<<j-i+1;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:8: error: 's' was not declared in this scope
6 | cin>>s;
| ^
|
s080017243 | p03814 | C++ | #include<bits/stdc++.h>
using namespace std;
int j;
string s;
int main(){
cin>>s;
for(int i=0;s[i];i++){
if (s[i]=='Z'){j=i}
for(i=0;s[i]!='A';i++){
cin>>j-i+1;
}
}
} | a.cc: In function 'int main()':
a.cc:9:23: error: expected ';' before '}' token
9 | if (s[i]=='Z'){j=i}
| ^
| ;
a.cc:11:10: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
11 | cin>>j-... |
s292602378 | p03814 | Java | import java.util.*;
import java.util.HashSet;
import java.util.Set;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
String s=sc.next();
int a=0;
int z=0;
for(int i=0;i<s.length();i++){
if(s.charAt(i)=="A"){
... | Main.java:11: error: bad operand types for binary operator '=='
if(s.charAt(i)=="A"){
^
first type: char
second type: String
Main.java:14: error: bad operand types for binary operator '=='
if(s.charAt(i)=="Z"){
^
first type: char
seco... |
s452424153 | p03814 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int i=0, j=0; a=2;
for(i=0; i<s.size(); i++){
if(s[i]=='A'){
for(j=i+1; j<s.size(); j++){
if(s[j]=='Z'){
a = max(a,j-i+1);
}
}
}
}
cout << a;
} | a.cc: In function 'int main()':
a.cc:8:23: error: 'a' was not declared in this scope
8 | int i=0, j=0; a=2;
| ^
|
s088877390 | p03814 | C++ | #include<iostream>
#include<vector>
#include<queue>
#include<string>
using namespace std;
int main(void){
string s;
cin>>s;
int a,b;
bool f=true;
for(int i=0;i<s.size();i++){
if(s[i]=='A'&&f){
a=i;
f=false;
}
if(s[i]=='Z'){
b=i;
}
}
cout<<b-a+1<<endl;
return 0;
}#include<iostream>
#include<vector>
#include<q... | a.cc:22:2: error: stray '#' in program
22 | }#include<iostream>
| ^
a.cc:43:2: error: stray '#' in program
43 | }#include<iostream>
| ^
a.cc:22:3: error: 'include' does not name a type
22 | }#include<iostream>
| ^~~~~~~
a.cc:27:5: error: redefinition of 'int main()'
27 | int main(void)... |
s152678420 | p03814 | C++ | ZABCZ | a.cc:1:1: error: 'ZABCZ' does not name a type
1 | ZABCZ
| ^~~~~
|
s586553808 | p03814 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<ll, int> P;
#define MOD (1000000007ll)
#define l_ength size
ll sq(ll x){
return x*x;
}
void mul_mod(ll& a, ll b){
a *= b;
a %= MOD;
}
bool isvowel(char c){
int i;
string v="aeiou";
for(i... | a.cc: In function 'int main()':
a.cc:32:16: error: conflicting declaration 'std::string s'
32 | string s;
| ^
a.cc:31:13: note: previous declaration as 'int s'
31 | int s,l,r;
| ^
a.cc:34:15: error: request for member 'length' in 's', which is of non-class ty... |
s561815465 | p03814 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
int main(void){
string s;
cin>>s;
int n = s.size();
int l,r;
rep(i,n){
if(s[i]=='A') l=i,break;
}
rep(i,n){
if(s[i]=='Z') r=i;
}
cout<<r-l+1<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:27: error: expected primary-expression before 'break'
11 | if(s[i]=='A') l=i,break;
| ^~~~~
|
s378510161 | p03814 | C++ | #include <bits/stdc++.h>
#define INF 114514810
using namespace std;
int main(void){
string s;
int a = INF, z = -1;
cin >> s;
if (int i = 0; i < s.size(); i++) {
if (s[i] == 'A') a = min(a, i);
if (s[i] == 'Z') z = max(z, i);
}
cout << z - a + 1 << endl;
}
| a.cc: In function 'int main()':
a.cc:9:32: error: expected ')' before ';' token
9 | if (int i = 0; i < s.size(); i++) {
| ~ ^
| )
a.cc:9:34: error: 'i' was not declared in this scope
9 | if (int i = 0; i < s.size(); i++) {
| ... |
s673195752 | p03814 | C++ | #include <bits/stdc++.h>
#define INF 114514810
using namespace std;
int main(void){
string s, a = INF, z = -1;
cin >> s;
if (int i = 0; i < s.size(); i++) {
if (s[i] == 'A') a = min(a, i);
if (s[i] == 'Z') z = max(z, i);
}
cout << z - a + 1 << endl;
}
| a.cc: In function 'int main()':
a.cc:2:13: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
2 | #define INF 114514810
| ^~~~~~~~~
a.cc:6:19: note: in expansion of macro 'INF'
6 | string s, a = INF, z = -1;
| ... |
s524422838 | p03814 | C++ | S = input()
a = S.find('A')
z = S[::-1].find("Z")
print(len(S[a:-(1+z)])+1) | a.cc:1:1: error: 'S' does not name a type
1 | S = input()
| ^
|
s247213923 | p03814 | C++ |
s = input()
while True:
if s[0] != 'A':
s = s[1:]
continue
if s[-1] != 'Z':
s = s[:-1]
continue
break
print(len(s))
| a.cc:2:1: error: 's' does not name a type
2 | s = input()
| ^
|
s158095330 | p03814 | C++ | #include <bits/stdc++.h>
// #include "bits/stdc++.h"
#define pout(n) printf ("%d\n", n)
#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
typedef long long ll;
using namespace std;
int main (){
string s;
int st,f;
cin >> s;
rep(i,0,s.length()){
if(s[i] == 'A... | a.cc: In function 'int main()':
a.cc:29:9: error: no match for 'operator-' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
29 | pout(f-s+1);
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| int
a.cc:4:34: n... |
s496068075 | p03814 | C++ | int main(void) {
std::string s;
int A = 0, Z = 0, X = 0;
std::cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'A') {
A = i + 1;
break;
}
}
for (int j = s.size() - 1; j > 0; j--) {
if (s[j] == 'Z') {
Z = j + 1;
break;
}
}
X = Z - A + 1;
std::cout << X << std::endl;
}
| a.cc: In function 'int main()':
a.cc:3:14: error: 'string' is not a member of 'std'
3 | std::string s;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | int main(void) {
a.cc:5:1... |
s272530599 | p03814 | C++ | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define int long long
int main() {
string s;
cin >> s;
cout << (s.rfind('Z') - s.find('A') + 1) << endl;
return 0;
} | cc1plus: error: '::main' must return 'int'
|
s642732625 | p03814 | C++ | #include<bits/stdc++.h>
int N,K;
char S[200020] = {0};
int a,b;
int main()
{
scanf("%s",S);
N = strlen(S);
for(int i = 0; i < N; i++)if(S[i] == 'Z')a = i;
reverse(S,S + N);
for(int i = 0; i < N; i++)if(S[i] == 'A')b = i;
printf("%d\n",a + b - N + 2);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:5: error: 'reverse' was not declared in this scope; did you mean 'std::reverse'?
12 | reverse(S,S + N);
| ^~~~~~~
| std::reverse
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc... |
s261824120 | p03814 | C++ | #include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
int N,K;
char S[200020] = {0};
int a,b;
int main()
{
scanf("%s",S);
N = strlen(S);
for(int i = 0; i < N; i++)if(S[i] == 'Z')a = i;
reverse(S,S + N);
for(int i = 0; i < N; i++)if(S[i] == 'A')b = i;
printf("%d\n",a + b - N + 2);
re... | a.cc: In function 'int main()':
a.cc:14:5: error: 'reverse' was not declared in this scope; did you mean 'std::reverse'?
14 | reverse(S,S + N);
| ^~~~~~~
| std::reverse
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc... |
s638047517 | p03814 | C++ | #include<stdio.h>
#include<string.h>
#include<algorithm>
int N,K;
char S[200020] = {0};
int a,b;
int main()
{
scanf("%s",S);
N = strlen(S);
for(int i = 0; i < N; i++)if(S[i] == 'Z')a = i;
reverse(S,S + N);
for(int i = 0; i < N; i++)if(S[i] == 'A')b = i;
printf("%d\n",a + b - N + 2);
return... | a.cc: In function 'int main()':
a.cc:14:5: error: 'reverse' was not declared in this scope; did you mean 'std::reverse'?
14 | reverse(S,S + N);
| ^~~~~~~
| std::reverse
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorith... |
s932988455 | p03814 | C++ | #include <cstdio>
#include <cstring>
int main(void)
{
char s[200001];
scanf("%s", s);
int start, end;
for(int i = 0; i < strlen(s); i++){
if(s[i] == 'Z') end = i;
}
for(int i = 0; i < strlen(s); i++){
if(s[i] == 'A') start = i, break;
}
printf("%d\n", end - start + 1);
return 0;
} | a.cc: In function 'int main()':
a.cc:13:30: error: expected primary-expression before 'break'
13 | if(s[i] == 'A') start = i, break;
| ^~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.