submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s919763242 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,wm; cin >> n >> wm;
vector<vector<int>> a(4);
int w; cin >> w;
int v; cin >> v;
a[0].push_back(v);
for(int i=1;i<n;i++){
int ww; cin >> ww >> v;
a[ww-w].push_back(v);
}
for(int i=0;i<4;i++) sort(a[i].begin(),a[i].end(), greater<int>... | a.cc: In function 'int main()':
a.cc:19:36: error: 'm' was not declared in this scope
19 | for(int l=1;l<=a[3].size();m++){
| ^
|
s167937005 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,wm; cin >> n >> wm;
vector<vector<int>> a(4);
int w; cin >> w;
int v; cin >> v;
a[0].push_back(v);
for(int i=1;i<n;i++){
int ww; cin >> ww >> v;
a[ww-w].push_back(v);
}
for(int i=0;i<4;i++) sort(a[i].begin(),a[i].end(), greater<int>... | a.cc: In function 'int main()':
a.cc:16:16: error: no match for 'operator<=' (operand types are 'int' and 'std::vector<int>::iterator')
16 | for(int i=1;i<=a[0].begin();i++)
| ~^~~~~~~~~~~~~~
| | |
| int std::vector<int>::iterator
In f... |
s975520948 | p03734 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <array>
#include <tuple>
#... | a.cc: In function 'int main()':
a.cc:48:9: error: 'i' was not declared in this scope
48 | for(i, 4) {
| ^
a.cc:26:23: error: expected primary-expression before 'for'
26 | #define repi(i, a, b) for(ll i = int(a); i < int(b); i++)
| ^~~
a.cc:25:20: note: in expansion of... |
s189284085 | p03734 | C++ | //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <... | a.cc: In function 'int main()':
a.cc:79:31: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'} and 'VI' {aka 'std::vector<int>'})
79 | dp[i] = VI(W+1);
... |
s671443415 | p03734 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<ctime>
#include<vector>
#include<set>
#include<map>
#include<stack>
using namespace std;
#define sp cout<<"----------------------------------------------... | a.cc: In function 'int main()':
a.cc:26:29: error: 'mak' was not declared in this scope
26 | dp[i][j][k]=mak(dp[i][j][k],dp[i-1][j][k]);
| ^~~
|
s569103385 | p03734 | C++ | #include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n) int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout <<... | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Com... |
s757198035 | p03734 | C++ | #include <iostream>
#include <vector>
using namespace std;
int dp(int, int);
int n, w;
int* ws2;
int* vs2;
int* d;
int** vis;
int main() {
cin >> n >> w;
ws2 = new int[n];
vs2 = new int[n];
d = new int[w+1];
for (int i = 0; i < n; i++) {
cin >> ws2[i] >> vs2[i];
}
for (int i = 0; i < w+1; i++) {
... | a.cc: In function 'int dp(int, int)':
a.cc:43:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
43 | vis[curw-ws[i]][i]] = 1;
| ^
a.cc:48:2: error: expected '}' at end of input
48 | }
| ^
a.cc:35:29: note: to match this '{'
35 | int dp... |
s702082228 | p03734 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <stack>
#include <queue>
using namespace std;
int n,W,v[101],w[101],dp[101][100000001];
int solve(int i,int sum){
if(sum<0)return 0;
if(i==n)return 0;
if(dp[i][W-sum]!=0)return dp[i][W-sum];
else{
... | a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:11:1: error: extended character is not valid in an identifier
11 |
| ^
a.cc:24:1: error: extended character is not valid in an identifier
24 |
| ^
a.cc:9:1: error: '\U000000a0' does not name a type
... |
s428594717 | p03734 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
#define int long long
int DP[101][101][1000];
signed main() {
int N, W; cin >> N >> W;
vector<int>w(N), v(N);
for (int i = 0; i < N; i++) {
cin >> w[i] >> v[i];
}
int w0 = w[0];
for (int i = 0; i < N; i++) w[i] -=... | a.cc: In function 'int main()':
a.cc:35:41: error: no matching function for call to 'min(int, long long int)'
35 | for (int j = 0; j <= min(500,W - w0*i); j++) {
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /... |
s860474126 | p03734 | C++ | #include <iostream>
using namespace std;
// A utility function that returns maximum of two integers
int max(int a, int b)
{
return (a > b) ? a : b;
}
// Returns the maximum value that can be put in a knapsack of capacity W
int knapSack(int W, int wt[], int val[], int n)
{
int i, w;
int K... | a.cc: In function 'int knapSack(int, int*, int*, int)':
a.cc:41:10: error: expected '}' at end of input
41 | {
| ~^
a.cc:41:10: error: expected '}' at end of input
a.cc:37:5: note: to match this '{'
37 | {
| ^
a.cc:41:10: error: expected '}' at end of input
41 | {
... |
s163562719 | p03734 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loo... | a.cc:70:1: error: unterminated argument list invoking macro "rep"
70 |
| ^
a.cc: In function 'int main()':
a.cc:61:17: error: 'rep' was not declared in this scope
61 | rep(j,min(w+1,500LL)ma=max(ma,dp[i][j]);
| ^~~
a.cc:61:20: error: expected '}' at end of input
61 ... |
s192719465 | p03734 | C++ |
1.#include<iostream>
2.#include<algorithm>
3.#include<vector>
4.using LL = long long;
5.LL N,w;
6.LL W, V;
7.LL size[4],ww[4];
8.LL ans;
9.std::vector<LL> dp[4];
10.void value(LL x, LL y, LL z, LL q) {
11. LL sum = 0;
12. for (LL aa = 0; aa < x; aa++) {
13. sum += dp[0][aa];
14. }
15. for (LL aa = 0; aa < y; aa++) {
... | a.cc:2:3: error: stray '#' in program
2 | 1.#include<iostream>
| ^
a.cc:3:3: error: stray '#' in program
3 | 2.#include<algorithm>
| ^
a.cc:4:3: error: stray '#' in program
4 | 3.#include<vector>
| ^
a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 1.#include<... |
s616764351 | p03734 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using LL = long long;
LL N,w;
LL W, V;
LL size[4];
LL ans;
std::vector<LL> dp1,dp2,dp3,dp4;
void value(LL x, LL y, LL z, LL q) {
LL sum = 0;
for (LL aa = 0; aa < x; aa++) {
sum += dp1[aa];
}
for (LL aa = 0; aa < y; aa++) {
sum += dp2[aa];
}
for (LL aa = ... | a.cc: In function 'void solve()':
a.cc:27:33: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
27 | for (LL i = 0; i ... |
s787050999 | p03734 | C | #include<cstdio>
#include<deque>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int SIZEN=1010,inf =0x7fffffff/2;
int N,W;
int w[SIZEN],v[SIZEN];
int pos[4][SIZEN]={0},he[4][SIZEN];
int cnt[4];
int a[4][SIZEN];
bool cmp(int a,int b)
{
return a>b;
}
void work()
{
int lim[4];
for(i... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s275064047 | p03734 | C++ | #include<bits/stdc++.h>
using namespace std;
long long baseW;
long long N, W;
vector<long long> val[4];
int main(){
cin >> N >> W;
for(long long i = 0; i < N; i++){
long long tmpw, tmpv;
cin >> tmpw >> tmpv;
if(i == 0){
baseW = tmpw;
}
val[tmpw - baseW].push_back(tmpv);
}
for(int i = 0; i < 4; i++)... | a.cc: In function 'int main()':
a.cc:36:102: error: no matching function for call to 'min(long long int&, std::vector<long long int>::size_type)'
36 | ans = max(ans, val[0][i] + val[1][j] + val[2][k] + val[3][min(l, val[3].size() - 1)]);
| ... |
s531315607 | p03734 | C++ | #include <iostream>
#include <vector>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
#define DEBUG(i) cout << #i << ": " << i << endl;
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
int N, W;
pll P[100];
vector<ll> q[4];
int main(void) {
cin ... | a.cc: In function 'int main()':
a.cc:19:10: error: 'min_element' was not declared in this scope
19 | ll m = min_element(P, P + N)->fi;
| ^~~~~~~~~~~
a.cc:20:3: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(P, P + N);
| ^~~~
| short
a.cc:21:3: erro... |
s222678999 | p03734 | C++ | #include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<cst... | /tmp/ccDtYmrF.o: in function `main':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccDtYmrF.o
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `W' defined in .bss section in /tmp/ccDtYmrF.o
a.cc:(.text+0x39): relocation trunca... |
s734941612 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k;
ll w[110], v[110], wb;
ll knap[110][110][310];
ll INF = 1LL<<40;
int main() {
int i, j, l;
scanf("%lld%lld",&n,&k);
for (i=1;i<=n;i++) scanf("%lld%lld",&w[i],&v[i]);
wb = w[1];
for (i=1;i<=n;i++) w[i] -= wb;
for (i... | a.cc: In function 'int main()':
a.cc:19:56: error: expected primary-expression before ']' token
19 | for (i=0;i<=n;i++) for (l=0;l<=3*n;l++) knap[i][0][] = -INF;
| ^
|
s228079575 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se... | a.cc: In function 'int main()':
a.cc:39:12: error: no matching function for call to 'min(std::vector<long int>::size_type, int&)'
39 | p = min(vals[3].size()-1, p);
| ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu... |
s655904483 | p03734 | C++ | #include <iostream>
#include <vector>
using namespace std;
struct solver {
vector<long> ws;
vector<long> vs;
solver(vector<long> ws_, vector<long> vs_) : ws(ws_), vs(vs_) {}
long solve(int n, long wlimit) {
if (n == 0) {
return 0;
}
if (*min_element(ws.begin(), ws.end()) > wlimit) {
... | a.cc: In member function 'long int solver::solve(int, long int)':
a.cc:16:10: error: 'min_element' was not declared in this scope
16 | if (*min_element(ws.begin(), ws.end()) > wlimit) {
| ^~~~~~~~~~~
|
s249654262 | p03734 | C | #include <stdio.h>
#define MAXN 110
#define MAXW 500
int solve(int* w, int* v, int N, int W) {
static int m[MAXN][MAXW];
int mi = w[0];
for(int i = 0; i < N; i++) W -= mi, w[i] -= mi;
for(int i = 1; i < N; i++)
for(int j = 0; j < W; j++)
if(w[i] > j) m[i][j] = m[i - 1][j];
... | main.c: In function 'solve':
main.c:11:28: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
11 | else m[i][j] = max(m[i - 1][j], m[i - 1][j - w[i]] + v[i]);
| ^~~
|
s690715805 | p03734 | C | #include <stdio.h>
#define MAXN 110
#define MAXW 500
int solve(int* w, int* v, int N, int W) {
static int m[MAXN][MAXW];
int mi = w[0];
for(int i = 0; i < n; i++) W -= mi, w[i] -= mi;
for(int i = 1; i < n; i++)
for(int j = 0; j < W; j++)
if(w[i] > j) m[i][j] = m[i - 1][j];
... | main.c: In function 'solve':
main.c:7:24: error: 'n' undeclared (first use in this function)
7 | for(int i = 0; i < n; i++) W -= mi, w[i] -= mi;
| ^
main.c:7:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:28: error: implicit decl... |
s321105878 | p03734 | C++ | #include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <iostream>
#include <iomanip>
using namespace std;
typedef long long ll;
int n;
ll W;
vector<ll> v[4];
int w0;
int input(){
int x;cin>>x;return x;
}
ll s[4][101];
int main(){
cin >> n >> W;
w0=input();
v[0].push_back(input());
f... | a.cc: In function 'int main()':
a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'short'?
30 | sort(v[i].begin(), v[i].end());
| ^~~~
| short
a.cc:31:5: error: 'reverse' was not declared in this scope
31 | reverse(v[i].begin(), v[i].end());
| ^~~~~~~
|
s720529247 | p03734 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
int N;
int W;
cin >> N >> W;
int w_i[N],v_i[N];
int dp[N+1][401];
int tmp_i;
cin >> w_i[0] >> v_i[0];
for(int i=1;i<N;i++){
cin >> tmp_i >> v_i[i];
w_i[i] = tmp_i - w_i[0] + 1;
}
... | a.cc: In function 'int main()':
a.cc:22:15: error: expected ';' before 'for'
22 | w_i[0] = 1
| ^
| ;
23 | for(int i=0;i<=400;i++){
| ~~~
a.cc:23:17: error: 'i' was not declared in this scope
23 | for(int i=0;i<=400;i++){
| ... |
s545018986 | p03734 | Java |
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.zip.ZipFile;
// class name example: practice_1__2017_04_16
/*
-------------------------
Summary:
Total : 4
Correct... | Main.java:163: error: cannot find symbol
new Practice1__2017_05_05().run();
^
symbol: class Practice1__2017_05_05
location: class Main
1 error
|
s221188546 | p03734 | Java |
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.zip.ZipFile;
// class name example: practice_1__2017_04_16
/*
-------------------------
Summary:
Total : 4
Correct... | Main.java:19: error: class AtCoderPracticeTemplate is public, should be declared in a file named AtCoderPracticeTemplate.java
public class AtCoderPracticeTemplate {
^
1 error
|
s524943855 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
map <int, int> us, ans;
int n, m, i, j, a[200], b[200], res = 0;
int main()
{
vector <int> v;
vector <pair <int, int> > q;
cin >> n >> m;
for(i = 0; i < n; ++i)
cin >> a[i] >> b[i];
v.push_back(0);
for(i = 0; i < n; ++i)
{
for(j ... | a.cc: In function 'int main()':
a.cc:17:24: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
17 | q.push_back(v[j]);
| ~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/vect... |
s717820538 | p03734 | C++ | #include<iostream>
#include<vector>
using namespace std;
vector<int> weight(105);
vector<int> value(105);
vector<vector<int>> select(105+1, vector<int>(1000+1,0));
int zeroOnePack(int N, int C, const vector<int>& weight, const vector<int>& value)
{
for(int i = 1; i <= N; ++i)
{
for(int j = 1; j <= C; ... | a.cc:7:27: error: 'std::vector<std::vector<int> > select' redeclared as different kind of entity
7 | vector<vector<int>> select(105+1, vector<int>(1000+1,0));
| ^
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:514,
... |
s554748893 | p03734 | C++ | #include<iostream>
#include<vector>
using namespace std;
vector<int> weight(105);
vector<int> value(105);
vector<vector<int>> select(105+1, vector<int>(1000000000+1,0));
int zeroOnePack(int N, int C, const vector<int>& weight, const vector<int>& value)
{
vector<vector<int>> select(N+1, vector<int>(C+1,0));
fo... | a.cc:7:27: error: 'std::vector<std::vector<int> > select' redeclared as different kind of entity
7 | vector<vector<int>> select(105+1, vector<int>(1000000000+1,0));
| ^
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:51... |
s241995819 | p03734 | C++ | D={};(x=eval$';D.dup.map{|a,b|a-=eval$`;a<0||D[a]=[*D[a],b+x].max};D[W||=x]=0)while/ /=~gets;p D.values.max | a.cc:1:14: warning: missing terminating ' character
1 | D={};(x=eval$';D.dup.map{|a,b|a-=eval$`;a<0||D[a]=[*D[a],b+x].max};D[W||=x]=0)while/ /=~gets;p D.values.max
| ^
a.cc:1:14: error: missing terminating ' character
1 | D={};(x=eval$';D.dup.map{|a,b|a-=eval$`;a<0||D[a]=[*D[a],b+x].max};D[W|... |
s828229170 | p03734 | C++ | #include<cstdio>
#include<cstring>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
struct x_t
{
int w, v;
};
struct f_t
{
unsigned f[4];
// f_t(){f[0]=f[1]=f[2]=f[3]=0;}
operator < (const f_t& rhs) const {
return memcmp(f, rhs.f, 16)<0;
}
};
int N, W;
vector<x_t> x;
map<f_t,x_t>... | a.cc:22:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
22 | operator < (const f_t& rhs) const {
| ^~~~~~~~
|
s685679290 | p03734 | C++ | #include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
long long dp[105][405][105];
long long www[405];
long long vvv[405];
long long main(){
long long n,w;
cin>>n>>w;
memset(dp,0,sizeof(dp));
for(long long i=0;i<n;i++){
cin>>www[i]>>vvv[i];
}
long long tmp=www[0]-1... | cc1plus: error: '::main' must return 'int'
|
s488482988 | p03734 | C++ | #include "bits/stdc++.h"
using namespace std;
int n, W;
int w[105];
int v[105];
ll dp[105][105][305];
ll solve(int idx, int left, int wt)
{
if(left == 0)
return 0;
if(idx > n)
{
if(left != 0)
return INT_MIN;
else
return 0;
}
if(dp[idx][left][wt] != -... | a.cc:8:1: error: 'll' does not name a type
8 | ll dp[105][105][305];
| ^~
a.cc:10:1: error: 'll' does not name a type
10 | ll solve(int idx, int left, int wt)
| ^~
a.cc: In function 'int main()':
a.cc:37:5: error: 'll' was not declared in this scope
37 | ll ans = 0;
| ^~
a.cc:43:16: ... |
s322044812 | p03734 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#define ALL(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i... | a.cc: In function 'int main()':
a.cc:61:100: error: expected ';' before '}' token
61 | if(k >= d) dp[i+1][j][k] = max(dp[i][j][k],dp[i][j-1][k-d])
| ^
| ... |
s583427324 | p03734 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define repeat(i,n) for(int i=0;i<(n);i++)
typedef pair<int, int> pii;
struct Data{
int w, v, id;
bool operator<(const Data &r)const{
return v!=r.v ? v>r.v : w<r.w;
}
};
int N, W;
vector<int> w, v;
int used[101];
int calc(in... | a.cc: In function 'int calc(int, int)':
a.cc:25:34: error: 'rec' was not declared in this scope; did you mean 'ret'?
25 | if(rest-w[i]>=0) ret=max(ret, rec(i+1, rest-w[i])+v[i]);
| ^~~
| ret
|
s054928324 | p03734 | C | #include <stdio.h>
#include <math.h>
const int MAX_N = 1000; // nの最大値
const int MAX_W = 1000000000; // Wの最大値
void solve_dp2();
// 入力
int n, W;
int w[MAX_N], v[MAX_N];
// DPテーブル
// dp[i][j]はi番目以降の品物から重さの和がj以下なるように選んだときの価値の和の最大値を表す。
int dp[MAX_N + 1][MAX_W + 1];
int main(){
int i,a,b;
scanf("%d%d",&n,&W);
for... | main.c:10:5: error: variably modified 'w' at file scope
10 | int w[MAX_N], v[MAX_N];
| ^
main.c:10:15: error: variably modified 'v' at file scope
10 | int w[MAX_N], v[MAX_N];
| ^
main.c:14:5: error: variably modified 'dp' at file scope
14 | int dp[MAX_N + 1][MAX_W + 1];
| ... |
s773807262 | p03734 | C | #include <stdio.h>
#include <math.h>
const int MAX_N = 100; // nの最大値
const int MAX_W = 1000000000; // Wの最大値
void solve_dp2();
// 入力
int n, W;
int w[MAX_N], v[MAX_N];
// DPテーブル
// dp[i][j]はi番目以降の品物から重さの和がj以下なるように選んだときの価値の和の最大値を表す。
int dp[MAX_N + 1][MAX_W + 1];
int main(){
int i,a,b;
scanf("%d%d",&n,&W);
for ... | main.c:10:5: error: variably modified 'w' at file scope
10 | int w[MAX_N], v[MAX_N];
| ^
main.c:10:15: error: variably modified 'v' at file scope
10 | int w[MAX_N], v[MAX_N];
| ^
main.c:14:5: error: variably modified 'dp' at file scope
14 | int dp[MAX_N + 1][MAX_W + 1];
| ... |
s468285354 | p03734 | Java | import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.concurrent.atomic.AtomicLong;
public class Main {
static long first = -1;
static int w = -1;
// 14:33-
public static void main(String[] args) {
Scanner sc = new Scanner(new B... | Main.java:26: error: incompatible types: possible lossy conversion from long to int
ws[wi - first].add(vi);
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s062192787 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
int ans;
int n,W;
vector<int> w(100,0),v(100,0);
void dfs(int wsum,int vsum,int i){
if(i == n){
if(ans < vsum)
ans = vsum;
}
else{
dfs(wsum,vsum,i+1);
if(wsum+w[i] <= W){
dfs(wsum+w[i],vsum+v[i],i+1);
}... | /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
|
s072314790 | p03734 | C++ | #include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <algorithm>
#define int long long
using namespace std;
const int maxn = 1000 + 5;
int T;
int N, V;
map<int,int> value;
map<int,int> volume;
map<int,int> dp;
void input()
{
std::ios::sync_with_stdio(false);
scanf("%lld%lld", &... | cc1plus: error: '::main' must return 'int'
|
s264631696 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
int max;
int n,W;
vector<int> w(100,0),v(100,0);
void dfs(int wsum,int vsum,int i){
if(i == n){
if(max < vsum)
max = vsum;
}
else{
dfs(wsum,vsum,i+1);
if(wsum+w[i] <= W){
dfs(wsum+w[i],vsum+v[i],i+1);
}... | a.cc: In function 'void dfs(int, int, int)':
a.cc:12:12: error: reference to 'max' is ambiguous
12 | if(max < vsum)
| ^~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/in... |
s928494842 | p03734 | C++ | #include<iostream>
#include<algorithm>
#define MOD 1000000007
#define INF 1123456789012345
#define in cin
#define out cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
using namespace std;
LL N, W, v[112], w[112];
pair<LL, LL> ps[1 << 20];
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s428721766 | p03734 | C++ | #include<iostream>
#include<algorithm>
#define MOD 1000000007
#define INF 1123456789012345
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, v[112], w[112];
std::pair<LL, LL> ps[1 << 20];
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
LL... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s335410203 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[(1 << 20)];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
N2 = N... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s348318395 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 1123456789012345
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, v[112], w[112];
std::pair<LL, LL> ps[1 << 20];
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
LL N2 = N / 2;
... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s955311913 | p03734 | C++ | #include <cstdio>
int Num=0;
long int WCap=0;
long int Weight[100]={};
long int Value[100]={};
inline int Max(int L,int R){
return L>=R?L:R;
}
int Search(int Depth,int RemCap);
int main(){
scanf(" %d %ld",&Num,&WCap);
for(int i=0;i<Num;i++){
scanf(" %ld %ld",&Weight[i],&Value[i]);
}
printf("%d\n",Search(... | a.cc:31:2: error: 'v' does not name a type
31 | }v
| ^
|
s196817465 | p03734 | C++ | #include <iostream>
#include <algorithm>
#define MOD 1000000007
#define INF 112345678900000
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL> ps[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s219794928 | p03734 | C++ | #include <iostream>
#include <algorithm>
#define MOD 1000000007
#define INF 112345678900000
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL> res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s597352487 | p03734 | C++ | #include "bits/stdc++.h"
using namespace std;
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
typede... | a.cc: In function 'int main()':
a.cc:42:18: error: no matching function for call to 'min(int, ll)'
42 | REP(i,min(310,Wt+1)) ans = max(ans,dp[N][k][i]);
| ~~~^~~~~~~~~~
a.cc:4:42: note: in definition of macro 'REP'
4 | #define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
| ... |
s171389213 | p03734 | C++ | #include <iostream>
#include <algorithm>
#define MOD 1000000007
#define INF 112345678900000
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL> res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s239448088 | p03734 | C++ | #include "bits/stdc++.h"
using namespace std;
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
typede... | a.cc: In function 'int main()':
a.cc:42:18: error: no matching function for call to 'min(int, ll)'
42 | REP(i,min(310,Wt+1)) ans = max(ans,dp[N][k][i]);
| ~~~^~~~~~~~~~
a.cc:4:42: note: in definition of macro 'REP'
4 | #define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
| ... |
s574179812 | p03734 | C++ |
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define FORCLS(i,a,b) for(int i = (a); i <= (b); i++)
#define REPCLS(i,n) FORCLS(i,1,n)
using Int = long;
Int N, W;
const Int N_MAX = 101;
const Int W_MAX = 1... | /tmp/ccZQKjap.o: in function `solve()':
a.cc:(.text+0x52): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccZQKjap.o
a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccZQKjap.o
a.cc:(.text+0x13b): relocation t... |
s915658706 | p03734 | C++ | #include <iostream>
#include <algorithm>
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL> res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s152495374 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define VV(T) vector<vector< T > >
template <cl... | a.cc: In function 'void dfs(int, int, int)':
a.cc:38:12: error: reference to 'max' is ambiguous
38 | if(max < vsum)
| ^~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/in... |
s139533213 | p03734 | C++ | #include <iostream>
#include <algorithm>
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s263522463 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
N2 = N ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s451150428 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
N2 = N ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s115630549 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
N2 = N ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s068882890 | p03734 | C++ | #include <iostream>
#include <algorithm>
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s646110388 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[1 << 20];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
N2 = N ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s130071382 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[(1 << 20)];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
N2 = ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s425788256 | p03734 | C++ | #include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL N, W, w[112], v[112];
std::pair<LL, LL>res[(1 << 20)];
LL N2, ans;
int main()
{
in >> N >> W;
rep(i, N) { in >> w[i] >> v[i]; }
N2 = ... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s257165755 | p03734 | C++ | #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;
int main(){
int N,
long long W,v,w;
scanf("%d %lld",&N,&W);
vector<long long> dp(W+1);
fill(dp.begin(), dp.end(), 0);
for(int i=0;i<N;i++){
scanf("%lld %lld",... | a.cc: In function 'int main()':
a.cc:11:5: error: expected unqualified-id before 'long'
11 | long long W,v,w;
| ^~~~
a.cc:12:25: error: 'W' was not declared in this scope
12 | scanf("%d %lld",&N,&W);
| ^
a.cc:16:28: error: 'w' was not declared in this scope
16 | ... |
s612925911 | p03734 | C++ | // g++ temp.cpp
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published b... | a.cc: In function 'void solve()':
a.cc:157:5: error: 'sum' was not declared in this scope
157 | sum+=a;
| ^~~
|
s240749134 | p03734 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <set>
#include <list>
#include <map>
#include <queue>
#include <iterator>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
... | a.cc:77:23: error: macro "ALL" passed 2 arguments, but takes just 1
77 | sort(ALL(w2, f));
| ^
a.cc:47:9: note: macro "ALL" defined here
47 | #define ALL(a) a.begin(), a.end()
| ^~~
a.cc: In function 'int main()':
a.cc:77:14: error: 'ALL' was not declared in this ... |
s444393575 | p03734 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> v[4];
int sum[4][110];
int main()
{
//freopen("file.in", "r", stdin);
//freopen("file.out", "w", stdout);
int n,w,a,b,x,sol=0;
scanf("%d%d",&n,&w);
scanf("%d%d",&a,&b);
v[0].push_back(b);
for(int i=2... | a.cc: In function 'int main()':
a.cc:36:26: error: no matching function for call to 'min(long long unsigned int, long long int)'
36 | int k=min(1LL*v[3].size(),(w-s)/(a+3));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
... |
s196806221 | p03734 | C++ | // a code about cooties
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <cassert>
using namespace std;
#define rep(i,a,n) for (int i=a;i<(int)(n);i++)
#define per(i,a,n) for (int i=(... | a.cc: In function 'int main()':
a.cc:41:16: error: no match for 'operator-=' (operand types are 'll' {aka 'long long int'} and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'std::pair<long long int, long long int>'})
4... |
s312012384 | p03735 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll int64_t
typedef pair<int,int> P;
const int N=2e5+5;
const int INF=numeric_limits<int>::max();
int n,x[N],y[N],mn[N],mx[N];
set<P> Smin,Smax;
P Rx,Rn,Bx,Bn;
void del(int id){
Smin.erase({mn[id],id});
Smax.erase({mx[id],id});
}
void add(int id){
Smin.emplace... | a.cc: In function 'int main()':
a.cc:53:16: error: no matching function for call to 'min(int64_t&, long long int)'
53 | res=min(res,1LL*(Rx.first-Rn.first)*(Bx.first-Bn.first));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s752935291 | p03735 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int N;
cin >> N;
vector<pair<ll, ll>> P(N);
ll mi = 1e10, ma = 0, mi_index, ma_index;
for (int i = 0; i < N; i++) {
ll X, Y;
cin >> X >> Y;
if (X > Y) swap(X, Y);
P[i] = {X, Y};
}
... | a.cc:91:5: error: redefinition of 'int main()'
91 | int main() {
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main() {
| ^~~~
|
s338644910 | p03735 | C++ | // 最大最小で場合分けまで考察済み
// sortして順番で良い証明ができなかった | /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
|
s938213817 | p03735 | C++ | 瞬殺(最近のコンテストで類題が出た) | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | 瞬殺(最近のコンテストで類題が出た)
| ^
|
s871548403 | p03735 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>... | a.cc: In function 'int main()':
a.cc:54:25: error: 'min_f' was not declared in this scope; did you mean 'min_s'?
54 | min_f = min(min_f, a[i]);
| ^~~~~
| min_s
a.cc:60:49: error: 'min_f' was not declared in this scope; did you mean '... |
s711651332 | p03735 | C++ | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)... | a.cc: In function 'int main()':
a.cc:111:2: error: expected '}' at end of input
111 | }
| ^
a.cc:69:11: note: to match this '{'
69 | int main(){
| ^
|
s331670747 | p03735 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
// #define double long double
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for... | In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46,
from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc... |
s242178168 | p03735 | C++ | #include<bits/stdc++.h>
#define INF 1000000007
using namespace std;
struct sakura
{
long long x;
long long y;
}
ball[MAXN];const int MAXN = 222222;
long long x[MAXN];
long long y[MAXN];
long long maxn[MAXN];
long long minl[MAXN];
long long n,ans,ans1,ans2,bmax,bmin,rmax,rmin;
inline bool cmp(sakura xx,sakura y... | a.cc:10:6: error: 'MAXN' was not declared in this scope
10 | ball[MAXN];const int MAXN = 222222;
| ^~~~
a.cc: In function 'int main()':
a.cc:21:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
21 | for(register int i=1;i<=n;++i)
| ^
a.... |
s347553522 | p03735 | C++ | #include<bits/stdc++.h>
#define INF 1000000007
using namespace std;
struct sakura
{
long long x;
long long y;
}
const int MAXN = 222222;
ball[MAXN];
long long x[MAXN];
long long y[MAXN];
long long maxn[MAXN];
long long minl[MAXN];
long long n,ans,ans1,ans2,bmax,bmin,rmax,rmin;
inline bool cmp(sakura xx,sakura y... | a.cc:8:2: error: expected ';' after struct definition
8 | }
| ^
| ;
a.cc:10:1: error: 'ball' does not name a type
10 | ball[MAXN];
| ^~~~
a.cc: In function 'int main()':
a.cc:21:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
21 | for(register int ... |
s001565730 | p03735 | C++ | #include<bits/stdc++.h>
#define INF 1000000007
using namespace std;
struct sakura
{
long long x;
long long y;
}
const int MAXN = 200000 + 30000;
ball[MAXN];
long long x[MAXN];
long long y[MAXN];
long long maxn[MAXN];
long long minl[MAXN];
long long n,ans,ans1,ans2,bmax,bmin,rmax,rmin;
inline bool cmp(sakura xx,... | a.cc:8:2: error: expected ';' after struct definition
8 | }
| ^
| ;
a.cc:10:1: error: 'ball' does not name a type
10 | ball[MAXN];
| ^~~~
a.cc: In function 'int main()':
a.cc:21:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
21 | for(register int ... |
s234111144 | p03735 | C++ | #include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<... | a.cc: In function 'int main()':
a.cc:138:5: error: 'itr' was not declared in this scope
138 | itr=st1.lower_bound(na);
| ^~~
a.cc:139:5: error: 'itr2' was not declared in this scope
139 | itr2=st2.lower_bound(nb);
| ^~~~
|
s039776870 | p03735 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
namespace __output {
template<class T1, class T2> void pr(const pair<T1,T2>& x);
template<class T, size_t SZ> void pr(const array<T,SZ>& x);
template<class T> void pr(const vector<T>& x);
templ... | a.cc: In function 'int main()':
a.cc:85:22: error: 'INT_MAX' was not declared in this scope
85 | int global_min = INT_MAX;
| ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
5 | #include <set>
+++ |+#inclu... |
s828564848 | p03735 | C | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s881154033 | p03735 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
int main(){
ll n;cin>>n;
ll x[n],y[n];
ll ma=0;
ll mi=1000000000000;
vector<pll> v;
ll dai[n],syou[n];
for(ll i=0;i<n;i++){
cin>>x[i]>>y[i];
ma=max(ma,min(y[i],x[i]));
mi=min(mi,max(x[i],y[i]));
v.p... | a.cc: In function 'int main()':
a.cc:27:48: error: no match for 'operator>' (operand types are 'long long int' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'std::pair<long long int, long long int>'})
27 | if(v[0... |
s913371872 | p03735 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
typedef long long LL;
const int MAXN = 2e5;
const LL INF = 0x3f3f3f3f;
int n;
int mins[MAXN | 1], maxs[MAXN | 1];
LL ans;
struct Num {
int a, b;
Num() {}
friend bool operator < (const Num &x, const Num &y) {
return x.a < y.a;
}
} p[MAXN | 1];
inline ... | a.cc: In function 'int read()':
a.cc:23:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
23 | register int x = 0;
| ^
a.cc:24:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
24 | register char ch ... |
s648823514 | p03735 | C++ | #include<vector>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define pb push_back
#define gt getchar()
#define ll long long
#define File(s) freopen(s".in","r",stdin),freopen(s".out","w",stdout)
typedef std::pair<int,int> P;
#define mk std::make_pair
#define fr first
#define s... | a.cc: In function 'void work1()':
a.cc:30:21: error: no matching function for call to 'max(int&, long long int&)'
30 | mmx=std::max(mmx,y[mx]);
| ~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:25... |
s861698903 | p03735 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
# define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
# ... | a.cc: In function 'int main()':
a.cc:162:8: error: redeclaration of 'll base_l'
162 | ll base_l = l;
| ^~~~~~
a.cc:109:8: note: 'll base_l' previously declared here
109 | ll base_l = l;
| ^~~~~~
a.cc:163:8: error: redeclaration of 'll base_r'
163 | ll base_r = r;
| ... |
s767670308 | p03735 | C++ | #include<iostream>
#include<string>
#include<string.h>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<set>
using namespace std;
#define rep(i,a,b) for (i=a;i<=b;i++)
typedef long long ll;
#define maxd 1e9+7
int n;
multiset<LL> a,b;
struct node{
int x,y... | a.cc:16:10: error: 'LL' was not declared in this scope; did you mean 'll'?
16 | multiset<LL> a,b;
| ^~
| ll
a.cc:16:12: error: template argument 1 is invalid
16 | multiset<LL> a,b;
| ^
a.cc:16:12: error: template argument 2 is invalid
a.cc:16:12: error: template argu... |
s065357764 | p03735 | C++ | #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>... | a.cc: In function 'int main()':
a.cc:52:5: error: expected unqualified-id before 'return'
52 | return 0;
| ^~~~~~
|
s126005874 | p03735 | C++ | #include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>
#define typeof(x) __typeof__(x)
#define int long long int
#define mo... | a.cc: In function 'int main()':
a.cc:85:41: error: narrowing conversion of '1.0e+9' from 'double' to 'long long int' [-Wnarrowing]
85 | int minimax[2] = {1,1}, maxmini[2] = {1e9,1e9};
| ^~~
a.cc:85:45: error: narrowing conversion of '1.0e+9' from 'double' to 'long long... |
s280180363 | p03735 | C++ | #include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>
#define typeof(x) __typeof__(x)
#define int long long int
#define mo... | a.cc: In function 'int main()':
a.cc:85:41: error: narrowing conversion of '1.0e+9' from 'double' to 'long long int' [-Wnarrowing]
85 | int minimax[2] = {1,1}, maxmini[2] = {1e9,1e9};
| ^~~
a.cc:85:45: error: narrowing conversion of '1.0e+9' from 'double' to 'long long... |
s322197467 | p03735 | C++ | package main
import "fmt"
var N int = 200005
var x [N]int
var y [N]int
// 2018-08-12T14:13:15+0800 // 2018-08-12T14:36:33+0800
// 2018-08-12T14:44:00+0800 # Pause to calm down.
// 2018-08-12T15:16:18+0800 # @see https://arc073.contest.atcoder.jp/submissions/2997568
// 2018-08-12T15:23:55+0800 # @see https://arc073.co... | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
a.cc:66:1: error: 'func' does not name a type
66 | func diff(a, b int) int {
| ^~~~
a.cc:74:1: error: 'func' does not name a type
74 | func maxOfTwo(min, min2, max, max2 int) int {
| ^~~~
|
s991423533 | p03735 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
typedef long long int64;
const int64 N = 200005;
int64 x[N];
int64 y[N];
int64 maxOfTwo(int64 min1, int64 min2, int64 max1, int64 max2) {
int64 t = abs(max1 - min1);
int64 t2 = abs(max2 - min2);
int64 a = abs(max1 - min1) * abs(max2 - min2);
int64 ... | a.cc: In function 'int main()':
a.cc:79:45: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
79 | out = min(out, maxOfTwo(min1[0], min[1], max1[1], max1[0]));
| ^
|
s526152888 | p03735 | C++ | #include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
ll int MOD=998244353;
#defin... | a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
17 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:38:17: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} to 'long l... |
s342287785 | p03735 | C++ | #include <iostream>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <string>
#include <stack>
#include <limits>
#include <climits>
#include <cassert>
#include <fstream>
#include <cstring>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <algorithm>
#include <functional>
#include... | a.cc: In function 'void solve()':
a.cc:252:21: error: redeclaration of 'long long int rma'
252 | int rma = 0;
| ^~~
a.cc:244:21: note: 'long long int rma' previously declared here
244 | int rma = 0;
| ^~~
a.cc:253:21: error: redecla... |
s258382636 | p03735 | C++ | #include <bits/stdc++.h>
using namespace std;
long long int a[202000][2];
int main()
{
int n;
scanf("%d",&n);
if(n==1)
{
long long int qwer,qwert;
scanf("%lld%lld",&qwer,&qwert);
long long int qasw=qwer-qwert;
if(qasw<0)
{
qasw=qasw*(-1);
}
prin... | a.cc: In function 'int main()':
a.cc:106:22: error: expected primary-expression before '>' token
106 | if(a[i][0]=>p2&&a[i][1]=>p2)
| ^
a.cc:106:35: error: expected primary-expression before '>' token
106 | if(a[i][0]=>p2&&a[i][1]=>p2)
| ... |
s311066607 | p03735 | C++ | #include<bits/stdc++.h>
#define INF 0x7fffffff
#define P pair<int,int>
#define ll long long
#define f first
#define s second
using namespace std;
int n,nn,mx=-INF,mn=INF;
P a[200005];
ll ans;
inline int read(){
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'... | a.cc: In function 'int main()':
a.cc:25:40: error: 'nx' was not declared in this scope; did you mean 'nn'?
25 | ans=1ll*(mx-mn)*(a[n].f-a[1].f),nn=nx=a[1].s;
| ^~
| nn
|
s490727645 | p03735 | C++ | #include <algorithm>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
const ll INF = 1ll << 60;
struct Enclosure {
ll l, r;
ll len() const { return r - l; }
Enclosure add(ll v) co... | a.cc: In function 'int main()':
a.cc:58:5: error: 'function' was not declared in this scope
58 | function<ll(int, Enclosure, Enclosure)> dfs =
| ^~~~~~~~
a.cc:9:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>'
8 | #include <set... |
s970338971 | p03735 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
template<typename T>
void input(T &x) {
x=0; T a=1;
register char c=getchar();
for(;c<48||c>57;c=getchar())
if(c==45) a=-1;
for(;c>=48&&c<=57;c=getchar())
x=x*10+c-48;
x*=a;
return;
}
#define MAXN 200010
struc... | a.cc: In function 'void input(T&)':
a.cc:10:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10 | register char c=getchar();
| ^
a.cc: In function 'int main()':
a.cc:70:32: error: no matching function for call to 'min(ll&, int)'
70 | ... |
s425292262 | p03735 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
template<typename T>
void input(T &x) {
x=0; T a=1;
register char c=getchar();
for(;c<48||c>57;c=getchar())
if(c==45) a=-1;
for(;c>=48&&c<=57;c=getchar())
x=x*10+c-48;
x*=a;
return;
}
#define MAXN 200010
struc... | a.cc: In function 'void input(T&)':
a.cc:10:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10 | register char c=getchar();
| ^
a.cc: In function 'int main()':
a.cc:63:22: error: 'Bmin' was not declared in this scope; did you mean '_min'?
6... |
s316817498 | p03735 | C++ | wanan#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
long long n,minid,maxid,mina,maxa,minb,maxb,ans;
struct node
{
long long x,y;
}q[400005];
bool cmp(node t1,node t2)
{
return (t1.x<t2.x || (t1.x==t1.x && t1.y<t2.y));
}
int main()
{
scanf("%lld",&... | a.cc:1:6: error: stray '#' in program
1 | wanan#include <iostream>
| ^
a.cc:1:1: error: 'wanan' does not name a type
1 | wanan#include <iostream>
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
fr... |
s127151482 | p03735 | C++ | #include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<cst... | a.cc: In function 'int main()':
a.cc:35:32: error: no match for 'operator*' (operand types are 'std::reverse_iterator<std::_Rb_tree_const_iterator<int> >' and 'int')
35 | ans=(b.rbegin()-*b.begin())*(*r.rbegin()-*r.begin());
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
| ... |
s426258037 | p03735 | C++ | #include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <string>
#include <iostream>
#include <climits>
using namespace std;
using ll = long long;
#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
const ll INF ... | a.cc: In function 'int main()':
a.cc:30:17: error: no matching function for call to 'min(ll&, int&)'
30 | mi = min(mi,v[i].first);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: ca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.