submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s498054765 | p03731 | C++ | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
int main(){
int n, shower;
std::cin >> n >> shower;
int ans = 0;
std::vector<int> t(n);
std::cin >> t.at(0);
for(int i = 1; i < n; ++i){
std::cin >> t.at(i);
if(t.at(i) - t.at(i - 1) < shower){
... | a.cc: In function 'int main()':
a.cc:16:42: error: no match for 'operator<' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<int>')
16 | ans += t.at(i) - t.at(i - 1) < t;
| ~~~~~~~~~~~~~~~~~~~~~ ^ ~
| ... |
s031687877 | p03731 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)
const ll MOD = 1000000007;
const ll INF = (ll)1e15;
int main()
{
ll N, T;
cin >> N >> T... | a.cc: In function 'int main()':
a.cc:26:32: error: 'preb' was not declared in this scope; did you mean 'prev'?
26 | sum += std::min(T, t - preb);
| ^~~~
| prev
|
s089414602 | p03731 | C++ | #include<bits/stdc++.h>
using namespace std;
int a[114];
#define int long long
int main() {
int n,t;
cin >> n;
for (int i = 0; i < n; i++) { cin >> a[i]; }
int sum = 0;
for (int i = 0; i < n - 1; i++) { sum += min(a[i + 1] - a[i], t); }
cout << sum << endl;
} | cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:10:53: error: no matching function for call to 'min(int, long long int&)'
10 | for (int i = 0; i < n - 1; i++) { sum += min(a[i + 1] - a[i], t); }
| ~~~^~~~~~~~~~~~~~~~~~~~
I... |
s280241839 | p03731 | C++ | #include<stdio.h>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<string>
#include<set>
using namespace std;
int before ,end;
int n, t;
int now;
int ans;
int main(){
scanf("%d %d", &n, &t);
scanf("%d",&end);
for(int i = 2 ; i <= n ; i++){
before = end;
scanf("%d", &end);
if(end - before > t)a... | a.cc: In function 'int main()':
a.cc:14:21: error: reference to 'end' is ambiguous
14 | scanf("%d",&end);
| ^~~
In file included from /usr/include/c++/14/string:53,
from a.cc:5:
/usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'template<class _T... |
s990683465 | p03731 | C++ | #include<iostream>
using namespace std;
int main(){
int n,T,ans=0;cin>>n>>T;
int t[n];
for(int i=0;i<n;i++)cin>>t[i];
for(int i=0;i<n;i++){
if(t[i]-t[i-1]<T)ans+=t[i]-[i-1];
else ans+=T;
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:34: error: expected ',' before '-' token
9 | if(t[i]-t[i-1]<T)ans+=t[i]-[i-1];
| ^
| ,
a.cc:9:34: error: expected identifier before '-' token
a.cc: In lambda function:
a.cc:9:37: error: expected ... |
s987877945 | p03731 | C++ | #include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
using namespace std;
int main(){
int n,t;
cin >> n >> t;
long long total=0;
int now=0;
vector<long long> tl(n);
for(int i=0;i<n;i++){
cin >> tl[i];
}
for(int i=0;i<n-1;i++){
now = tl[... | a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
9 | cin >> n >> t;
| ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
5 | #include <deque>
+++ |+#include <iostream>
6 | using names... |
s424986033 | p03731 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,t[200000];
cin >> n >> t;
long long a=n*t;
for(int i=0;i!=n;i++){
cin >> t[i];
if(t[i]<t){
a-=t-t[i];
}
}
cout << a << endl;
}
| a.cc: In function 'int main()':
a.cc:8:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long long int [200000]')
8 | cin >> n >> t;
| ~~~~~~~~ ^~ ~
| | |
| | long long int [200000]
... |
s464766849 | p03731 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,T,t[200000],ans=0;
cin>>n>>t;
for(int i=0;i<n;i++){
cin>>t[i];
}
for(int i=0;i<n-1;i++){
if(t[i]+T<=t[i+1]){
ans+=T;
}else{
ans+=(t[i+1]-t[i]);
}
}
ans+=T;
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:6:9: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int [200000]')
6 | cin>>n>>t;
| ~~~~~~^~~
| | |
| | int [200000]
| std::basic_istream<char>:... |
s213303509 | p03731 | C++ | #include bits<stdc++.h>
using namespace std;
int main(){
int n,T,t[200000],ans=0;
cin>>n>>t;
for(int i=0;i<n;i++){
cin>>t[i];
}
for(int i=0;i<n-1;i++){
if(t[i]+T<=t[i+1]){
ans+=T;
}else{
ans+=(t[i+1]-t[i]);
}
}
ans+=T;
cout<<ans<<endl;
} | a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include bits<stdc++.h>
| ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin>>n>>t;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixabl... |
s542402091 | p03731 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
// Your code here!
int n,t;
cin>>n>>t;
int time[n];
for(int i=0;i<n;i++){
cin>>time[i];
}
long int sum=0;
for(int i=0;i<n-1;i++){
if(time[i]+t > time[i+1]){
sum+=time[i+1]-t[i];
}e... | a.cc: In function 'int main()':
a.cc:16:29: error: invalid types 'int[int]' for array subscript
16 | sum+=time[i+1]-t[i];
| ^
|
s943666938 | p03731 | Java | import java.util.Scanner;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = sc.nextInt();
int time = sc.nextInt();
int[] history = new int[count];
for (int i = 0; i < count; i++) {
history[i] = sc.nextInt();
}
l... | Main.java:3: 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)
1 error
|
s347351653 | p03731 | C++ | // C++bool練習用.cpp : アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int i, j, k, l, m, N,cnt, T;
long long int sum;
long long int t[200000];
cin >> N;
cin >> T;
for (i = 0; i < N; i++) {
cin >> t[i];
}
sum = T;
for (i = 0; i < N-1; i++) {
if (t[i] +... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s268240332 | p03731 | C++ | #include<iostream>
using namespace std;
int t[200000];
int main(){
int n=0;
__int64 ans=0;
int T=0;
int i=0;
cin>>n>>T;
for(i=0;i<n;i++){
cin>>t[i];
}
ans=T;
for(i=1;i<n;i++){
if(T>=t[i]){
ans=t[i]+T;
}else{
ans=ans+T;
}
}
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
6 | __int64 ans=0;
| ^~~~~~~
| __int64_t
a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | ans=T;
| ^~~
... |
s910317732 | p03731 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<stdio.h>
#include<queue>
#include<stack>
#include<map>
using namespace std;
typedef long long ll;
typedef double db;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int, int>P;
int main(){
ll n, t, sum, tmp;
vector<int> array;
sca... | a.cc: In function 'int main()':
a.cc:30:9: error: 'accumulate' was not declared in this scope
30 | sum = accumulate(array.begin(), array.end(), 0) + t;
| ^~~~~~~~~~
|
s050964224 | p03731 | C | #include <stdio.h>
#include <string.h>
void main(){
int n;
int t;
scanf("%d %d",&n ,&t);
int i;
int[] tn;
for(i =0; i <n; i++){
scanf("%d", &tn[i]);
}
int x;
for(i=0; i<n; i++){
x ... | main.c: In function 'main':
main.c:10:12: error: expected identifier or '(' before '[' token
10 | int[] tn;
| ^
main.c:12:22: error: 'tn' undeclared (first use in this function); did you mean 't'?
12 | scanf("%d", &tn[i]);
| ^~
| ... |
s466323939 | p03731 | C | #include <stdio.h>
#include <string.h>
int main(void){
int n;
int t;
scanf("%d %d",&n &t);
int i;
int tn[100000000];
for(i =0; i <n; i++){
scanf("%d", &tn[i]);
}
int x;
for(i=0; i<n; i++){... | main.c: In function 'main':
main.c:7:26: error: invalid operands to binary & (have 'int *' and 'int')
7 | scanf("%d %d",&n &t);
| ~~ ^
| |
| int *
|
s723109941 | p03731 | C++ | void main(){
int n;
int t;
scanf("%d %d",&n &t);
int i;
int tn[];
for(i =0; i <n; i++){
scanf("%d", &tn[i]);
}
int x;
for(i=0; i<n; i++){
x += t;
if(tn[i] < t){
x += t-tn[i];
}
}
printf("%d",x);
} | a.cc:1:1: error: '::main' must return 'int'
1 | void main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:4:18: error: invalid operands of types 'int*' and 'int' to binary 'operator&'
4 | scanf("%d %d",&n &t);
| ~~ ^~
| | |
| | int
| ... |
s009595017 | p03731 | C++ | #include <iostream>
#define int long long
using namespace std;
int x[200001] = {};
unsigned main() {
int N, T;
cin >> N >> T;
for (int i = 0; i < N; i++) {
cin >> x[i];
}
int num = 0, sum = 0;
for (int i = 0; i < N; i++) {
if (x[i] < num) {
sum -= (num - x[i]);
sum += T;
num = x[i] + T;
}
else {... | cc1plus: error: '::main' must return 'int'
|
s048601612 | p03731 | C++ | #include<stdio.h>
int main()
{
int N,T;
int t[200000];
int x;
scanf("%d %d",&N,&T);
for (x=0;x<N;x++)
scan("%d",&t[x]);
int sum;
for (x=0;x<N;x++)
{
if(t[x]<=T)
sum+=t[x];
else
sum+=T;
}
printf("%d",sum);
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:1: error: 'scan' was not declared in this scope; did you mean 'scanf'?
9 | scan("%d",&t[x]);
| ^~~~
| scanf
|
s212223737 | p03731 | Java | import java.util.*;
public class Main {
public static void main(String []args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int t = sc.nextInt();
int[] frags = new int[n];
int i = 0;
while(sc.hasNext()) {
frags[i++] = sc.nextInt();
}
Main soln = new Main();
System.out.println(soln... | Main.java:21: error: int cannot be dereferenced
for(int i=0; i<dlt.length; i++) {
^
1 error
|
s947740398 | p03731 | C++ | #include <iostream>
using namespace std;
int main(){
int N,T;
cin >> N >> T;
int t[N];
scanf("%d",t);
long long now=0,ans=0;
for(int i=0;i<N;i++){
if(t[i+1]>t[i]+T){
ans-=(t[i+1]-t[i]);
ans+=T;
}
}
ans+=t[i]+T;
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:10: error: 'i' was not declared in this scope
15 | ans+=t[i]+T;
| ^
|
s273383142 | p03731 | C++ | #include <iostream>
using namespace std;
int int main(){
int N,T;
cin >> N >> T;
int t[N];
scanf("%d",t);
long long now=0,ans=0;
for(int i=0;i<N;i++){
if(t[i]>now){
ans-=t[i]-now;
}
if(t[i]+T>now){
now=t[i]+T;
}
}
ans+=now;
cout << ans << endl;
return 0;
}
| a.cc:3:1: error: two or more data types in declaration of 'main'
3 | int int main(){
| ^~~
|
s650710343 | p03731 | C | #include <iostream>
using namespace std;
int int main(){
int N,T;
cin >> N >> T;
int t[N];
scanf("%d",t);
long long now=0,ans=0;
for(int i=0;i<N;i++){
if(t[i]>now){
ans-=t[i]-now;
}
if(t[i]+T>now){
now=t[i]+T;
}
}
ans+=now;
cout << ans << endl;
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s596453290 | p03731 | Java | import java.util.Scanner;
public class Main {
public static void main(String args[]){
Scanner cin = new Scanner(System.in);
int N = cin.nextInt();
long T = cin.nextLong();
long before = cin.nextLong();
if(N>1){
long tmp = cin.nextLong();
}
long sum =0L;
for(int i... | Main.java:19: error: cannot find symbol
if(tmp-before<T){
^
symbol: variable tmp
location: class Main
Main.java:20: error: cannot find symbol
sum += T-(tmp-before);
^
symbol: variable tmp
location: class Main
Main.java:23: error: cannot find symbol
before = tmp;
^... |
s308458629 | p03731 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int t = scan.nextInt();
int s = scan.nextInt();
int sum = 0;
for(int i = 1 ; i < n ; < i++){
int time = scan.nextInt();
if(time - s >= t){
... | Main.java:13: error: > or ',' expected
for(int i = 1 ; i < n ; < i++){
^
Main.java:13: error: illegal start of expression
for(int i = 1 ; i < n ; < i++){
^
2 errors
|
s725101212 | p03731 | Java | import java.util.Scanner;
public class Main{
pulic static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = Integer.ParseInt(scan.read());
int t = Integer.ParseInt(scan.read());
int s = Integer.ParseInt(scan.next());;
int sum = 0;
for(int i = 1 ; i < n ; < i++){
int ti... | Main.java:4: error: <identifier> expected
pulic static void main(String[] args){
^
Main.java:13: error: > or ',' expected
for(int i = 1 ; i < n ; < i++){
^
Main.java:13: error: illegal start of expression
for(int i = 1 ; i < n ; < i++){
^
3 errors
|
s817015334 | p03731 | C++ | #include <iostream>
#include <ios>
using namespace std;
// ABC060C Sentou
int main() {
ios.sync_with_stdio(false);
int N, T, t;
cin >> N >> T;
int total = T;
int prev_t = 0;
for (int i = 0; i < N; ++i){
cin >> t;
if (prev_t + T < t){
total += T;
}else {
... | a.cc: In function 'int main()':
a.cc:8:8: error: expected unqualified-id before '.' token
8 | ios.sync_with_stdio(false);
| ^
|
s489539698 | p03731 | C | #include <stdio.h>
int main(){
long long int n,t,tmpa,tmpb,i,ret=0;
scanf("%lld%lld",&n,&t);
for(i=1;i<n;i++){
scanf("%lld ",&tmpa);
if(i!=1){
ret += (tmpa-tmpb>t)?t:(tmpa-tmpb);
}
tmpb = tmpa;
//printf("%d\n",ret); }
scanf("%l... | main.c: In function 'main':
main.c:17:1: error: expected declaration or statement at end of input
17 | }
| ^
|
s739170465 | p03731 | C | #include <stdio.h>
int main()
{
int a,b,i;
int count=0;
scanf("%d %d",&a,&b);
int c[a];
for(i=0;i<a;i++){
scanf("%d",&c[i]);
}
for(i=0;i<a;i++){
count+=b;
if (i+1 == a) {
count += b;
} else if((c[i+1]-c[i])<b) {
count += c[i+1]-c[i];
} else {
count += b;
}
}
printf("%d\n",count);
| main.c: In function 'main':
main.c:25:1: error: expected declaration or statement at end of input
25 | printf("%d\n",count);
| ^~~~~~
|
s918706800 | p03731 | C | #include <stdio.h>
int main()
{
int a,b,i;
int count=0;
scanf("%d %d",&a,&b);
int c[a];
for(i=0;i<a;i++){
scanf("%d",&c[i]);
}
for(i=0;i<a;i++){
count+=b;
if (i+1 == a) {
count += b
} else if((c[i+1]-c[i])<b) {
count += c[i+1]-c[i]
} else {
count += b
}
}
printf("%d\n",count);
} | main.c: In function 'main':
main.c:17:11: error: expected ';' before '}' token
17 | count += b
| ^
| ;
18 | } else if((c[i+1]-c[i])<b) {
| ~
main.c:19:21: error: expected ';' before '}' token
19 | count += c[i+1]-c[i]
| ^
| ... |
s755739829 | p03731 | C++ | #include<iostream>
using namespace std;
int N,T;
int a[2000000];
int main(){
cin>>N>>T;
int sum=0;
for (int i=0;i<N;i++){
cin>>a[i];
if(i==0)sum=T;
else{
if(a[i]-a[i-1]<=T){
int len=T-(t[i]-t[i-1]);
sum=+sum-len+T;
}
else{
sum=sum+T;
}
}
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:13:44: error: 't' was not declared in this scope
13 | int len=T-(t[i]-t[i-1]);
| ^
|
s811593751 | p03731 | C++ | #include <iostream>
using namespace std;
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <functional> //sort(A,A.end(),greater<int>());降順ソート
#include <queue>
#include <stack>
#include <vector>
#define INF 10 << 10
typedef long long int llint;
vector<llint> time;
... | a.cc:17:15: error: 'std::vector<long long int> time' redeclared as different kind of entity
17 | vector<llint> time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64... |
s905258002 | p03731 | C++ | #include<iostream>
using namespace std;
int main(){
int n,t,sum=0,fin,ans=0,big=0;
long int t2;
cin>>n>>t;
fin=t
for(int i=0;i<n;i++){
cin>>t2;
if(t2<=fin){
fin=t2+t;
}
else{
ans=ans+fin-big;
big=t2;
fin=t+t2;
}
}
ans=ans+fin-big;
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:6: error: expected ';' before 'for'
9 | fin=t
| ^
| ;
10 | for(int i=0;i<n;i++){
| ~~~
a.cc:10:13: error: 'i' was not declared in this scope
10 | for(int i=0;i<n;i++){
| ^
|
s305282692 | p03731 | C++ | #include<iostream>
using namespace std;
#ifndef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true " : cout<<"false ";
#define END cout<<"\n";
#endif
int main(){
int n,t,sum=0,fin,ans=0,big=0;
long int t2;
cin>>n>>t;
fin=t
for(int i=0;i<n;i++){
cin>>t2;
if(t2<=fin){
fin=t2+t;
}
else{
a... | a.cc: In function 'int main()':
a.cc:13:6: error: expected ';' before 'for'
13 | fin=t
| ^
| ;
14 | for(int i=0;i<n;i++){
| ~~~
a.cc:14:13: error: 'i' was not declared in this scope
14 | for(int i=0;i<n;i++){
| ^
|
s893347274 | p03731 | C++ | #include <iostream>
using namespace std;
int main(){
long long N,T;
cin >> N >> T;
long long t[N+1]; // how to initialize this kind of variable-sized object?
for(int i=0;i<N+1;i++) t[i]=LONG_MAX;
for(int i=0;i<N;i++) cin >> t[i];
long long ans = 0;
int i=0;
long long prev = 0;
... | a.cc: In function 'int main()':
a.cc:9:33: error: 'LONG_MAX' was not declared in this scope
9 | for(int i=0;i<N+1;i++) t[i]=LONG_MAX;
| ^~~~~~~~
a.cc:2:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #inc... |
s216920079 | p03731 | C++ | #include<bits/stdc++.h>
using namespace std;
int n;
long long t,ans=0;
int main()
{
cin>>n>>t;
cin>>p;
if(n==1){
cout<<t<<endl;return 0;}
for(int i=2;i<=n;i++)
{
cin>>q;
ans+=min(t,q-p);
p=q;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:10:10: error: 'p' was not declared in this scope
10 | cin>>p;
| ^
a.cc:17:10: error: 'q' was not declared in this scope
17 | cin>>q;
| ^
|
s606297831 | p03731 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;A
int main(){
long long int n,t;
vector<long long int> v;
long long int total=0;
int now=0;
cin>>n>>t;
for(int i=0;i<n;i++){
long long int tmp;
cin>>tmp;
v.push_back(tmp);
}
now=v[0];
for(int i=1;... | a.cc:5:21: error: 'A' does not name a type
5 | using namespace std;A
| ^
|
s893117415 | p03731 | C++ | #pragma comment(linker, "/STACK:36777216")
#include <bits/stdc++.h>
using namespace std;
#define LSON id << 1 , l , mid
#define RSON id << 1 | 1 , mid + 1 , r
#define ROOT 1 , 1 , n
#define CLR(x , y) memset(x , y , sizeof(x))
#define LOWBIT(x) x & (-x)
#define FORN(i , a , ... | a.cc:39:9: error: '__int64' does not name a type; did you mean '__int64_t'?
39 | typedef __int64 LL;
| ^~~~~~~
| __int64_t
a.cc:53:1: error: 'LL' does not name a type; did you mean 'ALL'?
53 | LL t;
| ^~
| ALL
a.cc:55:1: error: 'LL' does not name a type; did you mean 'ALL'?... |
s288498720 | p03731 | C++ | include<iostream>
#include <stdio.h>
using namespace std;
int main()
{
long N, T,i,j,S;
N = 0;
T = 0;
S = 0;
int a[200000];
cin >> N, T;
for (i = 0; i > N; i++){
cin >> a[i];
}
for (j = 0; j > N; j++) {
if (a[j] < T)
S = S + a[j];
else
S = S + T;
}
cout << S;
cin >> j;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:13:9: error: 'cin' was not declared in this scope
13 | cin >> N, T;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by addi... |
s295455873 | p03731 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int i=1;
int n=sc.nextInt();
long T=sc.nextLong();
long[] t=new long[n];
long rtn=0;
t[0]=sc.nextLong();
for(i;i<n;i++){
t[i]=sc.nextLong();
rtn+=Math.min(T,t[i]-t[i-1]);
}
System.out.println(rtn);
}
} | Main.java:11: error: not a statement
for(i;i<n;i++){
^
1 error
|
s934982219 | p03731 | C++ | #include <iostream>
#include <list>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int main()
{
int n, t;
cin >> n;
cin >> t;
vector <int> v;
for (int i = 0; i < n; ++i)
{
int a;
cin >> a;
v.emplace_back(a);
}
int res = 0;
for (size_t i = 0; i < v.size(); ++i)
{
res +... | a.cc: In function 'int main()':
a.cc:35:60: error: expected ')' before numeric constant
35 | res -= t - (v[i + 1] - v[i]9;
| ~ ^
| )
|
s371449421 | p03731 | C++ | //#include "flyugelMap2.h"
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int main()
{
int n, t;
cin >> n;
cin >> t;
vector <int> v;
for (int i = 0; i < n; ++i)
{
int a;
cin >> a;
v.emplace_back(a);
}
int res = 0;
for (size_t i = 0; i... | a.cc: In function 'int main()':
a.cc:40:10: error: expected '}' at end of input
40 | }
| ^
a.cc:12:1: note: to match this '{'
12 | {
| ^
|
s756974148 | p03731 | C++ | #include<iostream>
#include <algorithm>
#include<stdint>
using namespace std;
int main() {
int n, t, f, l;
int64_t sum = 0;
cin >> n >> t >> f;
for (int i = 0;i < n - 1;i ++) {
cin >> l;
sum += min(l-f, t);
f = l;
}
cout << sum+t;
} | a.cc:3:9: fatal error: stdint: No such file or directory
3 | #include<stdint>
| ^~~~~~~~
compilation terminated.
|
s396758425 | p03731 | C++ | include <iostream>
using namespace std;
int main()
{
int n,t,a,b,c=0;
cin>>n>>t;
int tab[n];
for(int i=0;i<n;i++){
cin>>tab[i];
}
for(int i=0;i<n-1;i++){
if(tab[i+1]-tab[i]>=t) c+=t;
else c+=tab[i+1]-tab[i];
}
cout<<c;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope
8 | cin>>n>>t;
| ^~~
a.cc:17:1: error: 'cout' was not declared in this scope
17 | cout<<c;
| ^~~~
|
s497205896 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 5;
// input
int N, W;
vector<int> w, v;
vector<map<ll, ll>> m;
void input() {
cin >> N >> W;
w = v = vector<int>(N);
rep(i, N) cin >> ... | a.cc: In function 'int main()':
a.cc:38:42: error: no matching function for call to 'max(int&, std::map<long long int, long long int>::mapped_type&)'
38 | rep(i, N + 1) rep(j, 4 * i) ans = max(ans, m[N][i * w[0] + j]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included fr... |
s397853945 | p03732 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define itn int
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int ... | /tmp/ccEsf2zI.o: in function `__gnu_debug::_Error_formatter::_S_at(char const*, unsigned int, char const*)':
a.cc:(.text._ZN11__gnu_debug16_Error_formatter5_S_atEPKcjS2_[_ZN11__gnu_debug16_Error_formatter5_S_atEPKcjS2_]+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `guard variable for __gnu_debug::_E... |
s757980767 | p03732 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define itn int
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int ... | /tmp/ccDkI2Zq.o: in function `__gnu_debug::_Error_formatter::_S_at(char const*, unsigned int, char const*)':
a.cc:(.text._ZN11__gnu_debug16_Error_formatter5_S_atEPKcjS2_[_ZN11__gnu_debug16_Error_formatter5_S_atEPKcjS2_]+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `guard variable for __gnu_debug::_E... |
s888436876 | p03732 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define itn int
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int ... | /tmp/ccmx7e45.o: in function `__gnu_debug::_Error_formatter::_S_at(char const*, unsigned int, char const*)':
a.cc:(.text._ZN11__gnu_debug16_Error_formatter5_S_atEPKcjS2_[_ZN11__gnu_debug16_Error_formatter5_S_atEPKcjS2_]+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `guard variable for __gnu_debug::_E... |
s707917066 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
ll dp[105][20000];
ll cost[1000],weight[1000];
ll value,task,a;
ll O_1knapsack(ll n,ll val)
{
int i,w;
for(i=0; i<=n; i++)
for(w=0; w<=val; w++)
{
if (i==0 || w==0)
dp[i][w] = 0;
else if(weight[i-1]<=w)
... | a.cc:3:1: error: 'll' does not name a type
3 | ll dp[105][20000];
| ^~
a.cc:4:1: error: 'll' does not name a type
4 | ll cost[1000],weight[1000];
| ^~
a.cc:5:1: error: 'll' does not name a type
5 | ll value,task,a;
| ^~
a.cc:6:1: error: 'll' does not name a type
6 | ll O_1knapsack(ll n... |
s105262853 | p03732 | C++ |
using namespace std;
int N, W;
int w[100], v[100];
int dp(int num, int weight) {
if(num == N){
return 0;
} else if (weight < w[num]) {
return dp(num+1, weight);
} else {
return max(dp(num+1, weight),
dp(num+1, weight -w[num]) + v[num]);
}
}
int main(){
cin >> N >> W;
for(int i ... | a.cc: In function 'int dp(int, int)':
a.cc:13:12: error: 'max' was not declared in this scope
13 | return max(dp(num+1, weight),
| ^~~
a.cc: In function 'int main()':
a.cc:19:3: error: 'cin' was not declared in this scope
19 | cin >> N >> W;
| ^~~
a.cc:1:1: note: 'std::cin' is defin... |
s210453548 | p03732 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<int(n); i++)
using namespace std;
typedef long long LL;
const int N=101;
LL W[N],V[N];
int main() {
LL n,w;
scanf("%lld %lld", &n, &w);
REP(i,n) scanf("%lld %lld", W+i, V+i);
vector<LL> ws;
map<int,vector<LL>> mp;
REP(i,n) {
ws.p... | a.cc: In function 'int main()':
a.cc:29:14: error: no matching function for call to 'min(LL&, int&)'
29 | k=min(n,k);
| ~~~^~~~~
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:
/... |
s902654528 | p03732 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a ... | a.cc: In function 'int main()':
a.cc:51:37: error: no matching function for call to 'min(long long int&, int)'
51 | cout << dp[N][K][min(W,350)] << endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_... |
s947364203 | p03732 | C++ | /*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_... | a.cc: In function 'long long int fun(long long int, long long int)':
a.cc:32:21: error: 'INT_MIN' was not declared in this scope
32 | if (j>w) return INT_MIN;
| ^~~~~~~
a.cc:15:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
... |
s124860213 | p03732 | C++ | 123 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 123
| ^~~
|
s847072831 | p03732 | C++ | // abc060_d
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(... | a.cc: In instantiation of 'void print(const T&) [with T = std::map<long long int, long long int>]':
a.cc:56:14: required from here
56 | print(dp);
| ~~~~~^~~~
a.cc:23:47: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const std::map<lo... |
s410233771 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,w;
cin>>n>>w;
vector<int> wt(n);
vector<int> v(n);
for(int i=0;i<n;i++)
cin>>wt[i];
for(int i=0;i<n;i++)
cin>>v[i];
int dp[n+1][w+1];
for(int i=0;i<n+1;i++)
dp[i][0]=0;
for(int i=0;i<w+1;i++)
dp[0][i]=1;
... | a.cc: In function 'int main()':
a.cc:29:59: error: expected ')' before ';' token
29 | dp[i][j]= max(v[i-1]+dp[i-1][j-wt[i-1]] + dp[i-1][j];
| ~ ^
| )
|
s085600541 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,w;
cin>>n>>w;
vector<int> wt(n);
vector<int> v(n);
for(int i=0;i<n;i++)
cin>>wt[i];
for(int i=0;i<n;i++)
cin>>v[i];
int dp[n+1][w+1];
for(int i=0;i<n+1;i++)
dp[i][0]=0;
for(int i=0;i<w+1;i++)
dp[0][i]=1;
... | a.cc: In function 'int main()':
a.cc:29:21: error: 'val' was not declared in this scope
29 | dp[i][j]= max(val[i-1]+dp[i-1][j-wt[i-1]] + dp[i-1][j];
| ^~~
|
s382934554 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,w;
cin>>n>>w;
vector<int> wt(n);
vector<int> v(n);
for(int i=0;i<n;i++)
cin>>wt[i];
for(int i=0;i<n;i++)
cin>>v[i];
int dp[n+1][w+1];
for(int i=0;i<n+1;i++)
dp[i][0]=0;
for(int i=0;i<w+1;i++)
dp[0][i]=1;
... | a.cc: In function 'int main()':
a.cc:29:21: error: 'val' was not declared in this scope
29 | dp[i][j]= max(val[i-1]+dp[i-1][j-arr[i-1]] + dp[i-1][j];
| ^~~
a.cc:29:40: error: 'arr' was not declared in this scope
29 | dp[i][j]= max(val[i-1]+dp[i-1][j-arr[i-1]] + dp[i-1][j];
... |
s888728894 | p03732 | C | //#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cctype>
#include <cstdlib> // sran... | main.c:4:10: fatal error: string: No such file or directory
4 | #include <string>
| ^~~~~~~~
compilation terminated.
|
s592734744 | p03732 | C++ | #include<bitset/std++.h>
using namespace std;
// 入力
int n, W;
int weight[110], value[110];
// DPテーブル
int dp[110][10010];
int main() {
cin >> n >> W;
for (int i = 0; i < n; ++i) cin >> weight[i] >> value[i];
// DP初期条件: dp[0][w] = 0
for (int w = 0; w <= W; ++w) dp[0][w] = 0;
// DPループ
for (int i = 0; i < ... | a.cc:1:9: fatal error: bitset/std++.h: No such file or directory
1 | #include<bitset/std++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s698648608 | p03732 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define vi vector<int>
using ll = long long;
using namespace std;
int main(){
int n,W;
cin >> n >> W;
vi w(n);
vi v(n);
map<int, vi> weights;
rep(i, n){
cin >> w[i] >> v[i];
weights[w[i]].push_back(v[i]);
}
int ans = 0;
int ... | a.cc: In function 'int main()':
a.cc:19:5: error: 'SORT' was not declared in this scope
19 | SORT(x.second);
| ^~~~
|
s491858132 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq... | a.cc: In function 'int main()':
a.cc:30:10: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'class std::vector<long long int>'} has no member named 'puah_back'; did you mean 'push_back'?
30 | S[i].puah_back(0);
| ^~~~~~~... |
s159469438 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq... | a.cc: In function 'int main()':
a.cc:30:10: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'class std::vector<long long int>'} has no member named 'puah_back'; did you mean 'push_back'?
30 | S[i].puah_back(0);
| ^~~~~~~... |
s173266213 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,W;
cin>>N>>W;
vector<int> w(N),v(N);
for(int i=0;i<N;i++){
cin>>w.at(i)>>v.at(i);
}
vector<int> value(W+1,0);
if(w.at(0)<=W){
value.at(w.at(0))=v.at(0);
}
for(int i=1;i<N;i++){
for(int j=w.(i);j+w.at(i)<=W;j++){
valu... | a.cc: In function 'int main()':
a.cc:17:17: error: expected unqualified-id before '(' token
17 | for(int j=w.(i);j+w.at(i)<=W;j++){
| ^
|
s169178243 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int main(void) {
int N;
int64_t W;
cin >> N >> W;
vector< vector<int64_t> > v(4);
--N;
int w0, v0;
cin >> w0 >> v0;
v[0].push_back(v0);
while(N--) {
int w, v;
cin >> w... | a.cc: In function 'int main()':
a.cc:20:10: error: invalid types 'int[int]' for array subscript
20 | v[w-w0].push_back(v);
| ^
|
s396915438 | p03732 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const in... | /tmp/ccQBrpgA.o: in function `knapsack(long long, long long)':
a.cc:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccQBrpgA.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccQBrpgA.o
a.cc:(.te... |
s299380880 | p03732 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const in... | /tmp/ccDuJreq.o: in function `knapsack(long long, long long)':
a.cc:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccDuJreq.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccDuJreq.o
a.cc:(.te... |
s529556458 | p03732 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const in... | /tmp/cckzq5u4.o: in function `knapsack(long long, long long)':
a.cc:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cckzq5u4.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cckzq5u4.o
a.cc:(.te... |
s092363473 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq... | a.cc: In function 'int main()':
a.cc:24:27: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
24 | dp.at(i).at(j)=max(dp.at(i-1).at(j-A.at(i-1).first)+A.at(i-1).second,1);//dp.at(i-1).at(j));
| ... |
s735255132 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(... | a.cc: In function 'int main()':
a.cc:55:30: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
55 | ans = max(ans,vsum[0][i]+vsum[1][j]+vsum[2][k]+vsum[3][l]);
| ~~~^~~~~~~~~~~~~~... |
s486479571 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(... | a.cc: In function 'int main()':
a.cc:32:47: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
32 | dp[i+1][j+1][k + vw[i] - w1] = max(dp[i+1][j+1][k + vw[i] -... |
s675050238 | p03732 | C++ | 4 6
2 1
3 4
4 10
3 4 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4 6
| ^
|
s315040411 | p03732 | C++ | #define _GLIBCXX_DEBUG//TLEの原因になるので注意!!!!!!!!!!!
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n)... | /tmp/cckmSxMK.o: in function `main':
a.cc:(.text+0x54): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cckmSxMK.o
a.cc:(.text+0x80): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cckmSxMK.o
a.cc:(.text+0xc4): relocation trunc... |
s887146177 | p03732 | C++ | #define _GLIBCXX_DEBUG//TLEの原因になるので注意!!!!!!!!!!!
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n)... | /tmp/ccIbkYMh.o: in function `main':
a.cc:(.text+0x54): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccIbkYMh.o
a.cc:(.text+0x80): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccIbkYMh.o
a.cc:(.text+0xc4): relocation trunc... |
s617136804 | p03732 | C++ | #define _GLIBCXX_DEBUG//TLEの原因になるので注意!!!!!!!!!!!
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n)... | /tmp/ccaiFZBd.o: in function `main':
a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccaiFZBd.o
a.cc:(.text+0x7f): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccaiFZBd.o
a.cc:(.text+0xc3): relocation trunc... |
s559235572 | p03732 | C++ | #define _GLIBCXX_DEBUG//TLEの原因になるので注意!!!!!!!!!!!
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n)... | /tmp/ccwnlfiD.o: in function `main':
a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccwnlfiD.o
a.cc:(.text+0x7f): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwnlfiD.o
a.cc:(.text+0xc3): relocation trunc... |
s619789416 | p03732 | C++ | #define _GLIBCXX_DEBUG//TLEの原因になるので注意!!!!!!!!!!!
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n)... | /tmp/ccrsXajT.o: in function `main':
a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccrsXajT.o
a.cc:(.text+0x7f): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccrsXajT.o
a.cc:(.text+0xc3): relocation trunc... |
s356438617 | p03732 | C++ | #define _GLIBCXX_DEBUG//TLEの原因になるので注意!!!!!!!!!!!
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n)... | /tmp/ccd7C4UI.o: in function `main':
a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccd7C4UI.o
a.cc:(.text+0x7f): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccd7C4UI.o
a.cc:(.text+0xc3): relocation trunc... |
s868889609 | p03732 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next());
int W = Integer.parseInt(sc.next());
ArrayList<Integer> val_1 = new ArrayList<Integer>();
ArrayList<Integer> val_2 = new... | Main.java:57: error: variable l is already defined in method main(String[])
int l = Math.min(val_4.size(), N-i-j-k);
^
1 error
|
s230054114 | p03732 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
#include<unordered_map>
using namespace std;
using ll=long long;
#define rep(i,n) for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(... | a.cc: In function 'int main()':
a.cc:28:45: error: expected ';' before ')' token
28 | rep(i, 4)sort(v[i].rbegin(),v[i].rend()));
| ^
| ;
|
s038739388 | p03732 | C++ | #include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>
#include <utility>
using namespace std;
typedef long long int ll;
ll... | /tmp/ccIrONfo.o: in function `solve()':
a.cc:(.text+0xc): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccIrONfo.o
a.cc:(.text+0x34): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccIrONfo.o
a.cc:(.text+0xb3): relocation tru... |
s738857632 | p03732 | C++ | #include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>
#include <utility>
using namespace std;
typedef long long int ll;
ll... | /tmp/ccn3qSA8.o: in function `solve()':
a.cc:(.text+0xc): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccn3qSA8.o
a.cc:(.text+0x34): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccn3qSA8.o
a.cc:(.text+0xb3): relocation tru... |
s394044710 | p03732 | C++ | #include <bits/stdc++.h>
#define SORT(x) sort(x.begin(),x.end(),greater<ll>())
#define ALL(x) x.begin(),x.end()
#define deb(x) cout<<#x<<"="<<x<<endl
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
#define INF 1000000007
#de... | a.cc: In function 'void Main()':
a.cc:41:1: error: 'a' was not declared in this scope
41 | a
| ^
a.cc:44:5: error: 'ses' was not declared in this scope; did you mean 'se'?
44 | ses[i]=se[i].size()+1;
| ^~~
| se
a.cc:49:9: error: 'ses' was not declared in this scope; did you mean 'se'... |
s968188446 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
const int eps=1e-6;
const int inf=0x3f3f3f3f;
typedef unsigned long long ull;
typedef long long ll;
const int N = 110 ;
int n,m,a[110],b[110],dp[110][110][330];
int main()
{
cin<<n<<m;
for(int i=1;i<=n;i++)cin<<a[i]<<b[i];
for(int i=1;i<=n;i++)
for(i... | a.cc: In function 'int main()':
a.cc:11:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
11 | cin<<n<<m;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:11:9: note: candid... |
s500059548 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
vector<pair<int,int> > items;
int knapsack(int w)
{
vector<int> dp(w+4,0);
for(int i=0 ; i<items.size() ; ++i)
{
for(int j=w ; j>=items[i].first ; --j)
{
dp[j]=max(dp[j],dp[j-items[i].first]+items[i].second);
}
}
retu... | a.cc: In function 'int main()':
a.cc:28:19: error: too many arguments to function 'int knapsack(int)'
28 | cout<<knapsack(w,items)<<endl;
| ~~~~~~~~^~~~~~~~~
a.cc:5:5: note: declared here
5 | int knapsack(int w)
| ^~~~~~~~
|
s267439076 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
map<pair<int,int>,int>d;
int w[100],v[100],N,W;
int dp(int i,int j){
pair<int,int> p=make_pair(i,j);
if(d.count(p)) return d[p];
long res;
if(i==n)res=0;
else if(j<w[i])res=dp(i+1,j);
else res=max(dp(i+1,j),dp(i+1,j-w[i])+v[i]);
return d[p]=res;
}
int main(){
cin>>N>... | a.cc: In function 'int dp(int, int)':
a.cc:9:15: error: 'n' was not declared in this scope
9 | if(i==n)res=0;
| ^
|
s547836399 | p03732 | C++ | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#define FOR(idx, begin, end) for(int idx = (int)(begin); idx < (int)(end); ++idx)
#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\... | a.cc: In function 'int main()':
a.cc:50:26: error: no matching function for call to 'sort(std::vector<itm>::iterator, std::vector<itm>::iterator, <unresolved overloaded function type>)'
50 | FOR(i, 0, 4) sort(numw[i].begin(), numw[i].end(),operator>);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~... |
s875780815 | p03732 | C++ | from collections import *
N,W=map(int,input().split())
d=defaultdict(int)
d[0]=0
for i in range(N):
v,w=map(int,input().split())
c=d.copy()
for p,q in c.items():
if p+w<=W:
d[p+w]=max(d[p+w],q+v)
print(max(d.values())) | a.cc:1:1: error: 'from' does not name a type
1 | from collections import *
| ^~~~
|
s118771811 | p03732 | C++ | #include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int main() {
int N,W;
cin >> N >> W;
vector<pair<int,int>> wv(N);
for (int i=0; i<N; i++) {
cin >> wv[i].first >> wv[i].second;
}
int smallw = wv[0].first;
//cerr << smallw << endl;
sort(wv.begin(),wv.e... | a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
9 | cin >> N >> W;
| ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
4 | #include <map>
+++ |+#include <iostream>
5 | using namespace s... |
s741492448 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
void Sort(int*, int*, int)
int main() {
int n,w;
cin >> n >> w;
int a[n],b[n];
for(int i=0;i<n;i++) {
cin >> a[i] >> b[i];
}
Sort(a,b,n);
int sum = 0;
for(int i=0;i<n;i++) {
if(w >= a[i]) {
w -= a[i];
sum += b[i];
}
}
cout << su... | a.cc:6:1: error: expected initializer before 'int'
6 | int main() {
| ^~~
|
s875156357 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
void Sort(int*, int*, int)
int main() {
int n,w;
cin >> n >> w;
int a[n],b[n]
for(int i=0;i<n;i++) {
cin >> a[i] >> b[i];
}
Sort(a,b,n);
int sum = 0;
for(int i=0;i<n;i++) {
if(w >= a[i]) {
w -= a[i];
sum += b[i];
}
}
cout << sum... | a.cc:6:1: error: expected initializer before 'int'
6 | int main() {
| ^~~
|
s356618662 | p03732 | C++ | #include <iostream>
#include <climits>
#include <algorithm>
using namespace std;
// 入力
int n, W;
int weight[1000000010], value[110];
// DPテーブル
int dp[110][10010];
int main() {
cin >> n >> W;
for (int i = 0; i < n; ++i) cin >> value[i] >> weight[i];
// DP初期条件: dp[0][w] = 0
for (int w = 0; w <= W; ++w) dp[0][... | /tmp/cc9hKyX1.o: in function `main':
a.cc:(.text+0x4f): relocation truncated to fit: R_X86_64_PC32 against symbol `value' defined in .bss section in /tmp/cc9hKyX1.o
a.cc:(.text+0xb5): relocation truncated to fit: R_X86_64_PC32 against symbol `dp' defined in .bss section in /tmp/cc9hKyX1.o
a.cc:(.text+0x127): relocation... |
s291157293 | p03732 | C++ | #include <iostream>
#include <array>
#include <vector>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long LL;
const int INF=1<<30;
const LL MOD=1000000007;
LL gcd(LL a,LL b){
i... | a.cc: In function 'int main()':
a.cc:36:10: error: invalid types 'int[int]' for array subscript
36 | v[w2-w1].push_back(v);
| ^
|
s576750078 | p03732 | C++ | #include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int main(int argc, const char * argv[]) {
ll N, W;
cin >> N >> W;
vector<ll> v1, v2, v3, v4;
ll w1 = 0;
for (int i = 0; i < N; i++) {
ll wi, vi;
... | a.cc: In function 'int main(int, const char**)':
a.cc:51:3: error: 'memset' was not declared in this scope
51 | memset(a1, 0, sizeof(a1));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <algorithm>
+++ |+#includ... |
s373013681 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,a[111],b[111],f[111][111][310];
int main()
{
cin>>n>>m;
for (int i=0;i<n;i++)
cin>>a[i]>>b[i];
for (int i=0;i<n;i++)
for (int j=0;j<=i;j++)
for (int k=0;k<=3*j;k++)
{
f[i+1][j][k]=max(f[i+1][j][k],f[i][j][k]);
f[i+1][j+1][k+a[i]-a[0]]=max(f[i+1... | a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s828076526 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, w;
cin >> n >> w;
vector<vector<int>> a(4);
int sw;
for(int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
if(i == 0) sw = x;
a[x -sw].push_back(y);
}
for(int i = 0; i < 4; i++) {
sort(a[i].... | a.cc: In function 'int main()':
a.cc:27:85: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
27 | long long ww = 1LL * i * sw + 1LL * j * (ws + 1) + 1LL * k * (ws + 2) + 1LL * l * (ws + 3);
| ... |
s724912975 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_bac... | a.cc: In function 'int main()':
a.cc:54:51: error: no matching function for call to 'min(ll&, int&)'
54 | iiii = min(iiii, V3);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /u... |
s769030779 | p03732 | C++ | #include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;
typedef l... | a.cc:82:11: error: 'll index [5]' redeclared as different kind of entity
82 | ll index[5];
| ^
In file included from /usr/include/string.h:462,
from a.cc:16:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
50 | extern const char *inde... |
s216600807 | p03732 | Java | import java.util.*;
class Main
{
public static void main (String[] args)
{
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int W = sc.nextInt();
int[] w = new int[N];
int[] v = new int[N];
for(int i = 0; i < N; i++){
w[i] = sc.nextInt();
... | Main.java:27: error: incompatible types: possible lossy conversion from long to int
dp[i][j] = Math.max(dp[i][j-1], x);
^
1 error
|
s950217060 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int n,W;cin>>n>>W;
long long int w[n],v[n];
for(long long int i=0;i<n;i++) cin>>w[i]>>v[i];
int box[n+1][W+1];
for(long long int i=0;i<=n;i++){
for(long long int j=0;j<=W;j++){
box[i][j]=-1;
}
}
long long int ret=0;
box[0][... | a.cc: In function 'int main()':
a.cc:20:31: error: no matching function for call to 'max(int&, long long int)'
20 | box[i+1][j+w[i]]=max(box[i+1][j+w[i]],box[i][j]+v[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.