submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s404087085
p00097
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * 0 から 100 の数字から異なる n 個の数を取り出して合計が s となる組み合わせの数を出力する * n 個の数はおのおの 0 から 100 までとし、1つの組み合わせに同じ数字は使えません。 * @author sugawara-a2 * */ public class Main { final private static int LIMIT = 100; public static void main(...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fm...
s165799661
p00097
C++
#include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <deque> #include <complex> #include <stack> #include ...
a.cc:83:1: error: 'll' does not name a type; did you mean 'vll'? 83 | ll dp[11][110][1010]; | ^~ | vll a.cc: In function 'void {anonymous}::mainmain()': a.cc:86:17: error: 'dp' was not declared in this scope 86 | dp[1][i][i]=1; | ^~ a.cc:93:41: error: 'dp' was not...
s009019594
p00097
C++
#include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <deque> #include <complex> #include <stack> #include ...
a.cc:48:14: error: 'LL' was not declared in this scope; did you mean 'll'? 48 | typedef pair<LL,LL> pll; | ^~ | ll a.cc:48:17: error: 'LL' was not declared in this scope; did you mean 'll'? 48 | typedef pair<LL,LL> pll; | ^~ | ll a....
s850226492
p00097
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; __int64 dp[101][1001][10]; int main(){ int n,s; dp[0][0][0]=1; for(int i=0;i<100;i++){ for(int j=0;j<=1000;j++){ for(int k=0;k<=9;k++){ if(k<9)dp[i+1][i+j][k+1]+=dp[i][j][k]; dp[i+1][j][k]+=dp[i][j][k]; } } } w...
a.cc:5:1: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | __int64 dp[101][1001][10]; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:8:17: error: 'dp' was not declared in this scope 8 | dp[0][0][0]=1; | ^~
s796649089
p00097
C++
#define _crt_secure_no_warnings #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cs...
a.cc: In function 'long long int saiki(int, int, int)': a.cc:103:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 103 | data[a - 1][b - i][i + 1] = saiki(a - 1, b - i, i + 1); | ^ a.cc:105:38: error: inv...
s671629004
p00097
C++
#include <stdio.h> typedef long ll; ll memo[10][1010]; ll dfs(int n, int s, int x) { ll pat = 0; if (n == 0) return s == 0; if (s < 0) return 0; if (x > 100) return 0; if (memo[n][s] != -1) return memo[n][s]; for (; x <= 100; x++){ pat += dfs(n - 1, s - x, x + 1); } return pat; } int main(void) { int N,...
a.cc: In function 'int main()': a.cc:24:17: error: 'memset' was not declared in this scope 24 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> ...
s177056612
p00097
C++
#include <bits/stdc++.h> #define range(i,a,b) for(int (i)=(a);(i)<(b);(i)++) #define rep(i,n) range(i,0,n) using namespace std; int n,s; ll dp[10][1010]; int main(void){ dp[0][0]=1LL; rep(i,101){ for(int j=8;j>=0;j--)rep(k,1010){ if(k+i<=1010) dp[j+1][k+i]+=dp[j][k]; } } while(cin >> n >> s,n){ cou...
a.cc:9:1: error: 'll' does not name a type 9 | ll dp[10][1010]; | ^~ a.cc: In function 'int main()': a.cc:12:9: error: 'dp' was not declared in this scope; did you mean 'dup'? 12 | dp[0][0]=1LL; | ^~ | dup
s709757983
p00097
C++
#include <string> #include <iostream> using namespace std; int main() { int n[50], s[50], c = 0, dp[101][901][101]; long long SUM = 0; memset(dp, 0, sizeof(dp)); for (int i = 0; i <= 100; i++) { dp[1][i][i] = 1; } for (int N = 2; N <= 100; N++) { for (int i = 1; i <= 100; i++) { for (int j = 1; j...
a.cc: In function 'int main()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +++ |+#include <cst...
s757873778
p00097
C++
#include <string> #include <iostream> using namespace std; int main() { int n[50], s[50], c = 0, dp[101][101][901]; long long SUM = 0; memset(dp, 0, sizeof(dp)); for (int i = 0; i <= 100; i++) { dp[1][i][i] = 1; } for (int N = 2; N <= 100; N++) { for (int i = 1; i <= 100; i++) { for (int j = 1; j...
a.cc: In function 'int main()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +++ |+#include <cst...
s618655169
p00097
C++
#include<iostream> #include<algorithm> #include<functional> using namespace std; typedef long long ll; ll dp[1001][10][101];//???????????£?????°????????°????????£?????????????????§??? int main() { int n, s; while (cin >> n >> s, n+s) { memset(dp, 0, sizeof(dp)); for (int j = 0; j <= n; j++) { for (int i =...
a.cc: In function 'int main()': a.cc:14:17: error: 'memset' was not declared in this scope 14 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<functional> +...
s082695138
p00097
C++
ric> #include <complex> #include <sstream> #include <fstream> #include <iomanip> #include <cassert> #include <iostream> #include <iterator> #include <algorithm> using namespace std; #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i, n) REP(i, 0, n) #define lengthof(x) (sizeof(x) / sizeof(*(x))) #define ...
a.cc:1:1: error: 'ric' does not name a type 1 | ric> | ^~~ In file included from /usr/include/c++/14/complex:43, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_poi...
s198404392
p00097
C++
#include<bits/stdc++.h> using namespace std; int dp[11][1001] int serch(int i,int j,int n) { if(dp[i][j]>-1)return dp[i][j]; else if(!n&&!j)return 1; else if(i==10||!n)return 0; return dp[i][j]=serch(i+1,j-i,n-1)+serch(i+1,j,n); } int main() { int n,s; memset(dp,-1,sizeof(dp)); while(cin>>n>...
a.cc:4:1: error: expected initializer before 'int' 4 | int serch(int i,int j,int n) | ^~~ a.cc: In function 'int main()': a.cc:14:12: error: 'dp' was not declared in this scope; did you mean 'dup'? 14 | memset(dp,-1,sizeof(dp)); | ^~ | dup a.cc:15:33: error: 'serch' wa...
s595612427
p00097
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define FOR(i,a,b) for(int i=a;i<=b;i++) #define DOWN(i,b,a) for(int i=b;i>=a;i--) typedef long long ll; int main() { ll dp[11][1001]={}; dp[0][0] = 1; FOR(k,0,101) DOWN(i,10,1) FOR(j,k,1000) dp[i][j] += dp[i-1][j-k]; int n, s; while(cin>>n...
a.cc: In function 'int main()': a.cc:16:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 16 | while(cin>>n>>s,n) cout << dp[n][s] << endl; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1:...
s292738015
p00097
C++
#include <iostream> using namespace std; long long x,s,dp[11][1001]; int main(void){ dp[0][0] = 1; for(int i=0;i<101;i++) for(int j=9;j>=0;j--) for(int k=0;i+k<1001;k++) dp[j+1][k+i]+=dp[j][k]; while(cin >> x >> s, n|s) cout << dp[x][s] << endl; ret...
a.cc: In function 'int main()': a.cc:12:26: error: 'n' was not declared in this scope 12 | while(cin >> x >> s, n|s) | ^
s370244560
p00097
C++
#include <stdio.h> #include <cmath> #include <algorithm> #include <stack> #include <queue> #include <vector> using namespace std; long long int*** dp; void func(int n,int s){ for(int i = 1; i <= n; i++){ for(int k = 0; k <= 100; k++){ for(int p = 0; p <= s; p++)dp[i][k][p] = 0; } } for(int i = 0; i <= 100...
a.cc: In function 'int main()': a.cc:43:14: error: cannot convert 'int***' to 'long long int***' in assignment 43 | dp = new int**[10]; | ^~~~~~~~~~~~~ | | | int*** a.cc:45:25: error: cannot convert 'int**' to 'long long int**' in assignment 45 | ...
s800951153
p00097
C++
#include <stdio.h> #include <cmath> #include <algorithm> #include <stack> #include <queue> #include <vector> using namespace std; int main(){ long long int dp = new long long int**[10]; for(int i = 1; i <= 9; i++){ dp[i] = new long long int*[101]; for(int k = 0; k <= 100; k++){ dp[i][k] = new long long int[...
a.cc: In function 'int main()': a.cc:12:50: error: invalid conversion from 'long long int***' to 'long long int' [-fpermissive] 12 | long long int dp = new long long int**[10]; | ^ | | | ...
s311276005
p00097
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #define max(a,b) {a > b ? a:b} using namespace std; //????´????????????§????????????????????? #define P 101 #define MAX 1000000000 int cnt; void rec(int prev_i, int n, int s) { if (n == 1) { if (s > prev_i && s <= 1...
a.cc: In function 'void rec(int, int, int)': a.cc:31:39: error: expected '}' before 's' 31 | for (int i = max(prev_i + 1,0 s - 100* n); i < P; i++) { | ^ a.cc:7:23: note: in definition of macro 'max' 7 | #define max(a,b) {a > b ? a:b} | ...
s918212694
p00097
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #define max(a,b) {a > b ? a:b} using namespace std; //????´????????????§????????????????????? #define P 101 #define MAX 1000000000 int cnt; void rec(int prev_i, int n, int s) { //if (cnt > MAX) return; /*if (!n) { if (...
/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
s176911155
p00097
C++
# include <iostream> # include <algorithm> # include <vector> # include <string> # include <set> # include <map> # include <cmath> # include <iomanip> # include <functional> # include <utility> # include <stack> # include <queue> # include <list> constexpr int MOD = 1000000000 + 7; constexpr int INF = 2000000000; using...
a.cc: In function 'int main()': a.cc:21:9: error: 'memset' was not declared in this scope 21 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | # include <list> +++ |+#include <cstri...
s145145506
p00097
C++
#include <bits/stdc++.h> using namespace std; int x,y; int cnt[]; int mySet(int d,int sum,int n){ int a=0; if(d==x){ if(sum==y){ return 1; }else{ return 0; } } for(int j=n;j<=9;j++){ a+=mySet(d+1,sum+j,j+1); } return a; } int main(void){ while(1){ cin>>x>>y; if(x==0&&y==0){ break; }els...
a.cc:5:6: error: storage size of 'cnt' isn't known 5 | int cnt[]; | ^~~
s698283312
p00097
C++
#include<iostream> using namespace std; int memo[10][1001]; int solve(int n, int s, int p){ if(!n && !s) return 1; if(n < 1 || s < 1) return 0; if(memo[n][s]) return memo[n][s]; int ans = 0; for(int i=p;i<101;i++) ans += solve(n-1, s-i, i+1); return memo[n][s] = ans; } int main(){ int n, s; whil...
a.cc: In function 'int main()': a.cc:25:5: error: 'memset' was not declared in this scope 25 | memset(memo, 0, sizeof(memo)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring>...
s807961407
p00097
C++
#include <cstring> #include <iostream> #include <algorithm> using namespace std; long long memo[101][10][1001]; // x以下からちょうどk個でsを作る long long solve(int x, int k, int s) { if(k == 0 && s == 0) return 1; if(s < 0) return 0; if(x < 0) return 0; if(k == 0) return 0; int &res = memo[x][k][s]; if(res != -1) re...
a.cc: In function 'long long int solve(int, int, int)': a.cc:15:26: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int' 15 | int &res = memo[x][k][s]; | ~~~~~~~~~~~~^
s029638473
p00097
C++
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <vector> #include <string> #include <map> #include <set> #include <queue> #include <stack> #include <algorithm> using namespace std; #define rep(i,j) REP((i), 0, (j)) #define REP(i,j,k) for(int i=(j);(i)<(k);++i) #de...
a.cc: In function 'int main()': a.cc:41:30: error: expected '}' at end of input 41 | printf("%d\n", dp[n][s]); | ^ a.cc:25:11: note: to match this '{' 25 | int main(){ | ^
s040741658
p00098
C
#include <stdio.h> #define max(a,b) (a)>(b) ? (a):(b); int n; int a[100][100]; long psum[100][100][100]; main(){ int i,j,k,l; long maxsum; int t1; scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j]); maxsum=psum[0][0][0]=a[0][0]; for(l=1;l<n;l++){ psum[0][0][l]=psum[0][0][l-1]+a[0][l];...
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int] 6 | main(){ | ^~~~ main.c: In function 'main': main.c:46:33: error: 't2' undeclared (first use in this function); did you mean 't1'? 46 | t2=0; | ^~ | ...
s245274431
p00098
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
s062097019
p00098
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long ll; class SumOf2DArray { private: vector<vector<int> > a; vector<vector<ll> > S; int N_, M_; void precalc() { for(int i=0; i<N_; i++) for(int j=0; j<M_; j++) S[i+1][j+1] = S[i+1][j] + a[i][...
a.cc: In member function 'll SumOf2DArray::maxSum()': a.cc:46:14: error: 'LLONG_MIN' was not declared in this scope 46 | ll res = LLONG_MIN; | ^~~~~~~~~ a.cc:4:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <algor...
s004342135
p00098
C++
#include<iostream> using namespace std; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) int main(){ int n; while(cin>>n){ if(n==0)break; int data[101][101]; rep(i,n){ rep(j,n){ cin>>data[i][j]; } } int ans=-999999999; rep(i,n){ rep(j,n){ int dp[101][101]; rep(k,101)rep(l,101)dp[k][l]...
a.cc: In function 'int main()': a.cc:6:22: error: 'll' was not declared in this scope 6 | #define rep(i,n) for(ll i=0;i<(ll)(n);i++) | ^~ a.cc:13:17: note: in expansion of macro 'rep' 13 | rep(i,n){ | ^~~ a.cc:13:21: error: 'i' was not declared in ...
s261802426
p00098
C++
#include<iostream> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) int main(){ int n; while(cin>>n){ if(n==0)break; int data[101][101]; rep(i,n){ rep(j,n){ cin>>data[i][j]; } } int ans=-999999999; rep(i,n){ rep(j,n){ int dp[101][101]; rep(k,101)rep(l,101)dp[k][...
a.cc: In function 'int main()': a.cc:49:23: error: 'ans' was not declared in this scope; did you mean 'abs'? 49 | cout<<ans<<endl; | ^~~ | abs a.cc: At global scope: a.cc:52:9: error: expected unqualified-id before 'return' 52 | retur...
s091344437
p00098
C++
int main() { int n; cin >> n; cin.ignore(); long data[n][n]; for (int i = 0; i < n; i++) { string strRow = ""; getline(cin, strRow); vector<string> row = split(strRow, " "); for (int j = 0; j < row.size(); j++) { data[i][j] = stoi(row[j]); } } ...
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> n; cin.ignore(); | ^~~ a.cc:8:9: error: 'string' was not declared in this scope 8 | string strRow = ""; | ^~~~~~ a.cc:9:22: error: 'strRow' was not declared in this scope 9 | ...
s345557128
p00098
C++
#include <cstdio> #include <algorithm> using namespace std; int n, a[100][100], sum[100][100]; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { for(int j = 0; j < n; i++) { cin >> a[i][j]; } } sum[0][0] = a[0][0]; for(int i = 1; i <...
a.cc: In function 'int main()': a.cc:16:13: error: 'cin' was not declared in this scope 16 | cin >> a[i][j]; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <algorithm> +++ |+#include <iostre...
s478152310
p00098
C++
#include <cstdio> #include <algorithm> using namespace std; int n, a[100][100], sum[100][100]; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { for(int j = 0; j < n; i++) { cin >> a[i][j]; } } sum[0][0] = a[0][0]; for(int i = 1; i <...
a.cc: In function 'int main()': a.cc:16:13: error: 'cin' was not declared in this scope 16 | cin >> a[i][j]; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <algorithm> +++ |+#include <iostre...
s808211693
p00098
C++
#include<iostream> using namespace std; int S[110][110] = { 0 }, a[110][110]; int main(){ int n,max=-50000,t; cin >> n; for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ cin >> a[i][j]; S[i + 1][j + 1] = S[i][j + 1] + S[i + 1][j]; } } for (int i = 1; i <= n; i++){ for (int j = 1; j <= n; j++...
a.cc: In function 'int main()': a.cc:21:50: error: expected primary-expression before '?' token 21 | if (max ??? t)max = t; | ^ a.cc:21:51: error: expected primary-expression before '?' token 21 | ...
s175925949
p00098
C++
#include<iostream> #include<algorithm> using namespace std; long long map[101][101]; int main(){ int n,a; cin>>n; for(int i=0;i<=n;i++)map[i][0]=0; for(int j=0;j<=n;j++)map[0][j]=0; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin>>a; map[i][j]=map[i-1][j]+map[i][j-1]-map[i-1][j-1]+a; } } int ans=0; ...
a.cc: In function 'int main()': a.cc:21:48: error: no matching function for call to 'max(int&, long long int)' 21 | ans=max(ans,map[is][js]-map[is][j]-map[i][js]+map[i][j]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s273194111
p00098
C++
#include<bits/stdc++.h> using namespace std; int map[101][101]; int main(){ int n,a; cin>>n; for(int i=0;i<=n;i++)map[i][0]=0; for(int j=0;j<=n;j++)map[0][j]=0; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin>>a; map[i][j]=map[i-1][j]+map[i][j-1]-map[i-1][j-1]+a; } } int ans=-1000000000; for(int i=0...
a.cc: In function 'int main()': a.cc:7:30: error: reference to 'map' is ambiguous 7 | for(int i=0;i<=n;i++)map[i][0]=0; | ^~~ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, fr...
s827547821
p00098
C++
#include<bits/stdc++.h> using namespace std; int map[101][101]; int main(){ int n,a; cin>>n; for(int i=0;i<=n;i++)map[i][0]=0; for(int j=0;j<=n;j++)map[0][j]=0; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin>>a; map[i][j]=map[i-1][j]+map[i][j-1]-map[i-1][j-1]+a; } } int ans=-1000000000; for(int i=0...
a.cc: In function 'int main()': a.cc:7:30: error: reference to 'map' is ambiguous 7 | for(int i=0;i<=n;i++)map[i][0]=0; | ^~~ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, fr...
s056481167
p00098
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <stdio.h> #include <ctype.h> #include <string> #include <iostream> #include <vector> #include <stack> #include <fstream> #include <sstrea int mat[SIZE + 1][SIZE + 1] = { 0 }; int maxSumSeq(int* x, int len) { int mss, s; mss = s = 0; for (int i = 0...
a.cc:11:17: error: missing terminating > character 11 | #include <sstrea | ^ a.cc:11:10: fatal error: sstrea: No such file or directory 11 | #include <sstrea | ^ compilation terminated.
s450308207
p00098
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <stdio.h> #include <ctype.h> #include <string> #include <iostream> #include <vector> #include <stack> #include <fstream> #include <sstream> #include <queue> #include <exception> #include <cmath> #include <numeric> #define SIZE 100 using namespace std...
a.cc: In function 'void AOJ0098()': a.cc:61:22: error: 'INT32_MIN' was not declared in this scope 61 | int maxSum = INT32_MIN; | ^~~~~~~~~
s071992263
p00098
C++
#include<iostream> #include "fill.h" using namespace std; int A[100][100]={0}; int S[101][101]={0}; int main(){ Fill(A,0); Fill(S,0); int n; cin>>n; for(int i=0;i<n;++i){ for(int j=0;j<n;++j){ cin>>A[i][j]; } } for(int i=0;i<n;++i){ for...
a.cc:2:10: fatal error: fill.h: No such file or directory 2 | #include "fill.h" | ^~~~~~~~ compilation terminated.
s972383482
p00098
C++
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0098 TLE n=85だと通らない """ import sys from sys import stdin from functools import lru_cache input = stdin.readline def calc_points(n, array): # 右下から(x, y)までの長方形に含まれる値の和 global dp for y in range(n - 1, -1, -1): for x ...
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:2:3: warning: missing terminating " character 2 | """ | ^ a.cc:2:3: error: missing terminating " character a.cc:5:3: warning: missing terminating " character 5 | """ | ^ a.cc:5:3: error: missing ...
s118521988
p00098
C++
// // main.cpp // Maximum Sum Sequence II // // Created by 八代 光平 on 13/04/24. // Copyright (c) 2013年 八代 光平. All rights reserved. // #include <iostream> #include <stdio.h> #include <stdlib.h> #define N 100 int sum(int top, int under, int left, int right, int a[N][N], int temp); //int search(int top, int under, int...
a.cc: In function 'int main(int, const char**)': a.cc:39:29: error: too few arguments to function 'int sum(int, int, int, int, int (*)[100], int)' 39 | temp=sum(i, k, j, l, a); | ~~~^~~~~~~~~~~~~~~ a.cc:14:5: note: declared here 14 | int sum(int top, int under, i...
s478538002
p00099
Java
public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = in.readLine().split(" "); int n= Integer.parseInt(nq[0]); int q= Integer.parseInt(nq[1]); String[] av; int a; in...
Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) throws java.io.IOException { ^ (use --enable-preview to enable unnamed classes) Main.java:60: error: class, interface, enum, or record expected } ^ 2 errors
s645032779
p00099
Java
public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = in.readLine().split(" "); int n= Integer.parseInt(nq[0]); int q= Integer.parseInt(nq[1]); String[] av; int a; in...
Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) throws java.io.IOException { ^ (use --enable-preview to enable unnamed classes) Main.java:50: error: class, interface, enum, or record expected } ^ 2 errors
s857546701
p00099
Java
public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = in.readLine().split(" "); int n= Integer.parseInt(nq[0]); int q= Integer.parseInt(nq[1]); String[] av; int a; in...
Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) throws java.io.IOException { ^ (use --enable-preview to enable unnamed classes) Main.java:42: error: class, interface, enum, or record expected } ^ 2 errors
s820261520
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq...
Main.java:66: error: reached end of file while parsing } ^ 1 error
s937385001
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq...
Main.java:66: error: reached end of file while parsing } ^ 1 error
s042051047
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = ...
Main.java:71: error: reached end of file while parsing } ^ 1 error
s883422082
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = ...
Main.java:64: error: reached end of file while parsing } ^ 1 error
s224320730
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = ...
Main.java:64: error: reached end of file while parsing } ^ 1 error
s616542218
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = ...
Main.java:63: error: reached end of file while parsing } ^ 1 error
s310341846
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = ...
Main.java:41: error: reached end of file while parsing } ^ 1 error
s820941388
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = ...
Main.java:34: error: reached end of file while parsing } ^ 1 error
s288560882
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; String[] nq = ...
Main.java:30: error: reached end of file while parsing } ^ 1 error
s403928881
p00099
Java
//Surf Smelt Fishing Contest II import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main(String[] args) throws java.io.IOException { String[] av; int a; int v; int top=1; int second=1; int count=0; }
Main.java:24: error: reached end of file while parsing } ^ 1 error
s592071974
p00099
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Comparator; import java.util.PriorityQueue; import java.util.Queue; /** * Surf Smelt Fishing Contest II */ public class Main { public static void main(String[] args) throws IOException { BufferedReader b...
Main.java:18: error: cannot find symbol P0099 main = new P0099(); ^ symbol: class P0099 location: class Main Main.java:18: error: cannot find symbol P0099 main = new P0099(); ^ symbol: class P0099 location: class Main 2 errors
s139176568
p00099
Java
//Volume0-0099 import java.util.*; public class Main_02 { public static void main(String[] args) { int n,q,a,v,top; int[] sum; Scanner sc = new Scanner(System.in); n = sc.nextInt(); sum = new int[n+2]; top = n+1; sum[top] = Integer.MIN_VALUE; q = sc.nextInt(); for(int i=0;i<q;i++){ a = sc.nextInt...
Main.java:4: error: class Main_02 is public, should be declared in a file named Main_02.java public class Main_02 { ^ 1 error
s932791878
p00099
C
#include <stdio.h> void array_clear(int pep[],int num){ int i; for(i=1;i<=n;i++){ pep[i]=0; } } int main(void){ int pep[1000000]; int n,q; int i; int a,v; int maxa,maxv; scanf("%d%d",&n,&q); array_clear(pep,n); maxa=0; maxv=-1; for(i=0;i<q;i++){ scanf("%d%d",&a,&v); pep[a] +=...
main.c: In function 'array_clear': main.c:6:14: error: 'n' undeclared (first use in this function) 6 | for(i=1;i<=n;i++){ | ^ main.c:6:14: note: each undeclared identifier is reported only once for each function it appears in
s486159082
p00099
C
for(i=0;i<=n;i++){f[i]=0;prev[i]=0;next[i]=0;} for(i=0;i<9000;i++)vv[i]=0; for(;q>0;q--){ scanf("%d %d",&a,&v); x=f[a]; if(x>0){ if(vv[x]==a){ if(next[a]>0){vv[x]=next[a];} else vv[x]=0; } next[prev[a]]=next[a]; prev[next[a]]=prev[a]; prev[0]=0;next[0]=0; } f[a]+=v;x+=v; if(x...
main.c:1:9: error: expected identifier or '(' before 'for' 1 | for(i=0;i<=n;i++){f[i]=0;prev[i]=0;next[i]=0;} | ^~~ main.c:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token 1 | for(i=0;i<=n;i++){f[i]=0;prev[i]=0;next[i]=0;} | ^~ ...
s709352797
p00099
C
#include <stdio.h> #include <assert.h> int main(void){ int i,x,n,q,a,v,aaa=0,vvv=0,vv[9000],f[1000001],next[1000001],prev[1000001]; scanf("%d %d",&n,&q); for(i=0;i<=1000000;i++){f[i]=0;prev[i]=0;next[i]=0;}assert(false); for(i=0;i<9000;i++)vv[i]=0; for(i=0;i<=n;i++)printf("%d %d %d\n",f[i],prev[i],next[i]); for(...
In file included from main.c:2: main.c: In function 'main': main.c:6:68: error: 'false' undeclared (first use in this function) 6 | for(i=0;i<=1000000;i++){f[i]=0;prev[i]=0;next[i]=0;}assert(false); | ^~~~~ main.c:3:1: note: 'false' is...
s702274822
p00099
C
int main(void){ int i,x,n,q,a,v,aaa=0,vvv=0,vv[9000],f[1000001],prev[1000001],next[1000001]; scanf("%d %d",&n,&q); for(i=0;i<=n;i++){f[i]=0;prev[i]=0;next[i]=0;} for(i=0;i<9000;i++)vv[i]=0; for(;q>0;q--){ scanf("%d %d",&a,&v); x=f[a]; printf("%d\n",x); if(x>0){ if(vv[x]==a){ if(next[a]>0){vv[x]=n...
main.c: In function 'main': main.c:3:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d %d",&n,&q); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:3:9: w...
s813908324
p00099
C
#include <stdio.h> int main(void) { int n,q,num,fish,i,j,vic=0,max=0,get[100]; scanf("%d %d",&n,&q); for(i=1;i<=n;i++){ get[i]=0; } for(i=0;i<q;i++){ scanf("%d %d",&num,&fish); get[0]+=fish; if(fish<0 && num) max=0; for(j=n;j>0;j--){ if(max<=get[j]){ max=get[j]; vic=j; } } else i...
main.c: In function 'main': main.c:23:17: error: 'else' without a previous 'if' 23 | else if(get[num]>max || (get[num]==max && vic>num)){ | ^~~~
s512164151
p00099
C
#include<stdio.h> int main(){ int n,q,i,j; scanf("%d %d",&n,&q); int top=0; int participant[n]; int x[q]; int y[q]; for(i=0;i<n;i++){ participant[i]=0; } for(i=0;i<q;i++){ int a,v; scanf("%d %d",&a,&v); participant[a-1]+=v; if(a-1!=top){ if(participant[top]<participant[a-1]){ top=a-1; }else{ top=0; for(j=1;j<n;j++){ i...
main.c: In function 'main': main.c:34:1: error: expected declaration or statement at end of input 34 | } | ^ main.c:34:1: error: expected declaration or statement at end of input
s813451148
p00099
C
n, q = gets.chomp.split(" ").map{|s| s.to_i} avs = [nil] + (1..n).map{|a| [a, 0]} avcache = {} max_a = 1 max_v = 0 q.times.each do a, v = gets.chomp.split(" ").map{|s| s.to_i} av0 = avs[a] v0 = (av0[1] += v) if v > 0 avcache[a] = av0 if avcache[a].nil? if max_v < v0 max_v = v0 max_a = a...
main.c:1:1: warning: data definition has no type or storage class 1 | n, q = gets.chomp.split(" ").map{|s| s.to_i} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:1:4: error: type defaults to 'int' in declaration of 'q' [-Wimplicit-int] 1 | n, q = gets.chomp.spl...
s362946508
p00099
C++
#include <iostream> #include <vector> #include <algorithm> #include <map> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; long long int n[1000001]; int flag[1000001]; map<int,int> m; int main() { memset(n,0,sizeof(n)); memset(flag,0,sizeof(flag)); int num,_q; cin >> num >> _q; rep(i,_q) { int ...
a.cc: In function 'int main()': a.cc:15:9: error: 'memset' was not declared in this scope 15 | memset(n,0,sizeof(n)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <map> +++ |+#include <cstring> ...
s974827338
p00099
C++
#include <iostream> #include <cstdio> #include <algorithm> #define MAX_N 1000000 #define MAX_Q 100000 #define INF -1 using namespace std; struct Human { int no; int point; }; typedef struct Human Human; int compareTo(const Human a, const Human b) { return(a.point > b.point); } void output(int nowData[], ...
a.cc: In function 'int main()': a.cc:36:5: error: 'memset' was not declared in this scope 36 | memset(nowData, 0, sizeof(nowData)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <...
s040246350
p00099
C++
#include <iostream> #include <queue> #include <cstdio> #define MAX_N 1000000 #define MAX_Q 100000 using namespace std; typedef pair<int, int> P; //番号, 匹数 int ary[MAX_N + 1]; int n, q; struct Greater { bool operator() (const P a, const P b) { if(a.first == b.first) { //匹数が同じなら return(a.second > ...
a.cc: In function 'void clear()': a.cc:23:12: error: reference to 'data' is ambiguous 23 | while(!data.empty()) data.pop(); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bi...
s978469296
p00099
C++
#include <iostream> using namespace std; int main() { int n, q; cin >> n >> q; int* fish = new int[n]; for (int i = 0; i < n; ++i) { fish[i] = 0; } for (; q; --q) { int a, v; cin >> a >> v; fish[a - 1] += v; int max = 0; for (int i = 0; i < n; ++i) { if (fish[max] < fish[i]) { max = i; ...
a.cc:32:17: error: expected unqualified-id before 'for' 32 | for (int i = 0; i < n; ++i) { | ^~~ a.cc:32:33: error: 'i' does not name a type 32 | for (int i = 0; i < n; ++i) { | ^ a.cc:32:40: error: expected unqualified-id...
s988322340
p00099
C++
#include <iostream> using namespace std; #define MAX_EVENT 100000 int main() { int n, q, a, v, max_id, max_fish = -1; cin >> n >> q; int* player_id = new int [MAX_EVENT]; int* player_fish = new int [MAX_EVENT]; int entry = 0; while(q--) { cin >> a >> v; auto v1 = v; for(i...
a.cc: In function 'int main()': a.cc:16:23: error: expected '}' at end of input 16 | break; | ^ a.cc:14:35: note: to match this '{' 14 | if(player_id[i] == a) { | ^ a.cc:16:23: error: expected '}' at end of input 16...
s870318065
p00099
C++
#include <iostream> #include <complex> #include <sstream> #include <string> #include <algorithm> #include <deque> #include <list> #include <map> #include <numeric> #include <queue> #include <vector> #include <set> #include <limits> #include <cstdio> #include <cctype> #include <cmath> #include <cstring> #include <cstdli...
a.cc:27:17: error: 'INT_MAX' was not declared in this scope 27 | const int INF = INT_MAX; | ^~~~~~~ a.cc:20:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 19 | #include <ctime> +++ |+#include <climits> 20 | using namespace st...
s697543301
p00099
C++
#include<stdio.h> #defin BB 1000001 int main(){ int n[BB][2]={}; int x,y,N,Q; int M,R; scanf("%d %d",&N,&Q); for(int i=0;i<Q;i++){ scanf("%d %d",&x,&y) n[x][0]+=y; if(i==0)M=x;R=y; if(n[x][0]>R){R=n[x][0];M=x;} else if(n[x][0]==R&&x<M){R=n[x][0];M=x;} printf("%d %d\n",M,R); } return 0; }
a.cc:2:2: error: invalid preprocessing directive #defin; did you mean #define? 2 | #defin BB 1000001 | ^~~~~ | define a.cc: In function 'int main()': a.cc:6:7: error: 'BB' was not declared in this scope 6 | int n[BB][2]={}; | ^~ a.cc:13:21: error: expected ';' before 'n' 13 | scanf(...
s519403124
p00099
C++
#include<stdio.h> #define BB 1000001 int main(){ int n[BB][2]={}; int x,y,N,Q; int M,R; scanf("%d %d",&N,&Q); for(int i=0;i<Q;i++){ scanf("%d %d",&x,&y) n[x][0]+=y; if(i==0)M=x;R=y; if(n[x][0]>R){R=n[x][0];M=x;} else if(n[x][0]==R&&x<M){R=n[x][0];M=x;} printf("%d %d\n",M,R); } return 0; }
a.cc: In function 'int main()': a.cc:13:21: error: expected ';' before 'n' 13 | scanf("%d %d",&x,&y) | ^ | ; 14 | n[x][0]+=y; | ~
s613700751
p00099
C++
#include <iostream> #include<map> #include <stdio.h> #include <tchar.h> #include <cstdio> #include <algorithm> #include <queue> using namespace std; priority_queue<pair<int, int> > q; int n, m, d[1000001], a, b; int main(){ scanf_s("%d%d", &n, &m); q.push(make_pair(0, -1)); for(int i=0;i<m;i++){ ...
a.cc:4:10: fatal error: tchar.h: No such file or directory 4 | #include <tchar.h> | ^~~~~~~~~ compilation terminated.
s227221114
p00099
C++
#include <iostream> #include<map> #include <stdio.h> #include <tchar.h> #include <cstdio> #include <algorithm> #include <queue> using namespace std; priority_queue<pair<int, int> > q; int n, m, d[1000001], a, b; main(){ scanf_s("%d%d", &n, &m); q.push(make_pair(0, -1)); for(int i=0;i<m;i++){ scan...
a.cc:4:10: fatal error: tchar.h: No such file or directory 4 | #include <tchar.h> | ^~~~~~~~~ compilation terminated.
s895985235
p00099
C++
#include <iostream> #include<map> #include <stdio.h> #include <tchar.h> #include <cstdio> #include <algorithm> #include <queue> using namespace std; priority_queue<pair<int, int> > q; int n, m, d[1000001], a, b; main(){ scanf("%d%d", &n, &m); q.push(make_pair(0, -1)); for(int i=0;i<m;i++){ scanf(...
a.cc:4:10: fatal error: tchar.h: No such file or directory 4 | #include <tchar.h> | ^~~~~~~~~ compilation terminated.
s193436063
p00099
C++
#include <sstream> using namespace std; int find_max(int* arr, int size) { int max = -1; for (int i = 0; i < size; i++) { if (arr[max] < arr[i]) { max = i; } } return max; } int main() { int n, q; cin >> n >> q; int* m = (int*)malloc(sizeof(int) * n); for...
a.cc: In function 'int main()': a.cc:18:5: error: 'cin' was not declared in this scope 18 | cin >> n >> q; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <sstream> +++ |+#include <iostream> 2 | a.cc:45...
s651518728
p00099
C++
#include<bits/stdc++.h> ui\/ p@?????????p??????m????????????????????????bfcgcdsjbgvfdgm???l???j???????????????gfk???t??????????????????????????????????°?m???j??????h???????????£??£??£??£??£??£??£??£??£??£??£??£??£??£??£??£???
a.cc:2:3: error: stray '\' in program 2 | ui\/ | ^ a.cc:3:2: error: stray '@' in program 3 | p@?????????p??????m????????????????????????bfcgcdsjbgvfdgm???l???j???????????????gfk???t??????????????????????????????????°?m???j??????h???????????£??£??£??£??£??£??£??£??£??£??£??£??£??£??£??£??? | ^ a.c...
s183365656
p00099
C++
#include <iostream> #include <stdio.h> #include <queue> using namespace std; typedef pair<int, int> P; void q99() { int n, q; for (; cin >> n >> q;) { //first??§???????????????????????????first??????second??§?????? auto comp = [](P l, P r) { return l.first != r.first ? l.first < r.first : l.second < r.second; ...
a.cc: In function 'void q99()': a.cc:16:17: error: 'memset' was not declared in this scope 16 | memset(fish, 0, sizeof(fish)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <queue> +...
s076965420
p00099
C++
#include <iostream> #include <stdio.h> #include <queue> using namespace std; typedef pair<int, int> P; void q99() { int n, q; for (; cin >> n >> q;) { //first??§???????????????????????????first??????second??§?????? auto comp = [](P l, P r) { return l.first != r.first ? l.first < r.first : l.second < r.second; ...
a.cc: In function 'void q99()': a.cc:16:17: error: 'memset' was not declared in this scope 16 | memset(fish, 0, sizeof(fish)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <queue> +...
s178799934
p00099
C++
#include <iostream> #include <queue> #include <string> using namespace std; typedef pair<int, int> P; int fish[100000]; //first??§???????????????????????????first??????second??§?????? auto comp = [](P l, P r) { return l.first != r.first ? l.first < r.first : l.second < r.second; }; void q99() { int n, q; for (; ci...
a.cc: In function 'void q99()': a.cc:17:17: error: 'memset' was not declared in this scope 17 | memset(fish, 0, sizeof(fish)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +...
s664672295
p00099
C++
#include <iostream> #include <queue> #include <string> using namespace std; typedef pair<int, int> P; int fish[100000]; //first??§???????????????????????????first??????second??§?????? auto comp = [](P l, P r) { return l.first != r.first ? l.first < r.first : l.second < r.second; }; void q99() { int n, q; for (; ci...
a.cc: In function 'void q99()': a.cc:17:17: error: 'memset' was not declared in this scope 17 | memset(fish, 0, sizeof(fish)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +...
s345349362
p00099
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #define min(a,b) {a > b ? b:a} using namespace std; long long int seg[1000000 * 2]; int id[1000000 * 2]; void q99() { int n, q; cin >> n >> q; for (int i = 0; i < N; i++) { id[i + N] = i; } for (int i = 0; i < q;...
a.cc: In function 'void q99()': a.cc:16:29: error: 'N' was not declared in this scope 16 | for (int i = 0; i < N; i++) { | ^ a.cc:22:17: error: 'segment' was not declared in this scope 22 | segment[N + a - 1] += v; | ^~~~~~~ a.cc:22:2...
s599547377
p00099
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #define min(a,b) {a > b ? b:a} using namespace std; long long int segment[1000000 * 2]; int id[1000000 * 2]; void q99() { int n, q; cin >> n >> q; for (int i = 0; i < N; i++) { id[i + N] = i; } for (int i = 0; i ...
a.cc: In function 'void q99()': a.cc:16:29: error: 'N' was not declared in this scope 16 | for (int i = 0; i < N; i++) { | ^ a.cc:22:25: error: 'N' was not declared in this scope 22 | segment[N + a - 1] += v; | ^
s569948139
p00099
C++
#include<stdio.h> using namespace std;priority_queue<pair<int,int> >p;int n,q,a,b,d[1<<20];int main(){cin>>n>>q;a=n;while(a--)p.push(make_pair(0,a)),d[a]=0;while(q--){cin>>a>>b;a=n-a,d[a]+=b;p.push(make_pair(d[a],a));while(1){a=p.top().first,b=p.top().second;if(d[b]==a){cout<<n-b<<" "<<a<<endl;break;}p.pop();}}return 0...
a.cc:2:21: error: 'priority_queue' does not name a type 2 | using namespace std;priority_queue<pair<int,int> >p;int n,q,a,b,d[1<<20];int main(){cin>>n>>q;a=n;while(a--)p.push(make_pair(0,a)),d[a]=0;while(q--){cin>>a>>b;a=n-a,d[a]+=b;p.push(make_pair(d[a],a));while(1){a=p.top().first,b=p.top().second;if(d[b]==a){cou...
s561980731
p00099
C++
#include<iostream> using namespace std;priority_queue<pair<int,int> >p;int n,q,a,b,d[1<<20];int main(){cin>>n>>q;a=n;while(a--)p.push(make_pair(0,a)),d[a]=0;while(q--){cin>>a>>b;a=n-a,d[a]+=b;p.push(make_pair(d[a],a));while(1){a=p.top().first,b=p.top().second;if(d[b]==a){cout<<n-b<<" "<<a<<endl;break;}p.pop();}}return ...
a.cc:2:21: error: 'priority_queue' does not name a type 2 | using namespace std;priority_queue<pair<int,int> >p;int n,q,a,b,d[1<<20];int main(){cin>>n>>q;a=n;while(a--)p.push(make_pair(0,a)),d[a]=0;while(q--){cin>>a>>b;a=n-a,d[a]+=b;p.push(make_pair(d[a],a));while(1){a=p.top().first,b=p.top().second;if(d[b]==a){cou...
s818705445
p00099
C++
#include<iostream> using namespace std; int main(){ int n, q, a, v; int cnt[1000001]={}, x, ma; cin>>n>>q; for(int i=0;i<q;i++){ cin>>a>>v; cnt[a]+=v; ma=0; x=1; for(int j=1;j<=n;j++){ if(cnt[j]>ma){ ma=cnt[j]; x=j; }else if(cnt[j]==ma&&x>j) x=j; } cout<<x<<" "<<ma...
a.cc: In function 'int main()': a.cc:22:4: error: expected '}' at end of input 22 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s511549669
p00099
C++
import sys def f(): w=m=0;n,q=map(int,input().split());s=[0]*-~n for e in sys.stdin: a,v=map(int,e.split());s[a]+=v if v<0 and a==w:m=max(s);w=s.index(m) elif s[a]>m:w,m=a,s[a] elif s[a]==m:w=min(w,a) print(w,m) f()
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' a.cc:3:8: error: 'n' does not name a type 3 | w=m=0;n,q=map(int,input().split());s=[0]*-~n | ^ a.cc:3:37: error: 's' does not name a type 3 | w=m=0;n,...
s271988656
p00099
C++
#include<iostream> #include<vector> using namespace std; int main() { int n, q, a, v; int maxA, maxV; cin>>n>>q; vector<int> list(n, 0); maxA = maxV = 0; while(cin>>a>>v) { a--; list[a] += v; if(v>0) { if(maxV < m[a]) { maxA = a; ...
a.cc: In function 'int main()': a.cc:15:23: error: 'm' was not declared in this scope 15 | if(maxV < m[a]) { | ^
s354419877
p00099
C++
int main(){ int q,num,v,max,maxnum; maxnum = 0; cin >> n >> q; int wakasagi[10000]; max = wakasagi[0]; maxnum=0; for(int i=0;i<q;i++){ cin >> num >> v; wakasagi[num] += v; if(v < 0){ if(num == maxnum){ wsearch(&max,&maxnum,wakasagi); } } else if(v > 0){ if(num != maxnum){ ws...
a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope 7 | cin >> n >> q; | ^~~ a.cc:7:16: error: 'n' was not declared in this scope 7 | cin >> n >> q; | ^ a.cc:17:33: error: 'wsearch' was not declared in this scope 17 | ...
s649947496
p00099
C++
if(f[B] == A) { cout << B << " " << A << endl; break; } else { pq.pop(); } } }
a.cc:3:7: error: expected unqualified-id before 'if' 3 | if(f[B] == A) { | ^~ a.cc:6:9: error: expected unqualified-id before 'else' 6 | } else { | ^~~~ a.cc:9:5: error: expected declaration before '}' token 9 | } | ^ a.cc:10:3: error: expected declaration...
s997868329
p00099
C++
// AOJ 0099 Surf Smelt Fishing Contest II #include <iostream> using namespace std; const int MAX_N = 1 << 20; int dat[2 * MAX_N - 1]; // 各節点に最大値を持つセグメント木 int n, n_dat, q; void dat_init(); void dat_set(int i, int x); void dat_add(int i, int x); bool dat_is_leaf(int i); pair<int, int> dat_max(); int main() { cin...
a.cc: In function 'void dat_init()': a.cc:57:50: error: 'INT_MIN' was not declared in this scope 57 | for (i = 0; i < 2 * n_dat - 1; i++) dat[i] = INT_MIN; | ^~~~~~~ a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by addi...
s939345407
p00099
C++
#include<iostream> using namespace std; void f(int z){ for(int i=0;i<z;i++){ if(a[(z+i)*2][1]>=a[(z+i)*2+1][1]){ a[z+i][0]=a[(z+i)*2][0]; a[z+i][1]=a[(z+i)*2][1]; }else{ a[z+i][0]=a[(z+i)*2+1][0]; a[z+i][1]=a[(z+i)*2+1][1]; } } if(z!=1)f(z/2); } int main(){ int m,x,y,n; int a[3000000][2]={}; int q=...
a.cc: In function 'void f(int)': a.cc:7:12: error: 'a' was not declared in this scope 7 | if(a[(z+i)*2][1]>=a[(z+i)*2+1][1]){ | ^
s815470122
p00099
C++
//J3で1番プログラミングと数学ができない奴のテストプログラム //aoj0099 #include<iostream> #include<vector> #include<algorithm> #define rep(i,n) for(i = 0;i < n;i++) #define F first #define S second typedef pair<int,int> P; using namespace std; class segtree{ P *a; //MAX_NUM,MAX_CNT int dep; //Length from root to leaf public: segtree(int dept...
a.cc:9:9: error: 'pair' does not name a type 9 | typedef pair<int,int> P; | ^~~~ a.cc:13:9: error: 'P' does not name a type 13 | P *a; //MAX_NUM,MAX_CNT | ^ a.cc:38:9: error: 'P' does not name a type 38 | P getmax(int i,int j) | ^ a.cc:57:2: ...
s527345766
p00099
C++
//J3で1番プログラミングと数学ができない奴のテストプログラム //aoj0099 #include<iostream> #include<vector> #include<algorithm> #define rep(i,n) for(i = 0;i < n;i++) #define F first #define S second using namespace std; typedef pair<int,int> P; class segtree{ P *a; //MAX_NUM,MAX_CNT int dep; //Length from root to leaf public: segtree(int dept...
a.cc:57:2: error: expected ';' after class definition 57 | } | ^ | ;
s827587488
p00099
C++
#include <iostream> #include <iomanip> #include <cassert> #include <algorithm> #include <functional> #include <vector> #include <string> #include <cstring> #include <stack> #include <queue> #include <map> #include <bitset> #include <sstream> #include <istream> #include <cmath> #include <cstdio> #include <complex> usin...
a.cc: In function 'void init(int)': a.cc:64:1: error: expected ';' before 'void' 64 | void init(int n) { | ^~~~ a.cc:31:49: note: in definition of macro 'for_' 31 | #define for_(i, a, b) for (int i=(int)a; i<(int)b; i++) | ^ a.cc:64:1: error: expected pr...
s641615357
p00099
C++
#include<algorithm> #include<cstring> #include<cmath> using namespace std; int main(){ int n,q; for(;cin>>n>>q;) { pair<int,int> tree[n*2-1]; for(int i=0;i<n*2-1;i++) tree[i]=make_pair(0,0); for(int i=0;i<q;i++) { int a,v; cin>>a>>v; a--; int num=a+(n-1); // cout<<num<<endl;...
a.cc: In function 'int main()': a.cc:9:8: error: 'cin' was not declared in this scope 9 | for(;cin>>n>>q;) | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<cmath> +++ |+#include <iostream> 4 | using nam...
s948324807
p00100
Java
# Edit: 2014/09/25 # Lang: Python3 # Time: 0.xxs # if __name__ == "__main__": while True: d = {} n = int(input()) if not n: break # exit at n=0 for i in range(n): s, p, m = map(int, input().strip("\n").split(" ")) # s:社員番号, p:価格, m:販売戸数 ...
Main.java:1: error: illegal character: '#' # Edit: 2014/09/25 ^ Main.java:1: error: class, interface, enum, or record expected # Edit: 2014/09/25 ^ Main.java:2: error: illegal character: '#' # Lang: Python3 ^ Main.java:3: error: illegal character: '#' # Time: 0.xxs ^ Main.java:4: error: illegal character: '#' # ^...
s823790967
p00100
Java
import java.util.*; public class Saleresult{ public static void main(String[] args){ ArrayList<String> view=new ArrayList<String>(); while(true){ Scanner sc =new Scanner(System.in); int datanum=sc.nextInt(); int[][] data=new int[datanum][4]; int encounter=0; ...
Main.java:2: error: class Saleresult is public, should be declared in a file named Saleresult.java public class Saleresult{ ^ 1 error
s477119815
p00100
Java
import java.util.*; public class Saleresult{ public static void main(String[] args){ ArrayList<String> view=new ArrayList<String>(); while(true){ Scanner sc =new Scanner(System.in); int datanum=sc.nextInt(); int[][] data=new int[datanum][4]; int encounter=0; ...
Main.java:2: error: class Saleresult is public, should be declared in a file named Saleresult.java public class Saleresult{ ^ 1 error
s237003636
p00100
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class Sale_Result { public static void main(String[] args) throws NumberFormatException, IOException { Buffe...
Main.java:10: error: class Sale_Result is public, should be declared in a file named Sale_Result.java public class Sale_Result { ^ 1 error
s248728405
p00100
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; public class Sale_Result { public static void main(String[] args) throws NumberFormatException, IOException { Bu...
Main.java:9: error: class Sale_Result is public, should be declared in a file named Sale_Result.java public class Sale_Result { ^ 1 error
s154615398
p00100
Java
{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<Integer> list = new ArrayList<Integer>(); while(true) { int n = sc.nextInt(); int count = 0; //一つも社員番号が出力されなかった場合に(T)が実行されます. if ( n == 0 ) bre...
Main.java:1: error: class, interface, enum, or record expected { ^ Main.java:2: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) ^ (use --enable-preview to enable unnamed classes) Main.java:38: error: class, interface, enum, or reco...