submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s897214891
p03957
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); // 出力 boolean cok = false; boolean fok = false; for(int i=0; i<s.length; i++){ if(s.charAt(i).equals("C")){ if(cok = false...
Main.java:9: error: cannot find symbol for(int i=0; i<s.length; i++){ ^ symbol: variable length location: variable s of type String Main.java:10: error: char cannot be dereferenced if(s.charAt(i).equals("C")){ ^ Main.java:15: error: char cannot...
s958194784
p03957
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); // 出力 boolean cok = false; boolean fok = false; for(int i=0; i<s.length, i++){ if(s.charAt(i).equals("C")){ if(cok = false...
Main.java:9: error: ';' expected for(int i=0; i<s.length, i++){ ^ 1 error
s850925986
p03957
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin >> s; int cflag = 0, fflag = 0; for(auto x: s){ if(*x=='C') cflag=1; if(cflag==1 && *x=='F') fflag=1; } if(fflag) cout<<"Yes¥n"; else cout<<"No¥n"; return 0; }
a.cc: In function 'int main()': a.cc:9:4: error: invalid type argument of unary '*' (have 'char') 9 | if(*x=='C') cflag=1; | ^~ a.cc:10:16: error: invalid type argument of unary '*' (have 'char') 10 | if(cflag==1 && *x=='F') fflag=1; | ^~
s238423588
p03957
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin >> s; int cflag = 0, fflag = 0; for(auto x: s){ if(*x=="C") cflag=1; if(cflag==1 && *x=="F") fflag=1; } if(fflag) cout<<"Yes¥n"; else cout<<"No¥n"; return 0; }
a.cc: In function 'int main()': a.cc:9:4: error: invalid type argument of unary '*' (have 'char') 9 | if(*x=="C") cflag=1; | ^~ a.cc:10:16: error: invalid type argument of unary '*' (have 'char') 10 | if(cflag==1 && *x=="F") fflag=1; | ^~
s003539496
p03957
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; int index[26]; void init(){ for (int i = 0; i < 26; i++){ index[i] = -1; } } int main(){ string s; cin >> s; init(); for (int i = 0; i < s.size(); i++){ if (s[i] == 'C' && index[s[i] - 'A'] == -1){ ...
a.cc:6:13: error: 'int index [26]' redeclared as different kind of entity 6 | int index[26]; | ^ In file included from /usr/include/string.h:462, from /usr/include/c++/14/cstring:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121, fro...
s257532285
p03957
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin >> s; int cflag = 0, fflag = 0; for(auto x: s){ if(x=="C") cflag=1; if(cflag==1 && x=="F") fflag=1; } if(fflag) cout<<"Yes¥n"; else cout<<"No¥n"; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if(x=="C") cflag=1; | ~^~~~~ a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(cflag==1 && x=="F") fflag=1; | ~^~...
s603452609
p03957
Java
import java.util.*; public class A{ public static void main(String[] args) { Scanner s = new Scanner(System.in); String str = s.next(); String[] arr2 = str.split(""); int count = 0; int indexC = 0; int indexF = 0; int flag = 0; int flagC = 0; int flagF = 0; for(int i=0;i<arr2.length;i++){ if(a...
Main.java:3: error: class A is public, should be declared in a file named A.java public class A{ ^ 1 error
s132904252
p03957
C++
#include <iostream> #include <string> int main(){ string s; cin >> s; int cflag = 0, fflag = 0; for(auto x: s){ if(x=="C") cflag=1; if(cflag==1 && x=="F") fflag=1; } if(fflag) cout<<"Yes¥n"; else cout<<"No¥n"; return 0; }
a.cc: In function 'int main()': a.cc:5:1: error: 'string' was not declared in this scope 5 | string s; | ^~~~~~ a.cc:5:1: 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/ostream:40, ...
s260799812
p03957
C++
#include <iostream> #include <string> int main{ string s; cin >> s; int cflag = 0, fflag = 0; for(auto x: s){ if(x=="C") cflag=1; if(cflag==1 && x=="F") fflag=1; } if(fflag) cout<<"Yes¥n"; else cout<<"No¥n"; return 0; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:1: error: 'string' was not declared in this scope 5 | string s; | ^~~~~~ a.cc:5:1: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c+...
s172257151
p03957
C++
#include<stdio.h> #include<string.h> #include <stack> using namespace std; int main(void) { char st[200000]; stack <char> po; int i; scanf("%s",st); for(i = 0;i<strlen(st);i++){ if(st[i]=='C'){ po.push('C'); } if(st[i]=='F' && !po.empty() && po.top == 'C'){ po.push('F'); } } if((int)po.si...
a.cc: In function 'int main()': a.cc:18:56: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator==' 18 | if(st[i]=='F' && !po.empty() && po.top == 'C'){ | ~~~~~~ ^~ ~~~ | ...
s806377936
p03957
C++
#include <iostream> #include <string.h> using namespace std; #define pb push_back #define mp make_pair #define ll long long #define ull unsigned ll #define db double #define INF 0x3f3f3f3f #define MOD 1000000007 #define PII pair<int, int> string str; int main() { cin >> str; int c = INT_MAX; int f = -1...
a.cc: In function 'int main()': a.cc:20:13: error: 'INT_MAX' was not declared in this scope 20 | int c = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <string.h> +++ |+#include <climits> ...
s386771183
p03957
C++
#include <iostream> int main{ string s; cin >> s; int cflag = 0, fflag = 0; for(auto x: s){ if(x=="C") cflag=1; if(cflag==1 && x=="F") fflag=1; } if(fflag) cout<<"Yes¥n"; else cout<<"No¥n"; return 0; }
a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main{ | ^~~~ a.cc:4:1: error: 'string' was not declared in this scope 4 | string s; | ^~~~~~ a.cc:4:1: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c+...
s253748725
p03957
C++
using System; using System.Linq; using System.Diagnostics; namespace ConsoleApplication { public class Program { public static void Main(string[] args) { var s = Console.ReadLine(); var c = s.IndexOf('C'); var f = s.IndexOf('F'); var result = c > ...
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.Linq; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Diagnostics; ...
s834034239
p03957
C++
class Main { public: bool hasCf(string str) { int ci = 0; for (int i = 0;i < str.size();i++) { if (str[i] == 'C') { ci = i; break; } } int fi = -1; for (int i = str.size()-1;i>=0;i--) { if (str[i] == 'F') { fi = i; break; } } return ci < fi; } }; int main() { Main m; ...
a.cc:5:20: error: 'string' has not been declared 5 | bool hasCf(string str) { | ^~~~~~ a.cc: In member function 'bool Main::hasCf(int)': a.cc:7:40: error: request for member 'size' in 'str', which is of non-class type 'int' 7 | for (int i = 0;i < str.size();i++) ...
s303309005
p03957
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin >> s; bool findC = false; bool findF = false; for(int i = 0; i < s.size(); i++){ if(s[i] == 'C') findC = true; else if(s[i] == 'F' && findC ) findF = true; ...
a.cc: In function 'int main()': a.cc:16:29: error: invalid operands of types 'bool' and '<unresolved overloaded function type>' to binary 'operator<<' 16 | cout << findC && findF << endl; | ~~~~~~^~~~~~~
s928287484
p03957
C++
#include <iostream> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <sstream> #include <cmath> #include <set> #include <iomanip> #include <deque> #include <stdio.h> using namespace std; string s; int a=1000000; int b=0; cin >> s; for(int ...
a.cc:21:1: error: 'cin' does not name a type 21 | cin >> s; | ^~~ a.cc:22:5: error: expected unqualified-id before 'for' 22 | for(int i=0;i<s.size();i++){ | ^~~ a.cc:22:17: error: 'i' does not name a type 22 | for(int i=0;i<s.size();i++){ | ^ a.cc:22:28: error: 'i'...
s312560149
p03957
C++
#include <iostream> #include <string.h> #include <process.h> using namespace std; char str[101]; int main(){ cin >> str; int len = strlen(str); bool jud1 = false, jud2 = false; for(int i=0; i<len; i++){ if(str[i] == 'C') jud1 = true; if(str[i] == 'F' && jud1 == true) jud2 = true; } if(jud2 == true) cout << "...
a.cc:3:10: fatal error: process.h: No such file or directory 3 | #include <process.h> | ^~~~~~~~~~~ compilation terminated.
s942328972
p03957
C++
#include <iostream> using namespace std; int main(){ string str; int length; int i,j; cin >> str; length = str.size(); for(i=0; i<length; i++){ if(str[i] == 'C'){ for(j=i; j<length; j++){ if(str[j] == 'F'){ cout << Yes << endl; return 0; }else{ cout << No << endl; return 0; ...
a.cc: In function 'int main()': a.cc:17:49: error: 'Yes' was not declared in this scope 17 | cout << Yes << endl; | ^~~ a.cc:20:49: error: 'No' was not declared in this scope 20 | ...
s306598464
p03957
C
#include<stdio.h> void main(void){ int flag1=0,flag2=0; int i,memo; char s[100]; scanf("%s",s); for(i=0;i<100;i++){ if(s[i]=='C'){ memo=i; flag1=1; } while(memo<100){ if(s[memo]=='F'){ flag2=1; } memo++; } if(flag1==1&&flag2==1){ printf("Yes"); } else printf("No"); }
main.c: In function 'main': main.c:23:1: error: expected declaration or statement at end of input 23 | } | ^
s717638404
p03957
C++
//C++14 (Clang 3.8.0) #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #includ...
a.cc: In function 'int main()': a.cc:33:12: error: expected initializer before '==' token 33 | bool f1==false,f2=false; | ^~ a.cc:35:12: error: 'f1' was not declared in this scope; did you mean 'y1'? 35 | if(f1==false and f2==false and s[i]=='C') | ^~ | ...
s136514244
p03957
C++
string s; int a=1000000; int b=0; cin >> s; for(int i=0;i<s.size();i++){ if(s[i] == 'C'){ a = i; break;} } for(int j=s.size()-1;j=1;j--){ if(s[j] == 'F'){ b = j; break; } } if(a!=0 && b !=0 && a > b) cout << "Yes...
a.cc:1:1: error: 'string' does not name a type 1 | string s; | ^~~~~~ a.cc:4:1: error: 'cin' does not name a type 4 | cin >> s; | ^~~ a.cc:5:5: error: expected unqualified-id before 'for' 5 | for(int i=0;i<s.size();i++){ | ^~~ a.cc:5:17: error: 'i' does not name a type 5 | ...
s312099597
p03957
C++
#include<cstdio> #include<string> #include<algorithm> using namespace std; char input[101]={}; int main(){ scanf("%s",input); int len = strlen(input); for (int i=0; i<len; i++) { if(input[i] == 'C' && input[i+1] == 'O' && input[i+2] == 'D' && input[i+3] == 'E' && input[i+4] == 'F'&& input[i+5] ==...
a.cc: In function 'int main()': a.cc:11:15: error: 'strlen' was not declared in this scope 11 | int len = strlen(input); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> +++ |+#include <cs...
s690467497
p03957
C
#include<stdio.h> #include<math.h> #include<stdlib.h> int main(void){ char S[100]; int i; for(i=0;i<100;i++){ scanf("%s",&S[i]); if(S[i]=='C'){ flag = 1; } else if(S[i]=='F' && flag==1){ flag = 2; } } if(flag == 2){ printf("Yes"); } else{ printf("No"); } return 0; }
main.c: In function 'main': main.c:13:25: error: 'flag' undeclared (first use in this function) 13 | flag = 1; | ^~~~ main.c:13:25: note: each undeclared identifier is reported only once for each function it appears in
s982062570
p03957
C++
// Example program #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int x=0; for (int i=0; i<strlen(s.c_str()); i++) { if (s.c_str()[i] == 'C' && x == 0) x++; if (s.c_str()[i] == 'F' && x == 1) x++; } if (x==2) cout << "Yes" << endl; ...
a.cc: In function 'int main()': a.cc:11:21: error: 'strlen' was not declared in this scope 11 | for (int i=0; i<strlen(s.c_str()); i++) { | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostrea...
s400691788
p03957
C++
S = gets.to_s.split('') able = 0 for i in 0..S.count if S[i] == "C" then for j in i..S.count if S[j] == "F" then able = 1 end end end end if able == 1 then puts "Yes" else puts "No" end
a.cc:1:21: error: empty character constant 1 | S = gets.to_s.split('') | ^~ a.cc:3:10: error: too many decimal points in number 3 | for i in 0..S.count | ^~~~~~~~~~ a.cc:1:1: error: 'S' does not name a type 1 | S = gets.to_s.split('') | ^
s149626729
p03957
C
#include<stdio.h> int main(){ char s[100]; scanf("%s", s); while(*s != 'C'){ if(*s == EOF) goto NO; s++; } while(*s != 'F'){ if(*s == EOF) goto NO; s++; } printf("Yes\n"); return 0; NO: printf("No\n"); return 0; }
main.c: In function 'main': main.c:7:2: error: lvalue required as increment operand 7 | s++; | ^~ main.c:11:2: error: lvalue required as increment operand 11 | s++; | ^~
s048491962
p03957
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace code_festival_2016_c { class Program { static void Main(string[] args) { bool c = false; bool f = false; string str = Console.ReadLine(); ...
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...
s279110081
p03957
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; import java.math.*; public class Main { public static void main(String[] args)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new Strin...
Main.java:22: error: incompatible types: unexpected return value return 0; ^ 1 error
s217437577
p03957
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<cmath> #include<utility> #include<set> #include<complex> #define vi vector<int> #define vvi vector<vector<int> > #define ll long long int #define vl vector<ll> #define vvl vector<vector<ll>...
a.cc: In function 'int main()': a.cc:34:18: error: 'strlen' was not declared in this scope 34 | int l = (int)strlen(s); | ^~~~~~ a.cc:12:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<complex> +++ |+#include <c...
s001850171
p03957
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; bool f = false; for(auto i : s)[] if(i == 'C'){ f = true; } if(i == 'F' && f){ cout << "Yes" << endl; return 0; } } cout << "No" << endl; }
a.cc: In lambda function: a.cc:10:5: error: expected '{' before 'if' 10 | if(i == 'C'){ | ^~ a.cc: In function 'int main()': a.cc:9:20: error: expected ';' before 'if' 9 | for(auto i : s)[] | ^ | ; 10 | if(i == 'C'){ | ~~ ...
s646174915
p03957
C++
// Example program #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int x=0; for (i=0; i<strlen(s.c_str()); i++) { if (s.c_str()[i] == 'C' && x == 0) x++; if (s.c_str()[i] == 'F' && x == 1) x++; } if (x==2) cout << "Yes" << endl; ...
a.cc: In function 'int main()': a.cc:11:10: error: 'i' was not declared in this scope 11 | for (i=0; i<strlen(s.c_str()); i++) { | ^ a.cc:11:17: error: 'strlen' was not declared in this scope 11 | for (i=0; i<strlen(s.c_str()); i++) { | ^~~~~~ a.cc:3:1: note: 'strlen' ...
s652827939
p03957
C++
/*input FCC */ #include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { char s[102]; gets(s); int n = strlen(s); for (int i = 0; i < n - 1; ++i) { if (s[i] == 'C') for (int j = i + 1; j < n; ++j) { if (s[j] == 'F') { puts("Yes"); return 0; } ...
a.cc: In function 'int main(int, const char**)': a.cc:9:3: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(s); | ^~~~ | getw
s216555063
p03957
C++
s = raw_input() flag = 0 for i in s: if flag == 0 and i == 'C': flag = 1 elif: flag == 1 and i == 'F': flag = 2 print 'Yes' if flag == 2 else 'No'
a.cc:7:7: warning: multi-character character constant [-Wmultichar] 7 | print 'Yes' if flag == 2 else 'No' | ^~~~~ a.cc:7:31: warning: multi-character character constant [-Wmultichar] 7 | print 'Yes' if flag == 2 else 'No' | ^~~~ a.cc:1:1: error: 's' does not name...
s570564118
p03957
C++
import sys s=raw_input() flag=False for j in range(s): if s[j]=='C': flag=True if s[j]=='F' and flag: print "Yes" sys.exit() print "No"
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s054251858
p03957
C++
#include <iostream> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> #include <string> #include <vector> #include <queue> #include <map> #include <set> #include <tuple> #include <algorithm> #include <functional> #include <cstring> #include <limits.h> #define FOR(i,k,n) for (int i=(k); i<(int)(n)...
a.cc: In function 'int main()': a.cc:33:9: error: 'i' was not declared in this scope 33 | for(i=0;i<SZ(s);i++){ | ^
s149360137
p03957
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <math.h> using namespace std; #define ll long long int int main(void) { string s; cin >> s ; int flag = 0; for (int i = 0; i < s.length(); i++) { if (s.at(i) == 'C') { flag++; } if ((flag ...
a.cc:35:2: error: stray '#' in program 35 | }#include <iostream> | ^ a.cc:35:3: error: 'include' does not name a type 35 | }#include <iostream> | ^~~~~~~ a.cc:46:5: error: redefinition of 'int main()' 46 | int main(void) { | ^~~~ a.cc:12:5: note: 'int main()' previously defined here ...
s051143054
p03957
C++
#include <string> #include <iostream> #include <cstdio> #include <cstdlib> #include <stdlib.h> #include <algorithm> #include <list> #include <math.h> #define reps(i,j,k) for(int i=(j);i<(k);i++) #define rep(i,j) reps(i,0,j) // rep(i,10)cout << i << endl; using namespace std; int main(void){ int cnt=0; char s[1000];...
a.cc: In function 'int main()': a.cc:19:17: error: 'strlen' was not declared in this scope 19 | int len=strlen(s); | ^~~~~~ a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <math.h> +++ |+#include <cstr...
s704092635
p03957
C++
a = raw_input() ans = False flag = False for c in a: if c == "F" and flag: ans = True if c == "C": flag = True print "Yes" if ans else "No"
a.cc:1:1: error: 'a' does not name a type 1 | a = raw_input() | ^
s607252129
p03957
C++
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef vector<bool> vb; typedef vector<vb> vvb; typedef pair<int, int> pii; typedef long long ll; typedef unsigned long long ull; #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin()...
a.cc: In function 'int main()': a.cc:36:17: error: lvalue required as left operand of assignment 36 | if(s[i]=='F'&&t=true) {
s814933034
p03957
C++
#include<bits/stdc++.h> using namespace std; #define lli long long #define FOR(i,a,b) for (lli i=(a);i<(b);i++) #define REP(i,n) for (lli i=0;i<(n);i++) #define rep(i,n) for (lli i=0;i<(n);i++) #define INF LONG_MAX/3 #define PB push_back #define pb push_back #define all(a) (a).begin(),(a),end() #define pll pair<lli,l...
a.cc: In function 'int main()': a.cc:17:3: error: expected ',' or ';' before 'string' 17 | string s; | ^~~~~~ a.cc:18:8: error: 's' was not declared in this scope 18 | cin>>s; | ^
s585221289
p03957
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int status = 0; for(int unsigned i=0;i<s.size;i++){ if(s[i] == 'C' && status == 0) status = 1; if(s[i] == 'F' && status == 1) status = 2; } if(status == 2){ cout << "Yes" << endl; } else { cout << "No" << endl; } return 0...
a.cc: In function 'int main()': a.cc:9:34: 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 unsign...
s949326465
p03957
C++
#include <iostream> #include <string> #include <algorithm> #include <map> #include <vector> using namespace std; #define debug(x) cout<<#x<<": "<<x<<endl #define rep(i,a,b) for(int i=a;i<b;i++) #define PB push_back #define putn(x,n) cout<< fixed<< setprecision(n)<< x << endl; typedef long long ll; int main(){ cin.ti...
a.cc: In function 'int main()': a.cc:33:2: error: expected '}' at end of input 33 | } | ^ a.cc:14:11: note: to match this '{' 14 | int main(){ | ^
s218718037
p03957
C++
#include <iostream> #include <string> #include <vector> #include <utility> #include <map> #include <tuple> using namespace std; int main(int, char**) { string str; cin >> str; bool a, b; for(int i(0); i< str.length(); ++i){ if(str[i]=="C"){ a= true; } if(a&&str[i]=="F") {b=true;} } ...
a.cc: In function 'int main(int, char**)': a.cc:15:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if(str[i]=="C"){ a= true; } a.cc:16:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | if(a&&str[i]=="F") {b=true;}
s486655452
p03957
C++
#include <stdio.h> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> #include <string> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> using namespace std; int main(void) { string st[200000]; stack <char> po; int i; ...
a.cc: In function 'int main()': a.cc:24:24: error: request for member 'length' in 'st', which is of non-class type 'std::string [200000]' {aka 'std::__cxx11::basic_string<char> [200000]'} 24 | for(i = 0;i<st.length();i++){ | ^~~~~~ a.cc:25:25: error: no match for 'operator==' (op...
s805126392
p03957
C++
#include <bits/stdc++.h> using namespace std; #define int long long // <-----!!!!!!!!!!!!!!!!!!! #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--) #define all(a) (a).begin(),(a).end() #de...
a.cc: In function 'int main()': a.cc:32:13: error: 'n' was not declared in this scope 32 | int x = n + 1, y = -1; | ^ a.cc:41:13: error: 'y' was not declared in this scope 41 | y = i; | ^ a.cc:46:13: error: 'y' was not declared in this scope 46 | if (x < ...
s707800816
p03957
C++
#include <iostream> #include <string> #include <algorithm> #include <map> #include <vector> using namespace std; #define debug(x) cout<<#x<<": "<<x<<endl #define rep(i,a,b) for(int i=a;i<b;i++) #define PB push_back #define putn(x,n) cout<< fixed<< setprecision(n)<< x << endl; typedef long long ll; int main(){ cin.ti...
a.cc: In function 'int main()': a.cc:17:16: error: 's' was not declared in this scope 17 | cin >> s; | ^ a.cc:32:2: error: expected '}' at end of input 32 | } | ^ a.cc:14:11: note: to match this '{' 14 | int main(){ | ^
s205577414
p03957
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <set> #include <map> #include <numeric> #include <unordered_map> #include <unordered_set> #include <comple...
a.cc: In function 'int main()': a.cc:394:25: error: return-statement with no value, in function returning 'int' [-fpermissive] 394 | return; | ^~~~~~
s338078650
p03957
C
#include<stdio.h> int main(){ int f=0; char s[1000010]; scanf("%s",s); for(i=0;s[i];i++){ if(s[i]=='C'&&f==0)f=1; if(s[i]=='F'&&f==1)f=2; } printf("%s\n",f==2?"Yes":"No"); return 0; }
main.c: In function 'main': main.c:6:7: error: 'i' undeclared (first use in this function) 6 | for(i=0;s[i];i++){ | ^ main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
s202530341
p03957
C++
cout << "No" << endl;
a.cc:1:5: error: 'cout' does not name a type 1 | cout << "No" << endl; | ^~~~
s769776463
p03957
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include <limits.h> #define lli long long int #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) #define abs(a) ((a)<0?-(a):(a)) int main(void){ char *s; bool flag = false; s = calloc(sizeof(char),100000); scanf("%s...
a.cc: In function 'int main()': a.cc:17:19: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 17 | s = calloc(sizeof(char),100000); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | void*
s936178469
p03957
C++
s = input() ans = 0 if s.index('C') < s.index('F'): print('Yes') else: print('No')
a.cc:6:11: warning: multi-character character constant [-Wmultichar] 6 | print('Yes') | ^~~~~ a.cc:8:11: warning: multi-character character constant [-Wmultichar] 8 | print('No') | ^~~~ a.cc:2:1: error: 's' does not name a type 2 | s = input() | ^
s109112195
p03957
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string s; cin>>S; int a=0,b=0; for(int i=0;i<S.size();i++){ if(S[i] == 'C'){ a=1; } if(S[i] == 'F' && a==1){ cout<<"Yes"<<endl; return 0; } } cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:9:14: error: 'S' was not declared in this scope 9 | cin>>S; | ^
s523774353
p03958
Java
import java.util.*; import java.io.*; import java.math.*; public class Main{ static void solve(){//Here is the main function ArrayList<Integer> one = nextIntArray(); int K = one.get(0); int T = one.get(1); ArrayList<Integer> list = nextIntArray(); int max = 0; for(int i = 0; i < N; i++){ max = Math.max(...
Main.java:9: error: cannot find symbol for(int i = 0; i < N; i++){ ^ symbol: variable N location: class Main Main.java:13: error: cannot find symbol for(int i = 0; i < N; i++){ ^ symbol: variable N location: class Main Note: Main.java uses unchecked or unsafe op...
s850597134
p03958
C++
#include <bits/stdc++.h> using namespace std; const long long N = 3e5+2; int k; int t; int ar[N]; set < int > s; int main(){ scanf("%d%d" , &k , &t); int mx = 0; for(int i = 1; i <= t; i++){ scanf("%d" , &ar[i]); s.insert(i); mx = max(mx , ar[i]); } int ans = 0; int p...
a.cc: In function 'int main()': a.cc:38:43: error: 'n' was not declared in this scope 38 | printf("%d\n" , ans - (mx % 2 == 0 && n > 1)); | ^
s778691256
p03958
C++
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; #define int long long int INF = 1e9+7; signed main() { int K,T; cin >> K >> T; vector<int>a(T); for(int i = 0; i < T; i++) { cin >> a[i]; } sort(a.begin(),a.end()); cout << max(0,a[T-1]-(K-1-a[T-1])) << endl; }
a.cc: In function 'int main()': a.cc:14:16: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 14 | cout << max(0,a[T-1]-(K-1-a[T-1])) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c+...
s384030951
p03958
C++
#include <bits/stdc++.h> using namespace std; #define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20); #define int long long #define double long double const int INF = 1e18, MOD = 1e9 + 7; signed main() { int k, t; cin>>k>>t; int a; int mx = -INF; for (int...
a.cc: In function 'int main()': a.cc:17:14: error: no matching function for call to 'max(int, long long int)' 17 | cout<<max(0, mx - 1 - k + mx)<<endl; | ~~~^~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits...
s619848205
p03958
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k,n; cin >> k >> n; int a[n]; int d=0,e; for(int i=0;i<n;i++){ cin >> a[i]; if(d<a[i]){ d=a[i]; e=i; } } cout << max(a[e]−1−(k−a[e]),0); }
a.cc:15:19: error: extended character − is not valid in an identifier 15 | cout << max(a[e]−1−(k−a[e]),0); | ^ a.cc:15:19: error: extended character − is not valid in an identifier a.cc:15:23: error: extended character − is not valid in an identifier 15 | cout << max(a[e]−1−(k−a[e]),0)...
s074977573
p03958
C++
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author */ #include <iostream> #include <algorithm> #include <vector> #include <string> #include <queue> #include <map> #include <set> #include <functional> #include <cmath> #include <numeric> #include <iterator> #include <fs...
a.cc: In static member function 'static void BK::solve(std::istream&, std::ostream&)': a.cc:38:18: error: no matching function for call to 'max(int64_t, long long int)' 38 | cout << max(max_vec - sum - 1, 0ll) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/...
s324701193
p03958
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,o,n) for(long long i = o;i<n;i++) #define oneforall ios::sync_with_stdio(false);cin.tie(0); #define all(v) (v).begin(),(v).end() #define ini(...) int __VA_ARGS__; in(__VA_ARGS__) #define inl(...) long long __VA_ARGS__; in(__VA_ARGS__) #define ins(...) string _...
a.cc: In function 'int32_t main()': a.cc:51:49: error: expected ')' before '{' token 51 | if(morty[1] == 0){if(morty[0]!=0{out(morty[0]-1);return 0;}} | ~ ^ | ) a.cc:51:76: error: expected primar...
s521844999
p03958
Java
#include <algorithm> #include <iostream> #include <vector> int main() { int k, t; std::cin >> k >> t; std::vector<int> a(t); for (int i = 0; i < t; i++) std::cin >> a[i]; sort(a.begin(), a.end()); std::cout << std::max(0, a[t - 1] - 1 - (k - a[t - 1])) << "\n"; }
Main.java:1: error: illegal character: '#' #include <algorithm> ^ Main.java:2: error: illegal character: '#' #include <iostream> ^ Main.java:3: error: illegal character: '#' #include <vector> ^ Main.java:7: error: class, interface, enum, or record expected std::cin >> k >> t; ^ Main.java:8: error: class, interface,...
s773081821
p03958
C++
import sys readline = sys.stdin.buffer.readline K, T = map(int, readline().split()) A = sorted(list(map(int, readline().split())))[::-1] B = [-1 for _ in range(K)] j = 0 for i, a in enumerate(A): for _ in range(a): if j <= K // 2 - 1: B[2 * j] = i else: B[2 * (j - K // 2)...
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s505261147
p03958
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; const double PI=3.14159265358979; const ll INF= pow(10,18); typedef pair<ll,ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i,a,b) for(ll i=a;i<b;i++) #define rep(i,n) FOR(i,0,n) string abc="abcdefghijklmnopqrst...
a.cc: In function 'int main()': a.cc:25:14: error: no matching function for call to 'max(int, ll)' 25 | cout << max(0,a-b-1) << endl; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s508856128
p03958
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, t; cin >> n >> t; vector<ll> a(t); ll maxi = 0, sum = 0; for (int i = 0; i < t; i++) { cin >> a[i]; sum += a[i]; maxi = max(a[i], maxi); } sum -= maxi; cout << max(0,abs(sum...
a.cc: In function 'int main()': a.cc:17:16: error: no matching function for call to 'max(int, long long int)' 17 | cout << max(0,abs(sum - maxi) - 1) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu...
s507856382
p03958
C++
#include <iostream> #include <vector> #include <cstdlib> #include <bits/stdc++.h> using namespace std; int main() { int k,t; cin >> k >> t; vector<int> a(t); for(int i = 0; i < n; i++){ cin >> a.at(i); } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); cout << max(a.at(n-1...
a.cc: In function 'int main()': a.cc:11:24: error: 'n' was not declared in this scope 11 | for(int i = 0; i < n; i++){ | ^ a.cc:16:22: error: 'n' was not declared in this scope 16 | cout << max(a.at(n-1) - 1 - (k - a.at(n-1)), 0); | ^
s576383807
p03958
C++
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define PER(i, n) for (int i = (n-1); i >= 0; --i) #define ALL(V) (V).begin(),(V).end() #define SORT(V) sort(ALL(V)) //小さい方からソート #define REV(V...
a.cc: In function 'int main()': a.cc:195:10: error: no matching function for call to 'min(long long int, int)' 195 | OUT(min(maxe-sume, 0)); | ~~~^~~~~~~~~~~~~~ a.cc:30:24: note: in definition of macro 'OUT' 30 | #define OUT(n) cout << n << endl | ^ In file included from ...
s467906898
p03958
C++
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define PER(i, n) for (int i = (n-1); i >= 0; --i) #define ALL(V) (V).begin(),(V).end() #define SORT(V) sort(ALL(V)) //小さい方からソート #define REV(V...
a.cc: In function 'int main()': a.cc:193:17: error: no matching function for call to 'max(std::vector<long long int>&)' 193 | int maxe = max(A)-1; | ~~~^~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s445984753
p03958
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long k,t; cin >> k >> t; long long total=0; long long a[t]; for(int i=0;i<t;i++){ cin >> a[i]; total+=a[i]; } sort(a,a+t); total-=a[t-1]; cout << max(0,a[t-1]-total-1) << endl; }
a.cc: In function 'int main()': a.cc:15:16: error: no matching function for call to 'max(int, long long int)' 15 | cout << max(0,a[t-1]-total-1) << endl; | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bi...
s296531080
p03958
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define rep(i, a, n) for (int i = a; i < (n); ++i) int main() { int k, t; cin >> k >> t; vector<int> a(n); rep(i, 0, t) cin >> a[i]; sort(a.begin(), a.end()); rep(i, 0, t-1) { a[i+1] -= a[i]; } cout << a[t-1]-1 << endl; ...
a.cc: In function 'int main()': a.cc:13:23: error: 'n' was not declared in this scope 13 | vector<int> a(n); | ^
s700419628
p03958
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k,t,a[1];cin>>k>>t; for(int i=0;i<t;i++){cin>>a[1];a[0]=max(a[0],a[1]);} cout<<max(2*a-1-k,0); }
a.cc: In function 'int main()': a.cc:6:12: error: invalid operands of types 'int' and 'int [1]' to binary 'operator*' 6 | cout<<max(2*a-1-k,0); | ~^~ | | | | | int [1] | int
s950257228
p03958
C++
#include <iostream> #include <string.h> #define inf 999999 using namespace std; int n, m; int main() { cin >> n >> m; int x, maxim; maxim = -1; for(int i = 1; i <= m; i++) { cin >> x; if(maxim < x) maxim = x; } if(maxim * t == n) cout << 0; else cout << maxim - m; re...
a.cc: In function 'int main()': a.cc:17:16: error: 't' was not declared in this scope 17 | if(maxim * t == n) cout << 0; | ^
s488337691
p03958
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int k,t; cin >> k >> t; int a[t]; for(int i = 0;i < n;i++)cin >> a[i]; sort(a,a+t); if(t == 1)cout << k-1; else if(a[t-1] - a[t-2] >= 2)cout << a[t-1] - a[t-2]; else cout << 0; }
a.cc: In function 'int main()': a.cc:8:23: error: 'n' was not declared in this scope 8 | for(int i = 0;i < n;i++)cin >> a[i]; | ^
s162452752
p03958
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k, t; cin >> k >> t; vector<int> a(t); for(int i = 0; i < t, i++){ cin >> a.at(i); } sort(a.rbegin(), a.rend()); int ma = a.at(0); int za = n - ma; if(za >= n - 1){ cout << 0; }else{ cout << ma - 1 - za; } }
a.cc: In function 'int main()': a.cc:8:28: error: expected ';' before ')' token 8 | for(int i = 0; i < t, i++){ | ^ | ; a.cc:13:12: error: 'n' was not declared in this scope 13 | int za = n - ma; | ^
s341997006
p03958
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k, t; cin >> k >> t; vector<int> a(m); for(int i = 0; i < m, i++){ cin >> a.at(i); } sort(a.rbegin(), a.rend()); int ma = a.at(0); int za = n - ma; if(za >= n - 1){ cout << 0; }else{ cout << ma - 1 - za; } }
a.cc: In function 'int main()': a.cc:7:17: error: 'm' was not declared in this scope 7 | vector<int> a(m); | ^ a.cc:8:28: error: expected ';' before ')' token 8 | for(int i = 0; i < m, i++){ | ^ | ; a.cc:13:12: error: 'n...
s688029132
p03958
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<un...
a.cc: In function 'void solve()': a.cc:56:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 56 | cin << a[i]; a.cc:56:13: note: candidate: 'operator<<(int, __gnu_cxx::__all...
s044239170
p03958
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nectInt(); int T = sc.nextInt(); int max = 0; int sum = 0; for (int i = 0; i < T; i++) { int a = sc.nextInt(); max = Math.max(max, a); sum += a; ...
Main.java:6: error: cannot find symbol int K = sc.nectInt(); ^ symbol: method nectInt() location: variable sc of type Scanner 1 error
s458140372
p03958
C++
#include <bits/stdc++.h> #include <cmath> #include <numeric> using namespace std; #define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b #define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少. #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ #defi...
a.cc: In function 'int main()': a.cc:27:15: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)' 27 | ans += max(0LL, a[i] - 1 - (sum - a[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/includ...
s329778727
p03958
C++
#include <bits/stdc++.h> #include <cmath> #include <numeric> using namespace std; #define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b #define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少. #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ #defi...
a.cc: In function 'int main()': a.cc:27:15: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)' 27 | ans += max(0ll, a[i] - 1 - (sum - a[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/includ...
s772896954
p03958
C++
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; using ll=long long; using datas=pair<ll,ll>; using ddatas=pair<double,double>; using tdata=pair<ll,datas>; using vec=vector<ll>; using mat=vector<vec>; using pvec=vector<datas>; using pmat=vector<pvec>; #define For(i,a,b) for(i=a;i<b;i++) #defin...
a.cc: In function 'int main()': a.cc:105:12: error: expected '}' at end of input 105 | return 0; | ^ a.cc:90:11: note: to match this '{' 90 | int main(){ | ^
s711774090
p03958
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int N, T; priority_queue<int> pq; int main() { cin >> N >> T; for (int i = 0; i < T; i++) { int a; cin >> a; pq.push(a); } int a_top = pq.top(); cout << max(a_top − 1 − (K − a_top), 0) << endl; retur...
a.cc:18:23: error: extended character − is not valid in an identifier 18 | cout << max(a_top − 1 − (K − a_top), 0) << endl; | ^ a.cc:18:27: error: extended character − is not valid in an identifier 18 | cout << max(a_top − 1 − (K − a_top), 0) << endl; | ...
s675128872
p03958
C++
#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; int main(void){ int K,T; cin >> K >> T; vector<int>a(T); for(int i=0;i<T;i++){ cin >> a[i]; } int max = 0; for(int i=0;i<T;i++){ if(max < a[i]) max = a[i]; } cout << max(max - 1 - (K - max...
a.cc: In function 'int main()': a.cc:20:14: error: 'max' cannot be used as a function 20 | cout << max(max - 1 - (K - max) , 0) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
s396765582
p03958
C++
#include <bits/stdc++.h> using namespace std; int main () { int K, T; cin >> K >> T; int a, m = 0; for(int i = 0; i < N; i++){ cin >> a; m = max(m, a); } if(m - 1 <= K - m)cout << 0 << endl; else cout << m - 1 - K + m; return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: 'N' was not declared in this scope 7 | for(int i = 0; i < N; i++){ | ^
s674369802
p03958
C++
#include <bits/stdc++.h> using namespace std; int main () { int K, T; cin >> K >> T; int a, m = 0; for(int i = 0; i < N; i++){ cin >> a; m = max(m, a); } if(m - 1 =< K - m)cout << 0 << endl; else cout << m - 1 - K + m; return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: 'N' was not declared in this scope 7 | for(int i = 0; i < N; i++){ | ^ a.cc:11:13: error: expected primary-expression before '<' token 11 | if(m - 1 =< K - m)cout << 0 << endl; | ^
s197198481
p03958
C++
#include <iostream> using namespace std; int main(){ int n,k; cin >> n>>k; int m=0,t; for(i=0;i<k;i++){ cin >> t; m = max(t,m); } cout << max(m-1-n+m,0)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: 'i' was not declared in this scope 9 | for(i=0;i<k;i++){ | ^
s653279783
p03958
C++
#include<iostream> #include<vector> using namespace std; int main(){ int k,t; cin>>k>>t; int MAX=0; for(int i=0;i<t;i++){ int a;cin>>a; if(MAX<a) MAX=a; } int ans=2*MAX-K-1; if(ans<0) cout<<0<<endl; else cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:12:17: error: 'K' was not declared in this scope 12 | int ans=2*MAX-K-1; | ^
s900356523
p03958
C++
#include<iostream> #include<algorithm> #include<string> #include<cstdlib> #include<map> #include<iomanip> #include<sstream> #include<vector> #include<stack> #include<queue> #include<math.h> #include<complex> using namespace std; //ユークリッドの互除法 a,bは最大公約数を求めたい2つの数 long long int gcd(long long int a, long long int b) { ...
a.cc:67:15: error: redefinition of 'long long int gcd(long long int, long long int)' 67 | long long int gcd(long long int a, long long int b) { | ^~~ a.cc:18:15: note: 'long long int gcd(long long int, long long int)' previously defined here 18 | long long int gcd(long long int a, long long in...
s788254431
p03958
C++
#include <bits/stdc++.h> using namespace std; int tori(int n) { int k. t; cin >> k >> t; int a[t]; for(int i = 0; i < t; i++) { cin >> a[i]; cout << max(a[i] - 1 - (k - a[i]), 0) << endl; } return 0; }
a.cc: In function 'int tori(int)': a.cc:5:8: error: expected initializer before '.' token 5 | int k. t; | ^ a.cc:6:10: error: 'k' was not declared in this scope 6 | cin >> k >> t; | ^ a.cc:6:15: error: 't' was not declared in this scope 6 | cin >> k >> t; | ...
s271696465
p03958
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k,t; cin >>k >>t; int a[k]; for(int i=0;i<t;i++)cin >>a[i]; sort(a,a+t); int ans=a[t-1]; cout <<max(K-2*ans-1,0)<<endl; }
a.cc: In function 'int main()': a.cc:10:14: error: 'K' was not declared in this scope 10 | cout <<max(K-2*ans-1,0)<<endl; | ^
s747930616
p03958
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()) #define VRSORT(v) sort(v.rbegin(), v.rend()) #define ll long long #define pb(a) push_back(a) #define MOD 1000000007 using namespace std; typedef pair<int, int> P; typedef pair<l...
a.cc: In function 'int main()': a.cc:36:31: error: expected ';' before '}' token 36 | if(a-t>0) max(ans,a-t) | ^ | ; 37 | } | ~ a.cc:36:22: warning: ignoring return value of 'constexpr const _Tp...
s138547693
p03958
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; ll A[105]; int main() { ll K, T; c...
a.cc: In function 'int main()': a.cc:24:23: error: no matching function for call to 'max(int&, ll&)' 24 | max = std::max(max, A[i]); | ~~~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s366552641
p03958
C++
#include <iostream> #define REP(i, n) for(int i = 0; i < n; i++) using namespace std; int main() { int K, T; cin >> K >> T; int ma = -1; REP(i, T) { int a; cin >> a; ma = max(a, ma); } cout << ma(ma - 1 - (K - ma), 0) << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:13: error: 'ma' cannot be used as a function 14 | cout << ma(ma - 1 - (K - ma), 0) << endl; | ~~^~~~~~~~~~~~~~~~~~~~~~
s324551948
p03958
C++
#include <iostream> #define REP(i, n) for(int i = 0; i < n; i++) using namespace std; int main() { int K, T; cin >> K >> T; int ma = -1; REP(i, N) { int a; cin >> a; ma = max(a, ma); } cout << ma(ma - 1 - (K - ma), 0) << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: 'N' was not declared in this scope 9 | REP(i, N) { | ^ a.cc:2:38: note: in definition of macro 'REP' 2 | #define REP(i, n) for(int i = 0; i < n; i++) | ^ a.cc:14:13: error: 'ma' cannot be used as a func...
s881063494
p03958
C++
#include <ios> #include <iomanip> #include <iostream> #include <functional> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <string> #include <sstream> #include <complex> #include <vector> #include <list> #include <queue> #include <deque> #include <stack> #include <map> #include <s...
a.cc:96:4: error: redefinition of 'll gcd(ll, ll)' 96 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;} | ^~~ a.cc:34:4: note: 'll gcd(ll, ll)' previously defined here 34 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;} | ^~~ a.cc:97:4: error: redefinition of 'll lcm(ll, ll)' 97 | ll lcm(l...
s214587946
p03958
C++
#include <bits/stdc++.h> #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define rng(a) a.begin(),a.end() #define maxs(x,y) (x = max(x,y)) #d...
a.cc: In function 'int main()': a.cc:107:14: error: no matching function for call to 'max(int, ll)' 107 | ans = max(0,a[t-1]-sum-1); | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s968731398
p03958
C++
#define debug_interval ',' #define dump_interval ' ' #define debug_toggle 1 //{ #pragma GCC optimize ("O3","unroll-loops") #pragma GCC target ("avx") #include<bits/stdc++.h> using namespace std; #define hi cerr<<"hi"<<endl; #define int long long #define INT_MAX LLONG_MAX #define rep(i,n) for(int i=0;i<(n);i++) #define...
a.cc:12:9: warning: "INT_MAX" redefined 12 | #define INT_MAX LLONG_MAX | ^~~~~~~ In file included from /usr/include/c++/14/climits:42, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38, from a.cc:8: /usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:120:9: note...
s410805188
p03958
C++
#include <iostream> #include <vector> #include <math.h> #include <cmath> #include <algorithm> #include <numeric> #include <string> #include <cstring> #include <regex> #include <bits/stdc++.h> using namespace std; using ll = long long; using dbl = double; using pii = pair<int, int>; using pl4 = pair<ll, ll>; using vi ...
a.cc: In function 'int main()': a.cc:239:12: error: 'aa' was not declared in this scope; did you mean 'a'? 239 | cin >> aa; | ^~ | a a.cc: In function 'pl4 Bezout(ll, ll)': a.cc:137:1: warning: control reaches end of non-void function [-Wreturn-type] 137 | } | ^
s425063510
p03958
C++
#include<bits/stdc++.h> using namespace std; signed main(){ int K,T; cin>>K>>T; vint C(T); rep(i,T)cin>>C[i]; rep(i,T){ if(C[i]*2-1<=K)continue; int t=C[i]-(K+1)/2; cout<<t*2-(K%2==0)<<endl; return 0; } cout<<0<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'vint' was not declared in this scope; did you mean 'uint'? 6 | vint C(T); | ^~~~ | uint a.cc:7:9: error: 'i' was not declared in this scope 7 | rep(i,T)cin>>C[i]; | ^ a.cc:7:5: error: 'rep' was not declared in this scope...
s369544798
p03958
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int k, t; cin >> k >> t; vector<int> a(t); for(int i = 0; i < t; i++) cin >> a[i]; sort(a, a+t); int sum = a[t-1]; for(int i = 0; i < t-1; i++) sum -= a[i]; cout << max(0, sum-1) << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:18: error: no match for 'operator+' (operand types are 'std::vector<int>' and 'int') 12 | sort(a, a+t); | ~^~ | | | | | int | std::vector<int> In file included from /usr/include/c++...
s394029803
p03958
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <stdio.h> using namespace std; using ll =long long; int main (void) { int K,T; cin >> K >>T ; int a[T]; int max=0; int sum=0; for (int i=0;i<T;i++...
a.cc: In function 'int main()': a.cc:26:10: error: 'max' cannot be used as a function 26 | ans=max(ans,K-max-1); | ~~~^~~~~~~~~~~~~
s022026009
p03958
C++
#include <bits/stdc++.h> using namespace std; using vi=vector<int>; using vvi=vector<vi>; using vs=vector<string>; using msi=map<string,int>; using mii=map<int,int>; //using pii=pair<int,int>; using vlai=valarray<int>; using ll=long long; using pii=pair<ll,ll>; #define rep(i,n) for(int i=0;i<n;i++) #define range(i,s,...
a.cc: In function 'int main()': a.cc:34:14: error: no matching function for call to 'max(ll, int)' 34 | cout<<max(c[0]*2-k-1,0)<<endl; | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s692430859
p03958
C++
#include<bits/stdc++.h> using namespace std; const long long INF = (1LL << 32); const long long MOD = 1000000007; const long double PI = 3.1415926; #define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++) #define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define ...
a.cc: In function 'int main()': a.cc:37:9: error: 'vv' was not declared in this scope; did you mean 'v'? 37 | vv.push_back(a); | ^~ | v a.cc:39:5: error: 'vv' was not declared in this scope; did you mean 'v'? 39 | vv.push_back(sum); | ^~ | v