submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s841198690 | p03780 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
using namespace std;
//cardsのうちK - num以上K - 1以下の和をもつ部分集合Sが作れるか//
//をDPで判定する関数//
bool search_set(vector<int> cards, int K, int num){
//exist[i][j]はcardsのi枚目まで使って合計jとなる部分集合を作れるかどうか//
bool exist[cards.size()][K];
unsi... | a.cc: In function 'bool search_set(std::vector<int>, int, int)':
a.cc:53:55: error: lvalue required as left operand of assignment
53 | if(j >= K - num && j <= K - 1 && exist[i][j] = true){
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
|
s204832650 | p03780 | C++ | include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
//cardsのうちcards[i]を除いた集合から、min以上max以下の部分集合Sが作れるか//
//を再帰的に判定する関数//
bool search_set(vector<int> cards, unsigned int i, int min, int max){
//もしmin <= 0 <= maxならこれ以上何も選ばず条件を満たす//
if(min <= 0 && max >= 0)
return... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __... |
s368525939 | p03780 | 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)
#define reps(i,j,N) for(LL i=j;i<N;++i)
typedef long long int LL;
typedef std::pair<int, int> P;
int N, K, a[5112];
int ans;
int main()
{
in >> N >> K;
rep(i, N) { i... | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s321679319 | p03780 | 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)
#define reps(i,j,N) for(LL i=j;i<N;++i)
typedef long long int LL;
typedef std::pair<int, int> P;
int N, K, a[5112];
int ans;
int main()
{
in >> N >> K;
rep(i, N) { i... | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s732836892 | p03780 | 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)
#define reps(i,j,N) for(LL i=j;i<N;++i)
typedef long long int LL;
typedef std::pair<int, int> P;
int N, K, a[5112];
int ans;
int main()
{
in >> N >> K;
rep(i, N) { i... | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include "bits\stdc++.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s257177069 | p03780 | C++ | #include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int N,K;
cin >> N >> K;
vector<long long int>A(N);
for(int i=0; i < N; i++)
cin >> A[i];
vector<vector<bool> >dp(N,vector<bool>(K));
int ans = 0;
for(int... | a.cc: In function 'int main()':
a.cc:41:12: error: 'ai' was not declared in this scope
41 | if(K < ai) s = 0;
| ^~
a.cc:50:7: error: 'i' was not declared in this scope
50 | A[i] = ai;
| ^
a.cc:50:12: error: 'ai' was not declared in this scope
50 | A[i] = ai;
| ... |
s814838629 | p03780 | C++ | #include<stdio.h>
#include<stdlib.h>
void main()
{
int N;
int K;
unsigned long long a[5000];
int i;
int j;
unsigned long long maxsum=0;
unsigned long long *sets;
unsigned long long sum[5000];
unsigned long long temp;
unsigned long long necessary[5000];
int necessarycount=0;
int unnecessary=0;
... | a.cc:4:1: error: '::main' must return 'int'
4 | void main()
| ^~~~
|
s071535291 | p03780 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
long long a[5001];
int main()
{
long long N,M,K,i,j,s,ans;
scanf("%lld%lld",&N,&K);
for(i=0; i<N; i++)
scanf("%d",&a[i]);
sort(a,a+N);
ans=0,s=0;
for(i=N-1; i>=0; i--)
{
s+=a[i];
ans++;
if(s>=K)
{
s=0,an... | a.cc: In function 'int main()':
a.cc:30:3: error: expected '}' at end of input
30 | }
| ^
a.cc:8:1: note: to match this '{'
8 | {
| ^
|
s784908437 | p03780 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
long long a[5001];
int main()
{
long long N,M,K,i,j,s,ans;
scanf("%lld%lld",&N,&K);
for(i=0; i<N; i++)
scanf("%d",&a[i]);
sort(a,a+N);
ans=0,s=0;
for(i=N-1; i>=0; i--)
{
s+=a[i];
ans++;
if(s>=K)
{
s=0,an... | a.cc: In function 'int main()':
a.cc:30:3: error: expected '}' at end of input
30 | }
| ^
a.cc:8:1: note: to match this '{'
8 | {
| ^
|
s424104502 | p03780 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
long long int n,k,i,sum=0,plus=0,ans=0;
cin>>n>>k;
vector<int>A;
int AA[n];
for(i=0;i<n;i++){
cin>>AA[i];
A.push_back(AA[i]);
}
sort(A.begin(), A.end() );
for(i=0;i<A.size;i++)sum+=A[i];
for(i=0;i<A.size;i++){
sum-=A[i... | a.cc: In function 'int main()':
a.cc:16:13: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
16 | for(i=0;i<A.size;i++)sum+=A[i];
| ... |
s836906197 | p03780 | C++ | #define SORT(v) sort(v.begin(), v.end())
#include <iostream>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <cstdlib>
#include <algorithm>
#include <cstdarg>
#include <cstdio>
#include <numeric>
// #include "ane.cpp"
#define INF (int)1e9
#define INFLL (long long)1e18
#define NMAX 5005
#de... | a.cc: In function 'void solve()':
a.cc:76:14: error: no matching function for call to 'max(int, ll)'
76 | ans = max(0, ans - dup);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /us... |
s432811684 | p03780 | C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int N,K,a[5000],b;
scanf("%d %d",&N,&K);
b=N;
for(i=0;i<N;i++)
{
scanf("%d",a[i]);
c+=a[i];
}
while(c>=K)
for(i=1;i<=N;i++)
for(j=)
} | main.c: In function 'main':
main.c:9:9: error: 'i' undeclared (first use in this function)
9 | for(i=0;i<N;i++)
| ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:9: error: 'c' undeclared (first use in this function)
12 | c+=... |
s829715302 | p03780 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> nums(N, 0);
for (int i = 0; i < N; i++)
cin >> nums[i];
sort(nums.begin(), nums.end());
int res = 0;
int case_num = pow(2, N);
for (int i = 0; i < N; i++){
int add = pow(2, i);
... | a.cc: In function 'int main()':
a.cc:14:24: error: 'pow' was not declared in this scope
14 | int case_num = pow(2, N);
| ^~~
|
s058663751 | p03780 | C++ | #include <iostream>
#include <queue>
#include <map>
#include <queue>
#include <cmath>
using namespace std;
const int maxn = 5010;
long long save[maxn];
long long sum[maxn][maxn];
int main(){
int n,i,j;
long long k;
scanf("%d%lld",&n,&k);
for(i=1;i<=n;i++){
scanf("%lld",&save[i]);
}
sort(... | a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
17 | sort(save+1, save+1+n);
| ^~~~
| sqrt
|
s726352961 | p03780 | C++ | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author Yulian
*/
#include <iostream>
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <deque>
#include <string>
#include <algorithm>
#include <map>
#include ... | a.cc: In member function 'void D::solve(std::istream&, std::ostream&)':
a.cc:67:15: error: 'accumulate' was not declared in this scope
67 | rec(a, k, accumulate(a.begin(), a.end(), 0), b);
| ^~~~~~~~~~
|
s482304232 | p03780 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> nums(N, 0);
for (int i = 0; i < N; i++)
cin >> nums[i];
sort(nums.begin(), nums.end());
int res = 0;
int case_num = pow(2, N);
for (int i = 0; i < N; i++){
int add = pow(2, i);
... | a.cc: In function 'int main()':
a.cc:14:24: error: 'pow' was not declared in this scope
14 | int case_num = pow(2, N);
| ^~~
|
s752132942 | p03780 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int a[5500];
int main()
{
int n, k;
memset(a, 0, sizeof(a));
long long sum = 0;
cin >> n >> k;
for (int i = 0; i < n; i++)
{
cin >> a[i];
sum += a[i];
}
if (sum < k)
{
cout << n << endl;
}
else
{
sort(a, a + n);
if (a[0] >= k)
cout <... | a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
10 | memset(a, 0, sizeof(a));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#include <cstri... |
s457876404 | p03780 | C++ | //
// main.cpp
// D
//
// Created by 黄宇凡 on 2017/3/18.
// Copyright © 2017年 黄宇凡. All rights reserved.
//
#include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 405;
int n,k;
int a[maxn];
bool pre[maxn][maxn];
bool suf[maxn][maxn];
int main(int argc, const char * argv[]) {
cin >> n >... | a.cc: In function 'int main(int, const char**)':
a.cc:31:5: error: 'memset' was not declared in this scope
31 | memset(pre,false,sizeof(pre));
| ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
10 | #include <cstdio>
+++ |+#... |
s918576536 | p03781 | C++ | #include<bits/stdc++.h>
using namespace std;
long long int x;
cin>>x;
cout<<0.5*(ceil(double(sqrt(8*x)))-1)<<"\n";
| a.cc:4:1: error: 'cin' does not name a type
4 | cin>>x;
| ^~~
a.cc:5:1: error: 'cout' does not name a type
5 | cout<<0.5*(ceil(double(sqrt(8*x)))-1)<<"\n";
| ^~~~
|
s186386836 | p03781 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
int main() {
ll n;
cin>>n;
ll aa=0;
ll counter=0;
for(ll i=1; i>0; i++){
aa+=i;
counter++;
if(aa==n){
cout<<counter<<endl;
break;}
else if(aa>n){
cout<<counter<<endl;
break;}}}
for(ll i=1; i<=m... | a.cc:20:1: error: expected unqualified-id before 'for'
20 | for(ll i=1; i<=m; i++){
| ^~~
a.cc:20:13: error: 'i' does not name a type
20 | for(ll i=1; i<=m; i++){
| ^
a.cc:20:19: error: 'i' does not name a type
20 | for(ll i=1; i<=m; i++){
| ^
a.cc:22:1: error: '... |
s780635683 | p03781 | C++ | #include<iostream>
using namespace std;
int main(){
int x;
cin>>x;
long long c=0;
for(int i=0;i<1000000;i++){
c+=i;
if(c>x){cout <<i<<endl;break};
}
}
} | a.cc: In function 'int main()':
a.cc:9:33: error: expected ';' before '}' token
9 | if(c>x){cout <<i<<endl;break};
| ^
| ;
a.cc: At global scope:
a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s559129883 | p03781 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int X;
cin >> X;
int p = 0;
for (int i = 0; i < N; i++){
p+=i;
if (X <= p){
cout << i;
break;
}
}
} | a.cc: In function 'int main()':
a.cc:7:23: error: 'N' was not declared in this scope
7 | for (int i = 0; i < N; i++){
| ^
|
s611862026 | p03781 | C++ | #include <iostream>
#include <algorithm>
#include <limits>
using namespace std;
int dest;
int min_times = INT_MAX;
int jump(int curr, int times) {
if(curr == dest)
return times - 1;
if(curr > dest)
return INT_MAX;
if(times > min_times)
return INT_MAX;
int goRight = ... | a.cc:8:17: error: 'INT_MAX' was not declared in this scope
8 | int min_times = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <limits>
+++ |+#include <climits>
4 |
a.cc: In function ... |
s226011096 | p03781 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int dest;
int min_times = INT_MAX;
int jump(int curr, int times) {
if(curr == dest)
return times - 1;
if(curr > dest)
return INT_MAX;
if(times > min_times)
return INT_MAX;
int goRight = jump(curr + times,... | a.cc:7:17: error: 'INT_MAX' was not declared in this scope
7 | int min_times = INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <algorithm>
+++ |+#include <climits>
3 |
a.cc: In functi... |
s390416430 | p03781 | C++ | #include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
#define R(i,n) for(int i = 1; i<=n; i++)
typedef long long ll;
using namespace std;
int main(){
int n,m=0;
cin >> n;
r(i,n){
m+=i;
if(m>=n){
cout << i << endl;
break;
}
}
}
} | a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s737361968 | p03781 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <set>
#include <list>
#include <bitset>
#include <cstdlib>
using namespace std;
int main()
{
int X;
cin >> X;
int step = 0;
for (int i = 1; i <= X; i++)
{
if ((i * (i + ... | a.cc: In function 'int main()':
a.cc:26:6: error: expected '}' at end of input
26 | }
| ^
a.cc:14:1: note: to match this '{'
14 | {
| ^
|
s766168680 | p03781 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long x; cin>>x;
for(int i=0;;i++){
if(1*(i+1)/2>=x){
cout<<t<<endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:8:13: error: 't' was not declared in this scope
8 | cout<<t<<endl;
| ^
|
s034482918 | p03781 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long x; cin>>x;
for(int i=0;;i++){
if(t*(t+1)/2>=x){
cout<<t<<endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:7:8: error: 't' was not declared in this scope
7 | if(t*(t+1)/2>=x){
| ^
|
s987598781 | p03781 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s173531282 | p03781 | C++ | #include<iostream>
using namespace std;
int main()
{
int n, i, s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s + i;
if (s >= n) break;
}
cout << i;
return 0; | a.cc: In function 'int main()':
a.cc:14:14: error: expected '}' at end of input
14 | return 0;
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s633044525 | p03781 | C++ | using namespace std;
int main()
{
int n, i, s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s + i;
if (s >= n) break;
}
cout << i;
return 0; | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:11:5: error: 'c... |
s950683910 | p03781 | C++ | using namespace std;
int main()
{
int n, i, s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s + i;
if (s >= n) break;
}
cout << i;
return; | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:11:5: error: 'c... |
s998226369 | p03781 | C++ | using namespace std;
int main()
{
int n, i, s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s + i;
if (s >= n) break;
}
cout << i;
return 0; | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:11:5: error: 'c... |
s666746789 | p03781 | C++ | #include <iostream>
using namespace std;
int main()
{
int i,n,s=0;
cin>>n;
for(i=1; ;i++){
s=s+i;
if(s>=n)break;
}
cout <<i
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:9: error: expected ';' before 'return'
15 | cout <<i
| ^
| ;
......
18 | return 0;
| ~~~~~~
|
s976467840 | p03781 | C++ | using namespace std;
int main()
{
int n, i, s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s + i;
if (s >= n) break;
}
cout << i;
return 0; | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:11:5: error: 'c... |
s390667715 | p03781 | C++ | #include <iostream>
using namespace std;
int main()
{
int i,n,s=0;
cin>>n;
for(i=1; ;i++){
s=s+i;
if(s>=n)break;
}
cout <<i
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:9: error: expected ';' before 'return'
15 | cout <<i
| ^
| ;
......
18 | return 0;
| ~~~~~~
|
s262446884 | p03781 | C++ | #include <iostream>
using namespace std;
int main()
{
int i,n,s=0;
cin >> n;
for(i=1; ; i++;){
s=s+i;
if(s>=n) break;
}
cout << 1;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:19: error: expected ')' before ';' token
9 | for(i=1; ; i++;){
| ~ ^
| )
a.cc:9:20: error: expected primary-expression before ')' token
9 | for(i=1; ; i++;){
| ^
|
s391617708 | p03781 | C++ | int main()
{
int n, i, s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s + i;
if (s >= n) break;
}
cout << i;
return 0; | a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin >> n;
| ^~~
a.cc:9:5: error: 'cout' was not declared in this scope
9 | cout << i;
| ^~~~
a.cc:10:14: error: expected '}' at end of input
10 | return 0;
| ^
a.cc:2:1... |
s808258269 | p03781 | C++ | int main()
{
int n, i, s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s + i;
if (s >= n) break;
}
cout << i;
return 0; | a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin >> n;
| ^~~
a.cc:9:5: error: 'cout' was not declared in this scope
9 | cout << i;
| ^~~~
a.cc:10:14: error: expected '}' at end of input
10 | return 0;
| ^
a.cc:2:1... |
s553598567 | p03781 | C++ | using namespace std;
int main()
{
int n, i ,s = 0;
cin >> n;
for (i = 1; ; i++) {
s = s+i;
if (s >=n) break;
}
cout << i;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:11:5: error: 'c... |
s077132129 | p03781 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef map<int, int> mi;
typedef set<int> si;
#def... | a.cc: In function 'int main()':
a.cc:48:13: error: 'i' was not declared in this scope
48 | cout << i - 1;
| ^
|
s053957706 | p03781 | C++ | l#include<iostream>
#include<vector>
using namespace std;
int main(){
long long x,i;
cin >> x;
for(i=x;x<=i*(i+1)/2;i--);
cout << i+1 << endl;
}
| a.cc:1:2: error: stray '#' in program
1 | l#include<iostream>
| ^
a.cc:1:1: error: 'l' does not name a type
1 | l#include<iostream>
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c... |
s130778071 | p03781 | C++ | #include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>... | a.cc:34:39: error: redefinition of 'template<class A, class B> bool chmax(A&, const B&)'
34 | template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
| ^~~~~
a.cc:8:39: note: 'template<class A, class B> bool chmax(A&, const B&)' previously de... |
s472278012 | p03781 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in);) {
new Main().solve(sc);
}
}
void solve(Scanner sc) {
int x = sc.nextInt();
int ans = 0;
for (int i = 0; i < max; i++) {
... | Main.java:13: error: cannot find symbol
for (int i = 0; i < max; i++) {
^
symbol: variable max
location: class Main
1 error
|
s475184075 | p03781 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)
int main(){
int N, K;
cin >> N >> K;
vector<ll> a(N);
REP(... | a.cc: In function 'int main()':
a.cc:33:30: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
33 | for(int j=max(K-a[i], 0);j<K;j++){
| ~~~^~~~~~~~~~~
In file included from /usr/inclu... |
s046123560 | p03781 | C++ | //123433333333364975546843924818757887827846493467345734648575757575757576618427973496421873454518738401246942481455434946194348649724846543794548 | /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
|
s708659856 | p03781 | C++ | #include <bits/stdc++.h>
using namespace std ;
int main ()
{
int cnt = 0 , a ;
cin >> a ;
int j = 1 ;
while ( 1 ){
cnt += j ;
j ++ ;
if ( cnt >= a ){
cout << i ;
break ;
}
}
}
| a.cc: In function 'int main()':
a.cc:14:21: error: 'i' was not declared in this scope
14 | cout << i ;
| ^
|
s340465155 | p03781 | C++ | #include <bits/stdc++.h>
using namespace std ;
int main ()
{
int cnt = 0 , a ;
cin >> a ;
while ( 1 ){
cnt += i ;
if ( cnt >= a ){
cout << cnt ;
break ;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:10:12: error: 'i' was not declared in this scope
10 | cnt += i ;
| ^
a.cc: At global scope:
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s602615878 | p03781 | C++ | using namespace std;
int main() {
int x,i;
cin >> x;
for(i = 0;x>0;x-=i)
i++;
cout << i << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
5 | cin >> x;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:8:9: er... |
s253052378 | p03781 | C++ | N, K = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
ans = N
t = 0
for i in range(N-1, -1, -1) :
if t+a[i] < K :
t += a[i]
else :
ans = min(ans, i)
print(ans) | a.cc:1:1: error: 'N' does not name a type
1 | N, K = map(int, input().split())
| ^
|
s543887157 | p03781 | C++ | #include<iostream>
#include<cmath>
double X;
using namespace std;
int main() {
cin >> X;
cout << long long(ceil((-1 + sqrt(1 + 8 * X)) / 2)) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: expected primary-expression before 'long'
10 | cout << long long(ceil((-1 + sqrt(1 + 8 * X)) / 2)) << endl;
| ^~~~
|
s585879988 | p03781 | C++ | #include <iostream>
using namespace std;
int main(void){
int a;
cin >> a;
int num = 0;
while (a > 0)
num++;
a >>= 1;
}
cout << num << endl;
return 0;
}
| a.cc:16:1: error: 'cout' does not name a type
16 | cout << num << endl;
| ^~~~
a.cc:18:1: error: expected unqualified-id before 'return'
18 | return 0;
| ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s008357104 | p03781 | C++ | ウー
| a.cc:1:1: error: '\U000030a6\U000030fc' does not name a type
1 | ウー
| ^~~~
|
s284138845 | p03781 | C++ | ウー
| a.cc:1:1: error: '\U000030a6\U000030fc' does not name a type
1 | ウー
| ^~~~
|
s776192838 | p03781 | C++ |
using namespace std;
#include<iostream>
#include<string>
int main()
{
int a,b,c,d,e,f;
cin>>a>>b>>c>>d;
f=c-a;
e=d-b;
if(e>1 && f>1)
{
for(int i=0;i<e-1;i++)
cout<<"U";
for(int j=0;j<f-1;j++)
cout<<"R";
cout<<"U"<<"RR";
for(int k=0;k... | a.cc: In function 'int main()':
a.cc:63:14: error: expected '}' at end of input
63 | return 0;
| ^
a.cc:9:1: note: to match this '{'
9 | {
| ^
|
s639574143 | p03781 | Java | import java.util.Scanner;
import java.util.ArrayList;
public class Main{
ArrayList<int[]> kangs = new ArrayList<int[]>();
public void addKang(int pos, int steps){
int[] newKang = {pos, steps};
kangs.add(newKang);
}
public void clean(){
for(int i = 0; i < kangs.size() ; i++){
... | Main.java:83: error: cannot find symbol
KangHome aussie = new KangHome();
^
symbol: class KangHome
location: class Main
Main.java:83: error: cannot find symbol
KangHome aussie = new KangHome();
^
symbol: class KangHome
location: class Main
2 errors
|
s071599218 | p03781 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int X = sc.nextInt();
int result = 0;
for(int i = 1; i <= X; i++){
if((i + 1) * i / 2 >= X){
result = i;
break;
}
}
System.out.println(result);
sc.close();
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s216425047 | p03781 | Java |
import java.util.Arrays;
import java.util.Scanner;
public class Main_070D {
MyScanner sc = new MyScanner();
Scanner sc2 = new Scanner(System.in);
long start = System.currentTimeMillis();
long fin = System.currentTimeMillis();
final int MOD = 1000000007;
int[] dx = {... | Main.java:5: error: class Main_070D is public, should be declared in a file named Main_070D.java
public class Main_070D {
^
1 error
|
s729160960 | p03781 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MAXN=1e9+7;
ll dp[MAXN];
vector<ll> dp2;
vector<ll> nextdp2;
int main(){
ll X;
cin>>X;
dp2.push_back(0);
nextdp2.push_back(0);
ll ret;ret=0;
for(ll a=1;a<=X;++a){
for (ll b=0;b<dp2.size();++b){
if (dp[dp2[b]+a]>0){
dp[dp2[b]+a]=m... | /tmp/cc6JGkAg.o: in function `main':
a.cc:(.text+0x31): relocation truncated to fit: R_X86_64_PC32 against symbol `dp2' defined in .bss section in /tmp/cc6JGkAg.o
a.cc:(.text+0x4f): relocation truncated to fit: R_X86_64_PC32 against symbol `nextdp2' defined in .bss section in /tmp/cc6JGkAg.o
a.cc:(.text+0x87): relocati... |
s389620455 | p03781 | C | #include <stdio.h>
int main() {
int i,a,n,sum=0;
// for(i=1;i<=44720;i++){
// sum+=i;
// }
// printf("%d\n",sum);
// return 0;
scanf("%d",&n);
for(i=1;i<=n;i++){
a=sum;
sum+=i;
if(n>a && n<=sum){
printf("%d\n",i);
return 0;
}... | main.c: In function 'main':
main.c:4:1: error: stray '\302' in program
4 | <U+00A0><U+00A0><U+00A0><U+00A0>int i,a,n,sum=0;
| ^~~~~~~~
main.c:4:2: error: stray '\302' in program
4 | <U+00A0><U+00A0><U+00A0><U+00A0>int i,a,n,sum=0;
| ^~~~~~~~
main.c:4:3: error: stray '\302' in program
4 |... |
s081284514 | p03781 | C++ | #include <stdio.h>
int main() {
int i,a,n,sum=0;
// for(i=1;i<=44720;i++){
// sum+=i;
// }
// printf("%d\n",sum);
// return 0;
scanf("%d",&n);
for(i=1;i<=n;i++){
a=sum;
sum+=i;
if(n>a && n<=sum){
printf("%d\n",i);
return 0;
}... | a.cc:4:1: error: extended character is not valid in an identifier
4 | int i,a,n,sum=0;
| ^
a.cc:4:1: error: extended character is not valid in an identifier
a.cc:4:1: error: extended character is not valid in an identifier
a.cc:4:1: error: extended character is not valid in an identifier
a.cc:5:1:... |
s555585913 | p03781 | C++ | #include <bits/stdc++..h>
using namespace std;
int main() {
int n, p = 0;
cin >> n;
for(int i = 1; i*(i+1) < 2*n; i++) p = i;
cout << p+1;
}
| a.cc:1:10: fatal error: bits/stdc++..h: No such file or directory
1 | #include <bits/stdc++..h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s842087766 | p03781 | C | #include <cstdio>
main()
{
int x; scanf("%d",&x);
int s = 0, ans = 0,i = 1;
while(s < x)
{
s += i++;
ans++;
}
printf("%d\n",ans);
}
| main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s938707421 | p03781 | C++ | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std;
int n;
int l[405],r[405];
int d[405][405];
int go(int now,int leftx){
if(now == n) return 0;
int &ans = d[now][leftx];
if(ans!=-1) return ans;
int rightend = leftx + r[now-1]-l[now-1];
ans = 9... | a.cc: In function 'int go(int, int)':
a.cc:23:28: error: 'rnow' was not declared in this scope; did you mean 'rnew'?
23 | if(rnew < leftx || rnow < k) continue;
| ^~~~
| rnew
|
s436443243 | p03781 | C | #include <stdio.h>
int main(){
int a;
int b=0;
scanf(%d,&a);
if(a>=0){
a=a-b;
b++;
}
printf("%d",a);
} | main.c: In function 'main':
main.c:5:15: error: expected expression before '%' token
5 | scanf(%d,&a);
| ^
|
s895783862 | p03781 | C | #include <stdio.h>
int main(){
int a;
int b=0;
scanf(%d,&a);
if(a>=0){
a=a-b;
b++;
}
printf("%d",a);
} | main.c: In function 'main':
main.c:5:15: error: expected expression before '%' token
5 | scanf(%d,&a);
| ^
|
s008861577 | p03781 | C | #include <stdio.h>
int main(){
int a;
int b=0;
scanf(%d,&a);
if(a>=0){
a=a-b;
b++;
}
} | main.c: In function 'main':
main.c:5:15: error: expected expression before '%' token
5 | scanf(%d,&a);
| ^
|
s106718827 | p03781 | C | #include <stdio.h>
int main(){
int a,b=0;
scanf(%d,&a);
if(a>=0){
a=a-b;
b++;
}
} | main.c: In function 'main':
main.c:4:15: error: expected expression before '%' token
4 | scanf(%d,&a);
| ^
|
s513453404 | p03781 | C++ | #include <bits/stdc++.h>
#define N 2006
using namespace std;
int a,b,n,t,p[N],ans[N];char c;
int ask(int x,int y)
{
printf("? %d %d\n",x,y);
fflush(stdout);
scanf("%*c%c",&c);
return c=='Y'?1:0;
}
int main()
{
scanf("%d%d",&a,&b);n=a+b;
if(a<=b)return puts("Impossible"),0;
for(int i=0;i<n;i++){
if(t){
if(as... | a.cc:23:16: warning: multi-character character constant [-Wmultichar]
23 | printf('! ');
| ^~~~
a.cc: In function 'int main()':
a.cc:23:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
23 | printf('! ');
| ^~~~
| ... |
s431662715 | p03781 | C++ | #include <stdio.h>
#include <math.h>
int getX(n) {
return n * (n+1) / 2;
}
int test(x) {
int a = (int)sqrt((int)0x7FFFFFFF);
int SUM[1000000];
SUM[0] = 0;
for(int i=1;i<a;i++) {
SUM[i] = SUM[i-1] + i;
}
for(int i=0;i<a;i++) {
if(SUM[i] >= x) {
return i;
}
}
return -1;
}
int main... | a.cc:4:10: error: 'n' was not declared in this scope; did you mean 'yn'?
4 | int getX(n) {
| ^
| yn
a.cc:8:10: error: 'x' was not declared in this scope
8 | int test(x) {
| ^
a.cc: In function 'int main()':
a.cc:30:22: error: 'test' cannot be used as a function
30... |
s873779824 | p03781 | C++ | #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif
//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f... | a.cc: In function 'int main()':
a.cc:28:9: error: reference to 'left' is ambiguous
28 | left[0][0] = right[0][0] = 1;
| ^~~~
In file included from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/... |
s937451328 | p03781 | Java | public static void main(String[] args) {
int x = 0;
Scanner s = new Scanner(System.in);
x = s.nextInt();
int t = 0;
t = s.nextInt();
int now = 0;
int ans = 0;
for(int i = t; i > 0; i--) {
if(now + t == x) {
ans++;
break;
} else if(now + t < x) {
now += t;
ans++;
}
}
System.... | Main.java:1: 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
|
s704031845 | p03781 | Java | public static void main(String[] args) {
int x = 0;
Scanner s = new Scanner(System.in);
x = s.nextInt();
int t = 0;
t = s.nextInt();
int now = 0;
int ans = 0;
for(int i = t; i > 0; i--) {
if(now + t == x) {
ans++;
break;
} else if(now + t < x) {
now += t;
ans++;
}
}
System.... | Main.java:1: 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
|
s237257010 | p03781 | Java | public static void main(String[] arg) {
int x = 0;
Scanner s = new Scanner(System.in);
x = s.nextInt();
int t = 0;
t = s.nextInt();
int now = 0;
int ans = 0;
for(int i = t; i > 0; i--) {
if(now + t == x) {
ans++;
break;
} else if(now + t < x) {
now += t;
ans++;
}
}
System.o... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] arg) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s945872189 | p03781 | Java | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
int X = scanner.nextInt() {
if (int i = 1 ; i <= X ; i++) {
for (i * (i + 1) / 2 >= X) {
System.out.println(i);
break;
}
}
}
}
} | Main.java:7: error: ';' expected
int X = scanner.nextInt() {
^
Main.java:8: error: '.class' expected
if (int i = 1 ; i <= X ; i++) {
^
Main.java:8: error: not a statement
if (int i = 1 ; i <= X ; i++) {
^
Main.java:8: error: ';' expected
if (int i = ... |
s036775412 | p03781 | C | #inculed<stdio.h>
int main (void){
int x,i,jump_cnt;
scanf("%d",&x);
for(i=0;i>x;i++){
jump_cnt=x/i;
if(jump_cnt<=i)break;
}
printf("%d\n",i);
} | main.c:1:2: error: invalid preprocessing directive #inculed; did you mean #include?
1 | #inculed<stdio.h>
| ^~~~~~~
| include
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | scanf("%d",&x);
| ^~~~~
main.c:1:1: note... |
s323475984 | p03781 | C | #inculed<stdio.h>
int main (void){
int x,i,jump_cnt;
scanf("%d"&x);
for(i=0;i>x;i++){
jump_cnt=x/i;
if(jump_cnt<=i)break;
}
printf("%d.\n"i);
} | main.c:1:2: error: invalid preprocessing directive #inculed; did you mean #include?
1 | #inculed<stdio.h>
| ^~~~~~~
| include
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | scanf("%d"&x);
| ^~~~~
main.c:1:1: note:... |
s445871271 | p03781 | C++ | #include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
#include <limits>
using namespace std;
int main() {
cin.tie(nullptr); ios::sync_with_stdio... | In file included from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long i... |
s336836974 | p03781 | C++ | #include <iostream>
using namespace std;
#define F first
#define S second
#define ios ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
ll x;
vector<int>tmp[6005];
vector<int>shel_dplft[6005];
vector<int>shel_dprt[6005];
int main() {
ll n, k;
cin >... | a.cc:8:9: error: 'vector' does not name a type
8 | typedef vector<int> vi;
| ^~~~~~
a.cc:10:1: error: 'vector' does not name a type
10 | vector<int>tmp[6005];
| ^~~~~~
a.cc:11:1: error: 'vector' does not name a type
11 | vector<int>shel_dplft[6005];
| ^~~~~~
a.cc:12:1: error: 'vector... |
s265073871 | p03781 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin>>x;
if (x<=1) cout<<"1";
else if (x<=3) cout<<"2";
else if (x<=6) cout<<"3";
else if (x<=10 cout<<"4";
else if (x<=15) cout<<"5";
else if (x<=21) cout<<"6";
else if (x<=28) cout<<"7";
else if (x<=36) cout<<"8"... | a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before 'cout'
10 | else if (x<=10 cout<<"4";
| ^~~~~
| ;
a.cc:11:5: error: expected primary-expression before 'else'
11 | else if (x<=15) cout<<"5";
| ^~~~
a.cc:10:30: error: expected ... |
s676821496 | p03781 | Java | import java.util.Scanner;
/**
* Created by paz on 17-3-18.
*/
public class Kangaroo {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
long sum = 0;
for(int i = 1; ;i++) {
sum += i;
if(sum >= x) {
... | Main.java:6: error: class Kangaroo is public, should be declared in a file named Kangaroo.java
public class Kangaroo {
^
1 error
|
s562806020 | p03781 | C | include <stdio.h>
int main(){
int x, l, r;
scanf("%d", &x);
l = 1;
r = x+1;
while(l + 1 < r){
int y = (l & r) + (l ^ r) / 2;
if((long long) y*(y+1)/2 < x) l = y+1;
r = y;
}
if((long long) l*(l+1)/2 >= x) printf("%d\n", l);
else printf("%d\n", l+1);
return 0;
}
| main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s654225369 | p03781 | C++ | #include <bits/stdc++.h> ... | a.cc:1:3781: warning: extra tokens at end of #include directive
1 | #include <bits/stdc++.h> ... |
s522614335 | p03781 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)
//#define INF (1LL<<59)
#define int ll
int main(){
int n;
cin>>n;
int c=0;
fo... | a.cc:11:13: error: '::main' must return 'int'
11 | #define int ll
| ^~
a.cc:13:1: note: in expansion of macro 'int'
13 | int main(){
| ^~~
|
s726802778 | p03781 | C++ | #include<iostream>
using namespace std;
int main(void) {
int X;
cin >> X;
cout << (int)ceil((-1 + sqrt(1 + 8.0 * X)) / 2) << endl;
system("pause");
return 0;
} | a.cc: In function 'int main()':
a.cc:8:33: error: 'sqrt' was not declared in this scope
8 | cout << (int)ceil((-1 + sqrt(1 + 8.0 * X)) / 2) << endl;
| ^~~~
a.cc:8:22: error: 'ceil' was not declared in this scope
8 | cout << (int)ceil((-1 + sqrt(1 + 8.0 * X))... |
s648845869 | p03781 | C++ | import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
public... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.Closeable;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmod... |
s282398034 | p03781 | C++ | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <comple... | a.cc: In member function 'void segtree<T, Func>::updateall(int, int)':
a.cc:174:9: error: expected ';' before '}' token
174 | }
| ^
a.cc: In constructor 'BIT<T>::BIT(int)':
a.cc:197:21: error: class 'BIT<T>' does not have any field named 'obj'
197 | BIT(int n) :obj(n + 1, 0) {}
|... |
s974643264 | p03781 | C | #!/usr/bin/env python3
x = int(input())
S = {0}
i = 0
while x not in S:
i += 1
S = S | {s - i for s in S} | {s + i for s in S}
print(i)
| main.c:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/env python3
| ^
main.c:3:1: warning: data definition has no type or storage class
3 | x = int(input())
| ^
main.c:3:1: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
main.c:3:5: error: expected expression bef... |
s493560082 | p03781 | C++ |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
MyScanner sc = new MyScanner();
Scanner sc2 = new Scanner(System.in);
long start = System.currentTimeMillis();
long fin = System.currentTimeMillis();
final int MOD = 1000000007;
int[] dx = { 1, 0... | a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Arrays;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.Scanner;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-t... |
s588943403 | p03782 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>... | a.cc: In function 'int main()':
a.cc:403:18: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
403 | int l = max(0, K - a[i] - j);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,... |
s683950992 | p03782 | C++ | #include<iostream>
#include<math.h>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<deque>
using namespace std;
int a[5000];
int bubuwa(int t);//tを省いた中で、部分和がk-a[t]以上k未満になるかどうか
int n, k;
bool dp[5001][5001];
int main() {
//B
cin >> n >> k;
int i;
for (i = 0; i < n; i++) {... | a.cc: In function 'int bubuwa(int)':
a.cc:79:9: error: 'memset' was not declared in this scope
79 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include<set>
+++ |+#include <cstr... |
s334433958 | p03782 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
bool R1[5021][5021];
bool R2[5021][5021];
int main() {
ll N,K;
cin >> N >> K;
ll a[N];
for (int i = 0; i < N; i++) {
cin >> a[i];
}
ll ans = 0;
R1[0][0] = true;
if (a[0] <= K) R1[0][a[0... | a.cc: In function 'int main()':
a.cc:93:7: error: 'n' was not declared in this scope
93 | if (n == 3) {
| ^
|
s178586198 | p03782 | C++ | #include<bits/stdc++.h>
using namespace std;
const int N=1001;
int n,k,sum;
int a[N],dp[N][N];
bool check(int x)
{
memset(dp,0,sizeof(dp));
if(x==1)
{
dp[2][0]=1;
dp[2][a[2]]=1;
for(int i=3;i<=n;i++)
{
for(int j=0;j<=k;j++)
{
dp[i][j]=d... | a.cc: In function 'int main()':
a.cc:83:23: error: 'sdgdsgdsg' was not declared in this scope
83 | printf("%d\n",lb);sdgdsgdsg
| ^~~~~~~~~
a.cc: At global scope:
a.cc:86:1: error: 'gsgsdgsdgsdgdsgdsgdsgsdgsd' does not name a type
86 | gsgsdgsdgsdgdsgdsgdsgsdgsd
| ^~~~~~~~~~~~... |
s781421139 | p03782 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[5050],b[5050],ans;
bool f[5050]={true};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n,k;
cin>>n>>k;
cin>>a[0];
b[0]=a[0];
for(int i=1;i<n;i++)
{
cin>>a[i];
b[i]=b[i-1]+a[i];
}
for(int i=0;i<n/2;i++)
{
for(int j=n;j>n/2... | a.cc: In function 'int main()':
a.cc:37:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
37 | if(f==true)
| ~^~~~~~
|
s793303180 | p03782 | C++ | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
ll a[5005], dp[5005] = { 0 };
int main() {
ll N, K;
cin >> N >> K;
for (int i = 0; i < N; ++i) {
cin >> a[i];
a[i] = min(K, a[i]);
}... | a.cc: In function 'int main()':
a.cc:23:24: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
23 | dp[j + a[i]] %= 1e16;
| ~~~~~~~~~~~~~^~~~~~~
a.cc:23:24: note: in evaluation of 'operator%=(ll {aka long long int}, double)'
a.cc:30:48: error: i... |
s050059193 | p03782 | C++ | //khodaya khodet komak kon
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimise ("ofast")
#pragma GCC optimise("unroll-loops")
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int N =... | a.cc: In function 'int32_t main()':
a.cc:36:53: error: 'cnt' was not declared in this scope; did you mean 'int'?
36 | if (sm - a[i] >= k) cnt++;
| ^~~
| int
a.cc:41:9: e... |
s467162278 | p03782 | C++ | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> a(n);
for(int i = 0; i < n; i++) {
cin >> a[i];
}
//コーナーケース
if(n == 1) {
cout << (a[i] < k) << en... | a.cc: In function 'int main()':
a.cc:15:20: error: 'i' was not declared in this scope
15 | cout << (a[i] < k) << endl;
| ^
|
s805499951 | p03782 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 6e3;
const int MAXK = 6e3;
int N, K;
ll A[MAXN];
ll pref[MAXN];
bool canReach[MAXK];
int main() {
cin >> N >> K;
for (int i = 0; i < N; i++) cin >> A[i];
sort(A, A + N);
pref[0] = 0;
for (int i = 0; i < N; i++) pref[i+1] = ... | a.cc: In function 'int main()':
a.cc:30:24: error: no matching function for call to 'max(int&, ll)'
30 | bestReach = max(bestReach, A[i]+v);
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bi... |
s984890656 | p03782 | C++ | // #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define FAST std::ios_base::sync_with_stdio(false);cin.tie(0);... | a.cc: In function 'void meowmeow321()':
a.cc:139:13: error: 'flag' was not declared in this scope
139 | if(!flag)cnt++;
| ^~~~
|
s422962198 | p03782 | C++ | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
const int N = 5005;
int dp[N][N], n, k, a[N], tmp, x, z[N];
int sol(int i, int cur)
{
if(!i || a[i-1] < x) return cur;
int &ret = dp[i][cur];
if(ret != -1) return ret;
ret = sol(i-1, cur);
if(cur + a[i] < k) return max(ret, sol(i-1, cur... | a.cc: In function 'bool check(int)':
a.cc:23:23: error: 'retur0' was not declared in this scope
23 | return z[x] = retur0;
| ^~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.