submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s528757798
p01376
C
char*c,b[];t,s;main(){read(0,b,c)for(c=strchr(b,10);*c++;t*=!!(*c-10))*c-49||(s=s<++t?t:s);printf("%d\n",s);exit(0);}
main.c:1:12: warning: data definition has no type or storage class 1 | char*c,b[];t,s;main(){read(0,b,c)for(c=strchr(b,10);*c++;t*=!!(*c-10))*c-49||(s=s<++t?t:s);printf("%d\n",s);exit(0);} | ^ main.c:1:12: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] main.c:1:14: error: type...
s461888875
p01376
C
#include<iostream> #include<cstdio> using namespace std; int main(){ int M,N,a[20]={0},s; cin >> M >> N; for(int i=0;i<M;i++){ for(int j=0;j<N;j++){ cin >> s; if(s==1){ a[i]++; } } } int max=0; for(int i=0;i<M;i++){ if(a[i]>max)max=a[i]; } cout << max << endl; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s596609681
p01376
C++
#include <bits/stdc++.h> #define r(i,a,n) for(int i=a;i<n;i++) using namespace std; main(){ int n,m,s=0,c; cin>>n>>m; r(i,n){int k=0; r(j,m)if(cin>>c&&c)k++; s=max(s,k); }cout<<s<<endl; }
a.cc:7:8: error: macro "r" requires 3 arguments, but only 2 given 7 | r(i,n){int k=0; | ^ a.cc:2:9: note: macro "r" defined here 2 | #define r(i,a,n) for(int i=a;i<n;i++) | ^ a.cc:8:10: error: macro "r" requires 3 arguments, but only 2 given 8 | r(j,m)if(cin>>c&&c)k++; ...
s822415532
p01376
C++
#include<iostream> #include<algorithm> using namespace std; int main(void){ int n,m,ans; while(cin >> n >> m){ ans=0; for(int i=0;i<n;i++){ int sum=0; for(int j=0;j<m;j++){ int in; cin >> in; sum+=m; } ans=max(ans.sum); } cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:13: error: request for member 'sum' in 'ans', which is of non-class type 'int' 19 | ans=max(ans.sum); | ^~~
s512058878
p01377
Java
import java.util.*; public class Main { static Scanner kbd = new Scanner(System.in); public static void main(String[] args){ while(kbd.hasNext()){ String n = kbd.next(); if(n.length()!=0){ String[] c = new String[n.length()]; int i; int count = 0; for(i=0; i<n.length(); i++){ c[i] = n.s...
Main.java:38: error: ')' expected else if(a.equals(")"){ ^ 1 error
s684686265
p01377
C++
#include <stdio.h> #include <iostream> #include <string> using namespace std; int main(){ string iwi; int d = 0; cin >> iwi; for (int i = 0; i <= iwi.length << 1; i++){ switch (iwi.at(i)){ case 'i': if (iwi.at(iwi.length - i - 1) == 'i'){ d++; } break; case 'w': if (iwi.at(iwi.length - i - ...
a.cc: In function 'int main()': a.cc:12:34: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns...
s993738302
p01377
C++
#include <iostream> using namespace std; bool CheckSymmetry(char a, char b){ switch (a){ case 'i': case 'w': if (b == a)return true; break; case '(': if (b == ')')return true; break; case ')': if (b == '(')return true; break; default: return false; } return false; } int main(){ char Loader[11]...
a.cc: In function 'int main()': a.cc:27:22: error: 'strlen' was not declared in this scope 27 | int length = strlen(Loader); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++...
s282950628
p01377
C++
#include<string.h> using namespace std; int main(){ int i; string moji; cin >> moji; int count=0; int len = moji.size(); for(i = 0; i < len/2; i++){ char A,B; A=moji[i]; B=moji[len-i-1]; if(A=='i'&& B=='i')continue; if(A=='w' && B=='w')continue; if(A=='(' && B==')')continue; ...
a.cc: In function 'int main()': a.cc:6:3: error: 'string' was not declared in this scope 6 | string moji; | ^~~~~~ a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 2 | #include<string.h> +++ |+#include <string> 3 | using namesp...
s502789841
p01377
C++
#include <iostream> using namespace std; const int MAX_SIZE = 10; int calc(char s[]) { int c = 0, l = strlen(s); if (l % 2) { if (s[l / 2 + 1] <= ')') c++; } for (int i = 0; i < l / 2; ++i) { if (s[i] <= ')') { if (abs(s[i] - s[l - i - 1]) != 1) c++; } else { if (s[i] != s[l - i - 1]) ...
a.cc: In function 'int calc(char*)': a.cc:7:18: error: 'strlen' was not declared in this scope 7 | int c = 0, l = strlen(s); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#inclu...
s839276937
p01377
C++
#include <iostream> using namespace std; map<char, char> sym; void init() { sym['i'] = 'i'; sym['w'] = 'w'; sym['('] = ')'; sym[')'] = '('; } int main() { init(); string str; getline(cin, str); int n = str.size(); int cnt = 0; for(int i=0; i<n/2+1; i++) { if(sym[str[i]] !...
a.cc:4:1: error: 'map' does not name a type 4 | map<char, char> sym; | ^~~ a.cc: In function 'void init()': a.cc:7:3: error: 'sym' was not declared in this scope 7 | sym['i'] = 'i'; | ^~~ a.cc: In function 'int main()': a.cc:22:8: error: 'sym' was not declared in this scope 22 | if(sym[st...
s252202170
p01378
C++
#include<stdio.h> #include<string.h> char str[17]; /* i" x "i" "w" x "w" "(" x ")" ")" x "(" "{" x "}" "}" x "{" "[" x "]" "]" x "[" */ int taisyo( char p, char q ){ if( p == 'i' && q == 'i' ) return 1; if( p == 'w' && q == 'w' ) return 1; if( p == '(' && q == ')' ) return 1; if( p == ')' && q == '(' ) re...
a.cc: In function 'int main()': a.cc:69:35: error: 'iwi' was not declared in this scope 69 | if( strstr(substr,iwi) == NULL ) | ^~~
s291931156
p01378
C++
#include<iostream> #include<string> #include<cassert> using namespace std; int maxv; string str; bool match(char l, char r){ if ( l == '[' ) return r == ']'; if ( l == ']' ) return r == '['; if ( l == '(' ) return r == ')'; if ( l == ')' ) return r == '('; if ( l == '{' ) return r == '}'; if ( l == '}' ) ...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s927590681
p01378
C++
include<iostream> #include<sstream> #define REP(i,s,n) for(int i=s;i<n;i++) #define rep(i,n) REP(i,0,n) #define MAX 16 using namespace std; string s,t; int dp[MAX][MAX]; bool check(char a,char b) { return (a == '(' && b == ')') || (a == ')' && b == '(') || (a == '{' && b == '}') || (a == '}' && b == '{') || (a == '[...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/istream:40, from /usr/include/c++/14/sstream:40, fr...
s919569627
p01379
Java
//@2262 Stopping Problem public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String s = reader.readLine(); String[] sp = s.split(" "); int ymax = Integer.parseInt(sp[0]); int xmax = Integer.parseInt(sp[1]); Str...
Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) throws IOException { ^ (use --enable-preview to enable unnamed classes) Main.java:102: error: class, interface, enum, or record expected } ^ 2 errors
s302032476
p01379
C
#include<iostream> #include<utility> #include<stack> using namespace std; typedef pair<int,int> P; typedef pair<P,P> P2; int main(){ int r,c; string grid[30]; bool v[30][30][4][20]; int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1}; bool f = false; cin >> r >> c; for(int i=0;i<r;i++){ cin >> grid[i]; f...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s305243897
p01379
C++
#include<iostream> #include<vector> #include<algorithm> #include <iterator> #include<queue> #include <functional> #include <string> #include <numeric> using namespace std; #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() using namespace std; const int dx[4] = { -1, 1, 0, 0 }; const int dy[4] = {...
a.cc:20:63: error: reference to 'data' is ambiguous 20 | bool a(int ax, int ay, vector<string> Fi,int Memory, int Muki,data aa){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classe...
s052826472
p01379
C++
#include <bits/stdc++.h> using namespace std; ?? #define REP(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) REP(i,0,n) #define INF (1<<30) #define INFLL (1LL<<62LL) ?? typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; ?? int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1}...
a.cc:17:9: warning: ISO C++11 requires whitespace after the macro name 17 | #define DOWN?? 0 | ^~~~ a.cc:19:9: warning: ISO C++11 requires whitespace after the macro name 19 | #define UP?????? 2 | ^~ a.cc:20:9: warning: ISO C++11 requires whitespace after the macro name 20 | #define...
s317603334
p01379
C++
#include <bits/stdc++.h> using namespace std; ?? #define REP(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) REP(i,0,n) #define INF (1<<30) #define INFLL (1LL<<62LL) ?? typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; ?? int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1}...
a.cc:17:9: warning: ISO C++11 requires whitespace after the macro name 17 | #define DOWN?? 0 | ^~~~ a.cc:19:9: warning: ISO C++11 requires whitespace after the macro name 19 | #define UP?????? 2 | ^~ a.cc:20:9: warning: ISO C++11 requires whitespace after the macro name 20 | #define...
s061065874
p01379
C++
#include<iostream> #include<utility> #include<stack> using namespace std; typedef pair<int,int> P; typedef pair<P,P> P2; int main(){ int r,c; string grid[30]; bool v[30][30][4][20]; int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1}; bool f = false; cin >> r >> c; for(int i=0;i<r;i++){ cin >> grid[i]; f...
a.cc: In function 'int main()': a.cc:29:14: error: 'class std::stack<std::pair<std::pair<int, int>, std::pair<int, int> > >' has no member named 'front' 29 | P2 p = q.front(); q.pop(); | ^~~~~
s108931423
p01379
C++
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <cstdio> #include <iostream> #include <sstream> #include <cmath> #include <cstdlib> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> #include <bitset> #in...
a.cc: In member function 'void State::ReadCommand(char)': a.cc:85:18: error: '\U0000ff0e' was not declared in this scope 85 | ClearDir();. | ^~
s761984100
p01379
C++
#include <iostream> using namespcae std; int main() { string s; while (cin >> s) ceer << s << endl; }
a.cc:3:7: error: expected nested-name-specifier before 'namespcae' 3 | using namespcae std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:1: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:6:1: note: suggested alternatives: In file included from /usr/include/c++...
s706975570
p01379
C++
#include <iostream> #include <queue> #include <cctype> #include <cassert> #include <algorithm> using namespace std; #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) REP(i,0,n) #define DbgPass(a) cout<<"-- pass: "<< a << endl #define DbgMap(m,r,c) rep(dbgI,r){rep(dbgJ,c){cout<<m[dbgI][dbgJ];}cout<<endl;} #defin...
/usr/bin/ld: /tmp/ccQ7ZhZl.o: in function `run()': a.cc:(.text+0xbd): undefined reference to `State::State()' /usr/bin/ld: a.cc:(.text+0xcc): undefined reference to `State::State()' collect2: error: ld returned 1 exit status
s234346701
p01379
C++
#include <iostream> #include <queue> #include <cctype> #include <cassert> #include <algorithm> using namespace std; #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) REP(i,0,n) #define DbgPrint(a) cout<<"Debug: "<<a<<endl #define DbgPass(a) cout<<"-- pass: "<< a << endl #define DbgMap(m,r,c) rep(dbgI,r){rep(dbg...
a.cc: In function 'bool run()': a.cc:44:12: error: expected primary-expression before '>' token 44 | if(cnt=>21*21*4*15) break; | ^
s293733948
p01379
C++
const int dx[] = {-1,0,1,0}; const int dy[] = {0,-1,0,1}; const int MAX_H = 20; const int MAX_W = 20; const int MAX_M = 16; int H, W; string M[20]; bool vis[MAX_M][4][MAX_H][MAX_W]; bool run( int x, int y, int dir, int mem ) { if(vis[mem][dir][y][x]) return 0; vis[mem][dir][y][x] = 1; bool flag = 0; ...
a.cc:9:1: error: 'string' does not name a type 9 | string M[20]; | ^~~~~~ a.cc: In function 'bool run(int, int, int, int)': a.cc:19:10: error: 'M' was not declared in this scope 19 | switch(M[y][x]) { | ^ a.cc:32:8: error: 'isdigit' was not declared in this scope 32 | if(isdigit(M[y...
s680365452
p01379
C++
#include <algorithm> #include <cstdlib> #include <cctype> #include <cstring> using namespace std; const int dx[] = {-1,0,1,0}; const int dy[] = {0,-1,0,1}; const int MAX_H = 21; const int MAX_W = 21; const int MAX_M = 11; int H, W; string M[20]; bool vis[MAX_M][4][MAX_H][MAX_W]; bool run( int x, int y, int dir, int...
a.cc:15:1: error: 'string' does not name a type 15 | string M[20]; | ^~~~~~ a.cc: In function 'bool run(int, int, int, int)': a.cc:25:10: error: 'M' was not declared in this scope 25 | switch(M[y][x]) { | ^ a.cc: In function 'int main()': a.cc:55:3: error: 'cin' was not declared in this sco...
s882226534
p01380
Java
import java.util.*; public class Main2{ void solve(){ Scanner sc = new Scanner(System.in); int INF = 1000000000; int n = sc.nextInt(); int[][] ab = new int[n][2]; for(int i=0; i<n; i++){ ab[i][0] = sc.nextInt(); ab[i][1] = sc.nextInt(); } ...
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2{ ^ 1 error
s553381091
p01380
C++
#include <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; int n; class Data{ public: int a,b; bool operator<(const Data &d)const{ return this->a<d.a; } }; Data datas[1000001]; int main(){ cin>>n; int ct=0; for(int i = 0; i < n; i++){ cin>>...
a.cc: In function 'int main()': a.cc:59:27: error: binding reference of type 'Data&' to 'const __gnu_cxx::__alloc_traits<std::allocator<Data>, Data>::value_type' {aka 'const Data'} discards qualifiers 59 | Data &d=pq.top(); | ~~~~~~^~
s345656694
p01380
C++
#include <queue> #include <algorithm> #include <cstdio> main(){ int i=0,n,a,b,s=0; std::vector<pair<int,int> >v; for(scanf("%d",&n);i<n;i++)scanf("%d%d",&a,&b),v.push_back(make_pair(b,a)); std::sort(v.begin(),v.end()); std::priority_queue<int>q; for(i=0;i<n;i++){ s+=v[i].second; q.push(v[i].second); s>v[i]....
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:21: error: 'pair' was not declared in this scope; did you mean 'std::pair'? 6 | std::vector<pair<int,int> >v; | ^~~~ | ...
s269666963
p01380
C++
#include <queue> #include <algorithm> #include <cstdio> using namespace std; main(){ int i=0,n,a,b,s=0; vector<pair<int,int> >v; for(scanf("%d",&n);i<n;i++)scanf("%d%d",&a,&b),v.push_back(make_pair(b,a)); sort(v.begin(),v.end()); priority_queue<int>q; for(i=0;i<n;i++){ s+=v[i].second; q.push(v[i].second); s...
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:14:49: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void' 14 | ...
s720724182
p01381
C++
/* ƒm[ƒh‚ð n/2 ŒÂ‚Ì2‚‚̃Oƒ‹[ƒv‚É•ª‚¯‚é ƒOƒ‹[ƒv1 ƒOƒ‹[ƒv2 --------- --------- 1 0 2 5 3 4 ‚±‚Ì2‚‚̃Oƒ‹[ƒv‚ðˆÈ‰º‚̏‡”ԂŃMƒUƒMƒU‚ɂ‚Ȃ°‚邯1ƒpƒ^[ƒ“‚Å‚«‚ ...
a.cc: In function 'int main()': a.cc:63:12: error: 'output' was not declared in this scope 63 | puts(output); | ^~~~~~
s704039178
p01382
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* c...
a.cc:29:1: error: 'll' does not name a type 29 | ll as[MAX_N]; | ^~ a.cc: In function 'int main()': a.cc:39:38: error: 'as' was not declared in this scope; did you mean 'abs'? 39 | for (int i = 0; i < n; i++) cin >> as[i]; | ^~ | ...
s164948754
p01382
C++
#include "bits/stdc++.h" using namespace std; vector<__int128> a; int n; static void solve() { cin >> n; a.resize(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.rbegin(), a.rend()); __int128 ans = 0; __int128 comp = 0; for(int i = 0; i < n - 2; i++) { __int128 len = a[i] + a[i + 1] +...
a.cc: In function 'void solve()': a.cc:13:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<__int128>, __int128>::value_type' {aka '__int128'}) 13 | cin >> a[i]; In file included from /usr/include/c++/14/sstream:40...
s525036192
p01382
C++
#include "bits/stdc++.h" using namespace std; vector<unsigned long long> a; int n; static void solve() { cin >> n; a.resize(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.rbegin(), a.rend()); __int128 ans = 0; __int128 comp = 0; for(int i = 0; i < n - 2; i++) { __int128 len = a[i] + ...
a.cc: In function 'void solve()': a.cc:28:13: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__int128') 28 | else cout << ans << "\n"; | ~~~~ ^~ ~~~ | | | | | __int128 | std::ostream ...
s964116117
p01382
C++
#include <iostream> #include <vector> #include <algorithm> #include <functional> using namespace std; #define ll __int32 vector< ll > a; main(){ ll n,t,i,sum=0,f=0; cin>>n; while(n--){ cin >> t; a.push_back(t); } sort(a.begin(), a.end(), greater<ll>()); for(i=0;i<a.size()-2;i++){ if(a[i] < a[i+1]+a[i+2]){...
a.cc:6:12: error: '__int32' was not declared in this scope; did you mean '__int32_t'? 6 | #define ll __int32 | ^~~~~~~ a.cc:8:9: note: in expansion of macro 'll' 8 | vector< ll > a; | ^~ a.cc:8:12: error: template argument 1 is invalid 8 | vector< ll > a; | ^ ...
s875348193
p01382
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <functional> using namespace std; typedef unsigned long long ull; bool tri(ull a, ull b, ull c, ull d, ull e, ull f){ ull p[6]={a,b,c,d,e,f}; if( (p[0]< (p[1]+p[2]))&& (p[3]< (p[4]+p[5])) ){return true}; if( (p[0]< (p[1]+p[3...
a.cc: In function 'bool tri(ull, ull, ull, ull, ull, ull)': a.cc:15:68: error: expected ';' before '}' token 15 | if( (p[0]< (p[1]+p[2]))&& (p[3]< (p[4]+p[5])) ){return true}; | ^ | ...
s468308787
p01383
C++
#include <iostream> #include <vector> #include <cstring> #include <string> #include <algorithm> #include <iomanip> #include <cmath> #include <cassert> #include <functional> #include <queue> using namespace std; const int MAX_V = 10010; using Capacity = int; using Cost = int; const auto inf = numeric_limits<Capacity>::...
a.cc: In member function 'void PrimalDual::view()': a.cc:89:38: error: request for member 'size' in 'g', which is of non-class type 'std::vector<Edge> [10010]' 89 | for(int i = 0; i < g.size(); i++) { | ^~~~
s186232092
p01383
C++
#include <cstdio> #include <algorithm> #include <cstring> #include <vector> #include <utility> using namespace std; const int INF=0x3f3f3f3f; typedef long long LL; struct edge{ int to,cap,cost,rev; edge(int to,int cap,int cost,int rev):to(to),cap(cap),cost(cost),rev(rev){} }; const int MAX_V=10010; int V,dist[M...
a.cc: In function 'int solve()': a.cc:66:2: error: return-statement with no value, in function returning 'int' [-fpermissive] 66 | return;} | ^~~~~~ a.cc:76:11: warning: control reaches end of non-void function [-Wreturn-type] 76 | printf("%d\n",res+min_cost_flow(1,cnt,M-1)); | ~~~~~~^~~~~~~...
s260759925
p01383
C++
#include <cstdio> #include <algorithm> #include <queue> #include <climits> #define REP(i,n) for(int i=0; i<(int)(n); i++) #define f first #define s second #define mp make_pair inline int getInt(){ int s; scanf("%d", &s); return s; } #define rep(i,s,n) for(int i=(s); i<(int)(n); i++) using namespace std; struct Edg...
a.cc: In function 'int minCostFlow(Graph<E>&, int, int, int)': a.cc:100:16: error: 'dist' was not declared in this scope 100 | res += d * dist[t]; | ^~~~ a.cc: At global scope: a.cc:109:3: error: expected unqualified-id before 'return' 109 | return res; | ^~~~~~ a.cc:110:1: error:...
s155173507
p01383
C++
#include <cstdio> #include <algorithm> #include <queue> #include <climits> #define REP(i,n) for(int i=0; i<(int)(n); i++) #define f first #define s second #define mp make_pair inline int getInt(){ int s; scanf("%d", &s); return s; } #define rep(i,s,n) for(int i=(s); i<(int)(n); i++) using namespace std; struct Edg...
a.cc: In function 'int minCostFlow(Graph<E>&, int, int, int)': a.cc:111:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 111 | int main(){ | ^~ a.cc:111:9: note: remove parentheses to default-initialize a variable 111 | int main(){ | ^~ | ...
s919606214
p01383
C++
#include <cstdio> #include <algorithm> #include <queue> #include <climits> #define REP(i,n) for(int i=0; i<(int)(n); i++) #define f first #define s second #define mp make_pair inline int getInt(){ int s; scanf("%d", &s); return s; } #define rep(i,s,n) for(int i=(s); i<(int)(n); i++) using namespace std; struct Edg...
a.cc: In function 'int minCostFlow(Graph<E>&, int, int, int)': a.cc:111:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 111 | int main(){ | ^~ a.cc:111:9: note: remove parentheses to default-initialize a variable 111 | int main(){ | ^~ | ...
s955609543
p01383
C++
#include <cstdio> #include <algorithm> #include <queue> #include <climits> #define REP(i,n) for(int i=0; i<(int)(n); i++) #define f first #define s second #define mp make_pair inline int getInt(){ int s; scanf("%d", &s); return s; } #define rep(i,s,n) for(int i=(s); i<(int)(n); i++) using namespace std; struct Edg...
a.cc: In function 'int minCostFlow(Graph<E>&, int, int, int, bool)': a.cc:140:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 140 | int main(){ | ^~ a.cc:140:9: note: remove parentheses to default-initialize a variable 140 | int main(){ | ^~ ...
s989767136
p01387
C++
#include <cstdio> #include <cmath> #include <cstring> #include <cstdlib> #include <climits> #include <ctime> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <set> #include <map> #include <iostream> #include <deque> #include <complex> #include <string> #include <iomanip>...
a.cc: In function 'int main(int, char**)': a.cc:201:35: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'? 201 | const int r = que.top().first; | ^~~ | pop a.cc:202:35: error: 'c...
s685334547
p01387
C++
#include <iostream> #include <vector> #include <cassert> #include <algorithm> #include <cstdio> #include <tuple> using namespace std; typedef long long ll; typedef pair<int, int> P; template<int V> struct LowestCommonAncestor { const static int LG = 25; int ro[LG][V]; int dps[V]; vector<int> g[V]; ...
a.cc: In instantiation of 'void LowestCommonAncestor<V>::exec(int) [with int V = 100100]': a.cc:206:13: required from here 206 | lca.exec(0); | ~~~~~~~~^~~ a.cc:32:15: error: 'memset' was not declared in this scope 32 | memset(ro, -1, sizeof(ro)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~ ...
s365429035
p01387
C++
#include <iostream> #include <vector> #include <cassert> #include <algorithm> #include <cstdio> #include <tuple> using namespace std; typedef long long ll; typedef pair<int, int> P; template<int V> struct LowestCommonAncestor { const static int LG = 25; int ro[LG][V]; int dps[V]; vector<int> g[V]; ...
a.cc: In instantiation of 'void LowestCommonAncestor<V>::exec(int) [with int V = 100100]': a.cc:208:13: required from here 208 | lca.exec(0); | ~~~~~~~~^~~ a.cc:32:15: error: 'memset' was not declared in this scope 32 | memset(ro, -1, sizeof(ro)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~ ...
s325415281
p01387
C++
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2270 #include <iostream> #include <vector> #include <cstdio> #include <sstream> #include <map> #include <string> #include <algorithm> #include <queue> #include <cmath> #include <functional> #include <set> #include <ctime> #include <random> #include <chrono> #...
a.cc: In lambda function: a.cc:654:28: error: expected ';' before numeric constant 654 | ai_ = ao_ = bi_ = bo_ 0; | ^~ | ;
s403848442
p01387
C++
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #include <complex> #include <unordered_map> #in...
a.cc:106:18: error: expected ';' at end of member declaration 106 | unsigned __int8* blockrank; | ^~~~~~ | ; a.cc:106:26: error: ISO C++ forbids declaration of 'blockrank' with no type [-fpermissive] 106 | unsigned __int8* blockrank; | ...
s339362742
p01387
C++
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #include <complex> #include <unordered_map> #in...
a.cc:106:18: error: expected ';' at end of member declaration 106 | unsigned __int8* blockrank; | ^~~~~~ | ; a.cc:106:26: error: ISO C++ forbids declaration of 'blockrank' with no type [-fpermissive] 106 | unsigned __int8* blockrank; | ...
s178482300
p01387
C++
#include <bits/stdc++.h> using namespace std; struct Mo_Tree_Vertex { vector< vector< int > > g, parent; vector< int > vs, in; vector< int > left, right, order, lca, dep; vector< bool > v; int width; int nl, nr, ptr; Mo_Tree_Vertex(int n) : width(sqrt(2 * n - 1) * 1.5), nl(0), nr(0), ptr(0), g(n), in...
a.cc: In lambda function: a.cc:86:14: error: expected primary-expression before 'bool' 86 | return bool((right[a] < right[b]) ^ ((left[a] / width) & 1); | ^~~~ a.cc:86:14: error: expected ';' before 'bool' a.cc:86:14: error: expected primary-expression before 'bool'
s220171233
p01387
C++
#include <vector> #include <algorithm> #include <iostream> #include <cstring> #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) #define all(o) (o).begin(), (o).end() #define mset(m,v) memset(m,v,siz...
a.cc: In member function 'void SignedWaveletMatrix::init(const std::vector<unsigned int>&, const std::vector<unsigned char>&)': a.cc:59:46: error: expected primary-expression before '-' token 59 | if(Val(1) << (8 * sizeof Val - 1) <= maxval) bitsize = 8 * sizeof Val; | ...
s726805734
p01387
C++
#include <vector> #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) #define all(o) (o).begin(), (o).end() #define mset(m...
a.cc: In member function 'void SignedWaveletMatrix::init(const std::vector<unsigned int>&, const std::vector<unsigned char>&)': a.cc:60:46: error: expected primary-expression before '-' token 60 | if(Val(1) << (8 * sizeof Val - 1) <= maxval) bitsize = 8 * sizeof Val; | ...
s137625260
p01388
C
char s[999],*v;k,u,p,c;main(){for(gets(s),v=s;*v;v++)*v-'K'||k++,*v-'U'||u++,*v-'P'||p++,*v-'C'||c++;k=u<k?u:k;k=p<k?p:k;printf("%d\n",c<k?c:k);exit(0);}
main.c:1:16: warning: data definition has no type or storage class 1 | char s[999],*v;k,u,p,c;main(){for(gets(s),v=s;*v;v++)*v-'K'||k++,*v-'U'||u++,*v-'P'||p++,*v-'C'||c++;k=u<k?u:k;k=p<k?p:k;printf("%d\n",c<k?c:k);exit(0);} | ^ main.c:1:16: error: type defaults to 'int' in declaration of 'k' [...
s378273945
p01388
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <map> #include <utility> #include <set> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <stack> #include <queue> #include <numeric> #include <cstring> #define...
a.cc: In function 'int main()': a.cc:31:9: error: 'i' was not declared in this scope; did you mean 'in'? 31 | rep(i, in.length()){ | ^ a.cc:19:26: note: in definition of macro 'REP' 19 | #define REP(i, a, b) for(i = a; i < b; i++) | ^ a.cc:31:5: note: in expansion ...
s436861088
p01388
C++
#include <iostream> using namespace std;int t[201]; void main(){char c;while(cin>>c)t[c]++;cout<<min(t['K'],min(t['U'],min(t['P'],t['C'])))<<endl;}
a.cc:3:1: error: '::main' must return 'int' 3 | void main(){char c;while(cin>>c)t[c]++;cout<<min(t['K'],min(t['U'],min(t['P'],t['C'])))<<endl;} | ^~~~
s779747222
p01388
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(void) { char str[300]; int k=0,u=0,p=0,c=0; int kupc=0; scanf("%s",str); for(int i = 0 ; i < strlen(str) ; i++) { if(str[i] == 'K') k++; else if(str[i] == 'U') u++; else if(str[i] == 'P') p++; else if(str[i]...
a.cc: In function 'int main()': a.cc:12:23: error: 'strlen' was not declared in this scope 12 | for(int i = 0 ; i < strlen(str) ; i++) { | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> ...
s957154800
p01388
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(void) { char str[300]; int k=0,u=0,p=0,c=0; int kupc=0; scanf("%s",str); for(int i = 0 ; i < strlen(str) ; i++) { if(str[i] == 'K') k++; else if(str[i] == 'U') u++; else if(str[i] == 'P') p++; else if(str[i]...
a.cc: In function 'int main()': a.cc:12:23: error: 'strlen' was not declared in this scope 12 | for(int i = 0 ; i < strlen(str) ; i++) { | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> ...
s675592877
p01388
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(void) { char str[300]; int k=0,u=0,p=0,c=0; int kupc=0; scanf("%s",str); for(int i = 0 ; i < strlen(str) ; i++){ if(str[i] == 'K') k++; else if(str[i] == 'U') u++; else if(str[i] == 'P') p++; else if(str[i] ...
a.cc: In function 'int main()': a.cc:12:23: error: 'strlen' was not declared in this scope 12 | for(int i = 0 ; i < strlen(str) ; i++){ | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> ...
s413669123
p01388
C++
#include <iostream> #include <string> using namespace std; int main(void) { char str[300]; int k=0,u=0,p=0,c=0; int kupc=0; scanf("%s",str); for(int i = 0 ; i < strlen(str) ; i++){ if(str[i] == 'K') k++; else if(str[i] == 'U') u++; else if(str[i] == 'P') p++; else if(str[i] == 'C') c++; } ...
a.cc: In function 'int main()': a.cc:11:23: error: 'strlen' was not declared in this scope 11 | for(int i = 0 ; i < strlen(str) ; i++){ | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream>...
s073311315
p01388
C++
#include <iostream> #include <string> using namespace std; int main(void) { char str[301]; int k=0,u=0,p=0,c=0; int kupc=0; scanf("%s",str); for(int i = 0 ; i < strlen(str) ; i++){ if(str[i] == 'K') k++; else if(str[i] == 'U') u++; else if(str[i] == 'P') p++; else if(str[i] == 'C') c++; ...
a.cc: In function 'int main()': a.cc:13:23: error: 'strlen' was not declared in this scope 13 | for(int i = 0 ; i < strlen(str) ; i++){ | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream>...
s183344776
p01388
C++
#include <iostream> #include <string> using namespace std; int main(void) { char str[301]; int k=0,u=0,p=0,c=0; int kupc=0; scanf("%s",str); for(int i = 0 ; i < strlen(str) ; i++){ if(str[i] == 'K') k++; else if(str[i] == 'U') u++; else if(str[i] == 'P') p++; else if(str[i] == 'C') c++; ...
a.cc: In function 'int main()': a.cc:13:23: error: 'strlen' was not declared in this scope 13 | for(int i = 0 ; i < strlen(str) ; i++){ | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream>...
s670977563
p01388
C++
#include<iostream> using namespace std;int n[99];main({for(;~scanf("%1c",n);)n[*n]++;cout<<min(n[75],min(n[85],min(n[80],n[67])))<<endl;}
a.cc:2:35: error: expected constructor, destructor, or type conversion before '(' token 2 | using namespace std;int n[99];main({for(;~scanf("%1c",n);)n[*n]++;cout<<min(n[75],min(n[85],min(n[80],n[67])))<<endl;} | ^
s458237158
p01388
C++
//19 #include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ string s; cin>>s; int a=1<<30; for(int i=0;i<4;i++){ a=min(a,count(s.begin(),s.end(),"KUPC"[i])); } cout<<a<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:10: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 13 | a=min(a,count(s.begin(),s.end(),"KUPC"[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s058705835
p01388
C++
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <cstdio> #include <iostream> #include <sstream> #include <cmath> #include <cstdlib> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> #include <bitset> #in...
a.cc: In function 'int main()': a.cc:38:67: error: expected ')' before ';' token 38 | min(count(buf,buf+256,'P'),count(buf,buf+256,'C'))); | ^ | ) a.cc:36:11:...
s895188533
p01388
C++
#include <iostream> #include <string> int buf[500]; int main() { string s; cin >> s; for(int i=0;i<s.size();i++) { buf[s[i]]++; } int ans; ans=min(min(buf['K'],buf['U']),min(buf['P'],buf['C'])); cout << ans << endl; retu...
a.cc: In function 'int main()': a.cc:6:10: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:6:10: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/...
s126893277
p01388
C++
#include <iostream> #include <string> using namespace std; int main(){ int k=0,u=0,p=0,c=0; int ans[4]; string str; cin>>str; for(int i=0;i<str.size();i++){ if(str[i]-'A'==10)k++; else if(str[i]-'A'==20)u++; else if(str[i]-'A'==15)p++; else if(str[i]-'A'==3)k++; } ans[0]=k; ans[1]=u; ans[2]=p; ans[3]=...
a.cc: In function 'int main()': a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(ans,ans+4); | ^~~~ | short
s802775568
p01388
C++
#include <iostream> #include <queue> #include <cctype> #include <stdio.h> #include <map> using namespace std; int main(int argc, char const* argv[]) { string s; cin >> s; string::iterator ite=s.begin(); vector<int> a(4); for (ite = s.begin(); ite < s.end(); ite++) { if (*ite == 'K') ...
a.cc: In function 'int main(int, const char**)': a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort( a.begin(), a.end()); | ^~~~ | short
s472895798
p01389
C
1 #include <stdio.h> 2 #define N 50 3 #define MIN(a,b) ((a<b)?(a):(b)) 4 5 int main(void){ 6 char work[N][N]; 7 int map[N][N]; 8 int n,m; 9 int i,j; 10 int dp[N][N]; 11 scanf("%d %d",&n,&m); 12 for(i=0;i<n;i++){ 13 scanf("%s"...
main.c:1:3: error: expected identifier or '(' before numeric constant 1 | 1 #include <stdio.h> | ^ main.c:1:5: error: stray '#' in program 1 | 1 #include <stdio.h> | ^ main.c:2:5: error: stray '#' in program 2 | 2 #define N 50 | ^ main.c:3:5: error: stray '#' in program ...
s074988086
p01389
C
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s609409190
p01389
C
#include<stdio.h> #include<stdlib.h> int h,w; void dikstla(int **map,int **sumc,int y,int x,int sum); int main(void){ int i,j; char **route,c; int **cicada,**cmap,num; scanf("%d %d",&h,&w); route=(char **)calloc(h,sizeof(char *)); cicada=(int **)calloc(h,sizeof(int *)); cmap=(int **)calloc(h,sizeof(in...
main.c: In function 'main': main.c:57:1: error: expected declaration or statement at end of input 57 | } | ^
s492308955
p01389
C
#include<stdio.h> int main(){ int H,W; char map[50][50]; int i,j,k; scanf("%d %d",&H,&W); getchar(); for(i=0;i<H;i++){ for(j=0;j<W;j++){ map[i][j]=getchar(); map[i][j]-='0'; } getchar(); }} for(i=0;i<H;i++){ for(j=0;j<W;j++){ if(i==0){ if(j!=0){ map[i][j]+=map[i][j-1]; } }else{ ...
main.c:15:9: error: expected identifier or '(' before 'for' 15 | for(i=0;i<H;i++){ | ^~~ main.c:15:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 15 | for(i=0;i<H;i++){ | ^ main.c:15:22: error: expected '=', ',', ';', 'asm' or '__a...
s165537021
p01389
C++
File Edit Options Buffers Tools C++ Help #include <iostream> #include <vector> ...
a.cc:1:1: error: 'File' does not name a type 1 | File Edit Options Buffers Tools C++ Help | ^~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, ...
s285467143
p01389
C++
#include <iostream> #include <stdio.h> #define min(a,b) ((a) < (b) ? (a) : (b)) using namespace std; int main(){ int height, width, map[50][50]; cin >> height >> width; for (int i = 0; i < height; i++){ for (int j = 0; j < width; j++){ scanf_s("%1d",&map[i][j]); } } for (int i = 1; i < width; i++){ map[0...
a.cc: In function 'int main()': a.cc:11:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 11 | scanf_s("%1d",&map[i][j]); | ^~~~~~~ | scanf
s670006288
p01389
C++
#include <bits/stdc++.h> #define MAX 9*50*50*2 using namespace std; int H, W; vector< vector<int> > memo; vector< vector<int> > m; int dy[] = {0,1}, dx[] = {1, 0}; int dfs(int y, int x){ if(memo[y][x] != max) return memo[y][x]; if(y == H-1 && x == W-1) return 0; int n[2]; for(int p=0; p < 2; p++){ ...
a.cc: In function 'int dfs(int, int)': a.cc:10:17: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '<unresolved overloaded function type>' to binary 'operator!=' 10 | if(memo[y][x] != max) a.cc:18:20: warning: pointer to a function used in arithmet...
s749189477
p01389
C++
}#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /...
a.cc:1:4: error: stray '#' in program 1 | }#include<cstdio> | ^ a.cc:1:3: error: expected declaration before '}' token 1 | }#include<cstdio> | ^ a.cc:1:5: error: 'include' does not name a type 1 | }#include<cstdio> | ^~~~~~~ In file included from /usr/include/c++/14/cmath:45...
s496527324
p01389
C++
#include<iostream> #include<algorithm> using namespace std; int h, w, x[1000][1000], y[1000][1000]; char T[11] = "0123456789", char c; int main() { cin >> h >> w; for (int i = 1; i <= h; i++) { for (int j = 1; j <= w; j++) { cin >> c; for (int k = 0; k < 10; k++) { if (T[k] == c) { x[i][j] = k; }...
a.cc:5:28: error: expected unqualified-id before 'char' 5 | char T[11] = "0123456789", char c; | ^~~~ a.cc: In function 'int main()': a.cc:10:32: error: 'c' was not declared in this scope 10 | cin >> c; | ^
s883895073
p01389
C++
#include<iostream> #include<cstdio> #include<vector> #include<queue> #include<algorithm> using namespace std; int zyoutai[50][50], dp[51][51], a, b; int main() { memset(dp, 1, sizeof(dp)); dp[1][0] =dp[0][1]= 0; cin >> a >> b; for (int c = 0; c < a; c++) { for (int d = 0; d < b; d++) { scanf("%1d", &zyoutai[c...
a.cc: In function 'int main()': a.cc:10:9: error: 'memset' was not declared in this scope 10 | memset(dp, 1, sizeof(dp)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include<algorithm> +++ |+#include <cst...
s832160289
p01389
C++
#include <iostream> #include <string> // ciada's distribution parameter int cicadaNum[50][50]; int checkPattern(int num, int max, int total) { int count = 0; for (int i = 0; i < total; i++) { int tmp = num & (0x1 << i); if (tmp != 0){ ++count; } } if (max == c...
a.cc: In function 'int main()': a.cc:51:5: error: 'memset' was not declared in this scope 51 | memset(&cicadaNum[0][0],0, sizeof(cicadaNum)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#...
s066441821
p01389
C++
#include <iostream> #include <string> // ciada's distribution parameter int cicadaNum[50][50]; int checkPattern(int num, int max, int total) { int count = 0; for (int i = 0; i < total; i++) { int tmp = num & (0x1 << i); if (tmp != 0){ ++count; } } if (max == c...
a.cc: In function 'int main()': a.cc:51:5: error: 'memset' was not declared in this scope 51 | memset(&cicadaNum[0][0],0, sizeof(cicadaNum)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#...
s431540730
p01389
C++
include <cstdlib> #include <string.h> #include <iostream> #include <string> // ciada's distribution parameter int cicadaNum[50][50]; int checkPattern(int num, int max, int total) { int count = 0; for (int i = 0; i < total; i++) { int tmp = num & (0x1 << i); if (tmp != 0){ ++co...
a.cc:1:1: error: 'include' does not name a type 1 | include <cstdlib> | ^~~~~~~ In file included from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40, from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, ...
s991385931
p01389
C++
#include <cassert> #include <iostream> #include <vector> /* デバッグ時はコメントアウトする */ #define NDEBUG static const int MAX_WEIGHT = 50; /* セミ地図の最大幅 */ static const int MAX_HEIGHT = 50; /* セミ地図の最大高さ */ int scan_input_cicada(void) { char in; std::cin >> in; return in - '0'; } void cicada(void) { int weight, height; /*...
a.cc: In function 'void cicada()': a.cc:34:9: error: 'min_encount_vector' was not declared in this scope 34 | min_encount_vector[0] = scan_input_cicada(); | ^~~~~~~~~~~~~~~~~~ a.cc:61:45: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for a...
s585349323
p01389
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s203096852
p01389
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s485640169
p01389
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s596120975
p01389
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s272303501
p01389
C++
#include<cstdio> #include<algorithm> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; const int INF=1<<29; int main(){ int h,w; scanf("%d%d ",&h,&w); char grid[50][51]; rep(i,h) gets(grid[i]); int dp[50][50]; dp[0][0]=0; rep(i,h) rep(j,w) if(i>0 || j>0) { dp[i][j]=INF; if(i>0) dp[i][j]=min(dp...
a.cc: In function 'int main()': a.cc:13:18: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | rep(i,h) gets(grid[i]); | ^~~~ | getw
s100564023
p01389
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string.h> #include<math.h> #include<cstring> using namespace std; int semi[51][51],h,w; int min(int a,int b){ if(a<b){ return a; }else{ return b; } } int route(int i,int j){ int k,sum; if(i==h-1&&j==w-1){ return 0; }else if(i==h-1){ sum=0; ...
a.cc: In function 'int main()': a.cc:37:24: error: expected ')' before ';' token 37 | while(cin>>h>>w;){ | ~ ^ | ) a.cc:37:25: error: expected primary-expression before ')' token 37 | while(cin>>h>>w;){ | ^
s037681076
p01389
C++
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(); int W = sc.nextInt(); int[][] field = new int[H][W]; for(int i = 0; i < H; i++) { String line = sc.next(); for(int j =...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:11: error: expected ':' before 'static' 4 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:4:29: error: ...
s974658157
p01389
C++
#include <cstdlib> #include <iostream> #include <vector> using namespace std; template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; } int main() { cin.tie(0); ios::sync_with_stdio(false); int h, w; cin >> h >> w; vector<vector<int> > cost(h, vector<int>(w)); for(int i = 0; i < h; ++i) { s...
a.cc: In function 'int main()': a.cc:23:51: error: 'INT_MAX' was not declared in this scope 23 | vector<vector<int> > dp(h, vector<int>(w, INT_MAX)); | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by addin...
s229970096
p01389
C++
include <iostream> #include <algorithm> using namespace std; int main(){ char mas[51][51]; int h,w,memo[51][51]; cin >> h >> w; memset(memo,0,sizeof(memo)); for(int i=0;i<h;i++){ for(int j=0;j<w;j++) cin >> mas[i][j]; } for(int i=0;i<h-1;i++) memo[i+1][0] = mas[i+1][0]-'0' + memo[i][0]; for(int i=0...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __...
s727677686
p01389
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ char mas[51][51]; int h,w,memo[51][51]; cin >> h >> w; memset(memo,0,sizeof(memo)); for(int i=0;i<h;i++){ for(int j=0;j<w;j++) cin >> mas[i][j]; } for(int i=0;i<h-1;i++) memo[i+1][0] = mas[i+1][0]-'0' + memo[i][0]; for(int i=...
a.cc: In function 'int main()': a.cc:9:3: error: 'memset' was not declared in this scope 9 | memset(memo,0,sizeof(memo)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring> ...
s079485021
p01390
C
i,z,a;main(f){for(puts("?aa");scanf("%s",&i);){a=i>>8;if(a){if(i&31^1|f&1<<a-97)return!puts("!OUT");f|=1<<a-97;printf("?%ca\n",a);}else{if(z++)return!puts("!OUT");puts("?aaa");}}}
main.c:1:1: warning: data definition has no type or storage class 1 | i,z,a;main(f){for(puts("?aa");scanf("%s",&i);){a=i>>8;if(a){if(i&31^1|f&1<<a-97)return!puts("!OUT");f|=1<<a-97;printf("?%ca\n",a);}else{if(z++)return!puts("!OUT");puts("?aaa");}}} | ^ main.c:1:1: error: type defaults to 'int' in declaration...
s559937205
p01390
C
i,z,a; main(f){ for(puts("?aa");scanf("%s",&i);){ a=i>>8; if(a){ if(i&31^1|f&1<<a-97)return!puts("!OUT"); f|=1<<a-97; printf("?%ca\n",a); }else{ if(z++)return!puts("!OUT"); puts("?aaa"); } } }
main.c:1:1: warning: data definition has no type or storage class 1 | i,z,a; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] 1 | i,z,a; | ^ main.c:1:5: error: type defaults to 'int...
s104331849
p01390
C
#include<stdio.h> int i,z,f=1,o="!OUT";int main(){for(puts("?aa");fflush(stdout),scanf("%s",&i);){if(i&31^1)return!puts(o);i>>=8;if(i){if(f&1<<i-97)return!puts(o);f|=1<<i-97;printf("?%ca\n",i);}else{if(z++)return!puts(o);puts("?aaa");}}}
main.c:2:15: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 2 | int i,z,f=1,o="!OUT";int main(){for(puts("?aa");fflush(stdout),scanf("%s",&i);){if(i&31^1)return!puts(o);i>>=8;if(i){if(f&1<<i-97)return!puts(o);f|=1<<i-97;printf("?%ca\n",i);}else{if(z++)retur...
s373050252
p01390
C
#include<stdio.h> char i[9];main(){for(puts("?a");fflush(stdout),gets(i),i[1]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));*i=!puts("!OUT");}
main.c:2:11: error: return type defaults to 'int' [-Wimplicit-int] 2 | char i[9];main(){for(puts("?a");fflush(stdout),gets(i),i[1]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));*i=!puts("!OUT");} | ^~~~ main.c: In function 'main': main.c:2:48: error: implicit declaration of function 'gets'; did you m...
s477315738
p01390
C
#include<stdio.h> char i[];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));puts("!OUT");}
main.c:2:10: error: return type defaults to 'int' [-Wimplicit-int] 2 | char i[];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));puts("!OUT");} | ^~~~ main.c:2:6: warning: array 'i' assumed to have one element 2 | char i[];main(){for(puts("?a");ff...
s702707865
p01390
C++
/* 2014.07.03 1834~1846 C language Lecture week ∞ */ #include <stdio.h> #include <string.h> char yell[8] = "xai"; int main (void) { // AIに勝つにはアルファベットが26であることを利用して何らかの文字で攻めればよい。 // 実は三文字でシステマチックに作って言っても勝てるはず // 開幕テンプレ printf ( "?bakaai\n" ); fflush ( stdout ); int ai_inp...
a.cc: In function 'int main()': a.cc:25:23: error: 'ai_input' was not declared in this scope; did you mean 'ai_input_len'? 25 | scanf ( "%s", ai_input ); | ^~~~~~~~ | ai_input_len
s741063324
p01390
C++
#include <stdio.h> #include <string.h> int judge(char str[3], char history[110][4]); int main(void) { char str[3]; char output[4]; char history[110][4]; printf("?aaa\n"); fflush(stdout); scanf("%s", str); int n = 0; strcpy(history[n], str); if ( str[0] != 'a' ) { printf("!OU...
a.cc: In function 'int main()': a.cc:24:22: error: invalid conversion from 'char' to 'char*' [-fpermissive] 24 | if (judge(str[3], history[n]) == 0) { | ~~~~~^ | | | char a.cc:24:34: error: cannot convert 'char*' to 'char (*)[4]' 24...
s687927191
p01390
C++
#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <utility> #include <stack> #include <queue> #include <map> #include <set> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #...
a.cc: In function 'int main()': a.cc:53:40: error: no match for 'operator<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 53 | while(st.count(s) && s < 10){ | ~ ^ ~~ | | | ...
s924716711
p01390
C++
#include <set> #include <ctime> #include <cstdio> #include <string> #include <cstdlib> #include <iostream> using namespace std; set<string> s; string t1, t2; int main() { srand((unsigned)time(NULL)); s.push("aaaaaaaaaa"); cout << "?aaaaaaaaaa" << endl; while(true) { cin >> t1; if(s.find(t1) != s.end() || t1[0] !...
a.cc: In function 'int main()': a.cc:11:11: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'push' 11 | s.push("aaaaaaaaaa"); cout << "?aaaaaaaaaa" << endl; | ^~~~
s408139826
p01390
C++
#include<bits/stdc++.h> using namespace std; #define r(i,n) for(int i=0;i<n;i++) main(){ set<string>st; string ans,s="?a"; while(1){ cout<<s<<endl; cout.flush(); if(res[0]=='!')break; cin>>ans; if(st.count(ans)||s[s.size()-1]!=ans[0])s="!OUT"; else s.insert(ans),s=ans[ans.size()-1]+ans; ...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:10:8: error: 'res' was not declared in this scope 10 | if(res[0]=='!')break; | ^~~ a.cc:13:18: error: no matching function for call to 'std::__cxx11...
s232049925
p01390
C++
#include<bits/stdc++.h> using namespace std; #define r(i,n) for(int i=0;i<n;i++) main(){ set<string>st; string ans,s="?a"; st.inseet("a"); while(1){ cout<<s<<endl; cout.flush(); if(s[0]=='!')break; cin>>ans; if(st.count(ans)||s[s.size()-1]!=ans[0])s="!OUT"; else st.insert(ans),s='?'+ans[...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:7:6: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'inseet'; did you mean 'insert'? 7 | st.inseet("a"); | ^~~~~~ ...