submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s209540103 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif
const int inf=1e9;
const int64_t inf64=1e18;
c... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite... |
s538431395 | p03747 | C++ | #include <vector>
#include <algorithm>
using namespace std;
long long int n, l, t, f, m, k;
vector<long long int> x[2];
vector<long long int> y;
int main(){
scanf("%lld %lld %lld", &n, &l, &t);
for(int i=0; i<n; ++i){
long long int a, b;
scanf("%lld %lld", &a, &b);
x[b-1].push_back(a);
y.push_back(((3-2*b)*... | a.cc: In function 'int main()':
a.cc:10:9: error: 'scanf' was not declared in this scope
10 | scanf("%lld %lld %lld", &n, &l, &t);
| ^~~~~
a.cc:25:33: error: 'printf' was not declared in this scope
25 | printf("%lld\n", y[(i+j+(1-2*f)*m+n)%n]);
| ... |
s002169854 | p03747 | C++ | /*
#pragma region GNUC
//https://yukicoder.me/wiki/auto_vectorization
#ifdef __GNUC__
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#endif
#pragma endregion
*/
#define _USE_MATH_DEFINES
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <sstream>
#include <algorithm>
#in... | a.cc:838:25: error: unterminated comment
838 | /*int t=T;
| ^
a.cc: In function 'void solve()':
a.cc:837:41: error: expected '}' at end of input
837 | cnt += pos[i]/L;
| ^
a.cc:836:30: note: t... |
s272789977 | p03747 | C++ | #include <iostream>
using namespace std;
struct ant {
int x;
int zekken;
};
int main() {
int N, L, T;
int antX[100000];
int antW[100000];
cin >> N >> L >> T;
for (int i = 0; i < N; ++i) {
cin >> antX[i] >> antW[i];
}
// srand(0);
// N = rand() % 100000 + 1;
// L = ran... | a.cc: In function 'int main()':
a.cc:70:5: error: 'sort' was not declared in this scope; did you mean 'short'?
70 | sort(ants, ants + N, [](const ant& x, const ant& y) { return x.zekken < y.zekken;});
| ^~~~
| short
|
s353519849 | p03747 | C++ | #include<iostream>
#include<bits/stdc++.h>
#define pq priority_queue
using namespace std;
#define MZ 1000000007
int num[200005];
int w[200005];
int n,l,t;
struct GG
{
int dis,no;
}nums[100005];
bool cmp(GG x1,GG x2)
{
return x1.dis<x2.dis;
}
int main()
{
int gg=0,gl;
int cnt=0,ct,wtf;
scanf("%d%d%d"... | a.cc: In function 'int main()':
a.cc:65:19: error: request for member 'no' in 'num[i]', which is of non-class type 'int'
65 | if(num[i].no==gg)
| ^~
a.cc:71:25: error: invalid types 'int[int]' for array subscript
71 | printf("%d\n",gg[wtf].dis);
| ... |
s111254579 | p03747 | C++ | //C
#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define MAX 100002
int n;
int l;
int t;
struct st{
int X;
int dir;
int id;
int nex(int tim){
tim %= l;
if (dir == 1){
}
else{
tim = l - tim;
}
X += tim;
X %= l;
return X;
}
};
deque<st> v;
de... | a.cc: In function 'int main()':
a.cc:130:9: error: expected primary-expression before '}' token
130 | }
| ^
|
s545029497 | p03747 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(void){
int N,T,L;
int X[100000] = {};
int W[100000] = {};
int i;
cin >> N >> L >> T;
//cout << N << L << T << endl;
for(i=0;i<N;i++){
cin >> X[i] >> W[i];
//cout << X[i] << W[i] << endl;
}
vector<in... | a.cc: In function 'int main()':
a.cc:46:5: error: 'sort' was not declared in this scope; did you mean 'short'?
46 | sort(v.begin(), v.end());
| ^~~~
| short
a.cc:47:38: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
47 | vec... |
s904726573 | p03747 | C++ | #include <iostream>
#include <vector>
using namespace std;
struct Ant {
int X;
int W;
};
int mod2L(int n, int L) {
return (n + L * 2) % (L * 2);
}
int main() {
int N, L, T;
cin >> N >> L >> T;
int tog = 0;
vector<vector<int>> A(L * 2);
fill(A[0].begin(), A[0].end(), 0);
fill(A[1].begin(), A[1].end... | a.cc: In function 'int main()':
a.cc:28:5: error: 'A1' was not declared in this scope; did you mean 'A'?
28 | A1[X * 2] = W;
| ^~
| A
a.cc:41:21: error: too few arguments to function 'int mod2L(int, int)'
41 | int jj = mod2L(j);
| ~~~~~^~~
a.cc:10:5: note: declar... |
s958380570 | p03747 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
namespace lib
{
template<std::uint64_t Mod>struct modnum;
template<class T>constexpr T pow(T base, std::size_t p)
{
if (p == 0)
{
return T(1);
}
else if (p == 1)
{
... | a.cc:12:18: error: 'std::uint64_t' has not been declared
12 | template<std::uint64_t Mod>struct modnum;
| ^~~
a.cc:36:18: error: 'std::uint64_t' has not been declared
36 | template<std::uint64_t Mod>constexpr auto inverse(modnum<Mod> const&);
| ^~~
a.c... |
s186002195 | p03747 | C++ | left.push_back
| a.cc:1:9: error: 'left' does not name a type
1 | left.push_back
| ^~~~
|
s106190270 | p03747 | C++ | #include <iostream>
#include <stdlib.h>
#define FOR(i,a,b) for(long long i = (a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
x#define debug(x) cout << #x << " = " << x << endl;
#define N 100001
using namespace std;
pair <int,int> ant[N];
int loc[N];
int main(void){
int n,l,t;
cin >> n >> l >> t;
REP(i,n)... | a.cc:6:2: error: stray '#' in program
6 | x#define debug(x) cout << #x << " = " << x << endl;
| ^
a.cc:6:27: error: stray '#' in program
6 | x#define debug(x) cout << #x << " = " << x << endl;
| ^
a.cc:6:1: error: 'x' does not name a type
6 | x#define debug(x) cout << ... |
s148314275 | p03747 | C++ | int main(void){
llint N,L,T,i,j,a,b;
vector<llint> ant;
vector<llint> muki;
vector<llint> gont;
scanf("%lld %lld %lld",&N,&L,&T);
gont.resize(N);
for(i=0;i<N;i++){
scanf("%lld %lld",&a,&b);
ant.pub(a);
muki.pub(b);
}
if(muki[0]==1){
a=1;b=0;j=0;//aはアリ bは答え jは周回
while(-1){
if(ant[0]+2*T<=ant[a]+j*L... | a.cc: In function 'int main()':
a.cc:2:9: error: 'llint' was not declared in this scope; did you mean 'int'?
2 | llint N,L,T,i,j,a,b;
| ^~~~~
| int
a.cc:3:9: error: 'vector' was not declared in this scope
3 | vector<llint> ant;
| ^~~~~~
a.cc:3:23: error:... |
s533450371 | p03747 | C++ | #include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se... | a.cc: In function 'int main()':
a.cc:48:35: error: expected ')' before ';' token
48 | for(int i=n-1; (i>=0)&&(x[i]>q; i--) if(w[i]==1) cnt++;
| ~ ^
| )
|
s698022359 | p03747 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
const int N = 300011;
typedef long long intl;
int s[N], d[N];
int e[N];
pair <int, int> p[N];
int ans[N];
int main()
{
ios :: sync_with_stdio(false);
int n, m;
intl t;
cin >> n >> m >> t;
for(int i = 0; i < n; i ++... | a.cc:48:35: warning: missing terminating ' character
48 | cout << ans[i] << '\n‘;
| ^
a.cc:48:35: error: missing terminating ' character
48 | cout << ans[i] << '\n‘;
| ^~~~~
a.cc: In function 'int main(... |
s040782960 | p03748 | C++ | #include <bits/stdc++.h>
using namespace std;
inline int read()
{
int x=0,f=1,c=getchar();
while(c<48) c=='-'&&(f=-1),c=getchar();
while(c>47) x=x*10+c-'0',c=getchar();
return x*f;
}
const int MAXN = 5005;
const int mod = 1e9+7;
int f[MAXN][MAXN];
int n,m;
inline int dp(int x,int y,int ret=0)
{
memset(f,0,sizeo... | a.cc:33:28: error: stray '`' in program
33 | n=read(); m=read();`
| ^
|
s122759643 | p03748 | C++ | #include <bits/stdc++.h>
using namespace std;
constexpr int mod = 1000000007;
using ll = long long;
// return a^n % mod
ll mod_pow(ll a, ll n) {
if(n == 0) return 1;
ll ret = 0;
ll tmp = a;
while(n > 0) {
if(n % 2) {
ret += tmp;
ret %= mod;
}
tmp = tmp * ... | a.cc: In function 'int main()':
a.cc:45:25: error: wrong number of template arguments (0, should be at least 1)
45 | vector<vector<vector<>> dp(m + 1, vector<vector<int>>(n + 1, vector<int>(2, 0)));
| ^
In file included from /usr/include/c++/14/vector:66,
from /usr/... |
s748276040 | p03748 | C++ | #include<bits/stdc++.h>
#define mo 1000000007
using namespace std;
long long n,m,i,j,k,ans,f[3005][3005][2];
int main(){
cin >> n >> m;
f[0][0][1]=1;
for(i=1;i<=n;i++)
f[0][i][0]=1;
for(i=1;i<=m;i++)
for(j=0;j<=n;j++)
for(k=0;k<=1;k++){
if(j!=0){
f[i][j][k|(j==1)]=(f[i][j][k|(j... | a.cc: In function 'int main()':
a.cc:24:9: error: 'pus' was not declared in this scope; did you mean 'puts'?
24 | pus(ans,2);
| ^~~
| puts
|
s866424770 | p03748 | C++ | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <iostream>
#include <vector>
#include <algorithm>
#include <assert.h>
#include <string>
#include <stdio.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull... | a.cc: In function 'void solve()':
a.cc:57:9: error: 'memset' was not declared in this scope
57 | memset(dp[nxt], 0, sizeof dp[nxt]);
| ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <assert.h>
+++ |+#i... |
s080515930 | p03748 | C++ | #include "bits/stdc++.h"
#define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = std::int_fast64_t;
using P = pair<ll, ll>;
constexpr ll inf = 1000000000;
constexpr ll mod = 1000000007;
constexpr long doubl... | a.cc:187:6: error: stray '#' in program
187 | }#include <iostream>
| ^
a.cc: In function 'int main()':
a.cc:187:7: error: 'include' was not declared in this scope
187 | }#include <iostream>
| ^~~~~~~
a.cc:187:24: error: expected primary-expression before '>' token
187 | }#includ... |
s963558099 | p03748 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <math.h>
#include <set>
#define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = std::int_fast64_t;
using P = pair<ll, ll>;
constexpr ll inf = ... | a.cc:191:6: error: stray '#' in program
191 | }#include <iostream>
| ^
a.cc:11:17: error: 'int_fast64_t' in namespace 'std' does not name a type
11 | using ll = std::int_fast64_t;
| ^~~~~~~~~~~~
a.cc:12:16: error: 'll' was not declared in this scope
12 | using P = pair<ll, l... |
s015812080 | p03748 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG_MODE
#define DBG(n) n;
#else
#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << end... | a.cc: In function 'int main()':
a.cc:48:81: error: cannot bind non-const lvalue reference of type 'll&' {aka 'long long int&'} to a value of type 'int'
48 | seica_add(dp[i+1][j-1][1],dp[i][j][k]);
| ... |
s999995958 | p03748 | C++ | l#include<bits/stdc++.h>
typedef long long ll;
const ll N = 3010;
const ll moder = 1e9 + 7;
ll dp[N][N << 1];
ll &getdp(ll i, ll j){
return dp[i][j + N];
}
void add(ll &a, ll b){
a += b;
a -= a >= moder ? moder : 0;
a += a < 0 ? moder : 0;
}
void addmult(ll &a, ll b, ll c){
a = (a + 1ll * b * ... | a.cc:1:2: error: stray '#' in program
1 | l#include<bits/stdc++.h>
| ^
a.cc:1:1: error: 'l' does not name a type
1 | l#include<bits/stdc++.h>
| ^
a.cc:5:7: error: 'll' does not name a type
5 | const ll N = 3010;
| ^~
a.cc:6:7: error: 'll' does not name a type
6 | const ll moder ... |
s459825522 | p03748 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int n,m;
int dp[2][3010][2];
int ans;
const int md=1e9+7;
void add(int &a,int b)
{
a+=b;
if(a>=md)a-=md;
}
int main()
{
scanf("%d%d",&n,&m);
for(int i=0;i<=n;i++)dp[0][i][0]=1;
for(int i=1;i<=m;i++)
{
int ii=i&1;
memset(dp[ii],0,sizeof(dp[ii]));
for(i... | a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
20 | memset(dp[ii],0,sizeof(dp[ii]));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cstdio>
... |
s420056184 | p03748 | C++ | At least 50 characters
At least 50 characters
At least 50 characters
At least 50 characters
At least 50 characters
At least 50 characters
At least 50 characters | a.cc:1:1: error: 'At' does not name a type
1 | At least 50 characters
| ^~
|
s796017409 | p03748 | C++ | #include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int N, M;
vector<vector<vector<int> > > cc;
int dp(int m, int r, int z) {
int &ret = cc[m][r][z];
if(ret != -1) return ret;
if(m == 0) return ret = z | (r == 0);
ret = 2 * dp(m - 1, r, z | (r == 0)) % mod;
if(r != 0) ret = ... | a.cc: In function 'int main()':
a.cc:25:5: error: 'll' was not declared in this scope
25 | ll ans = 0;
| ^~
a.cc:27:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
27 | ans += dp(M, i, 0);
| ^~~
| abs
a.cc:30:5: error: 'ans' was not declared in... |
s404605118 | p03749 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long signed int LL;
typedef long long unsigned int LU;
#define incID(i, l, r) for(int i = (l) ; i < (r); i++)
#define incII(i, l, r) for(int i = (l) ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) fo... | a.cc: In function 'int main()':
a.cc:185:34: error: invalid operands of types 'LL' {aka 'long long int'} and 'double' to binary 'operator%'
185 | cout << c[0][0].getval() % (1e9 + 7) << endl;
| ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
| | |
| ... |
s166261848 | p03749 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long signed int LL;
typedef long long unsigned int LU;
#define incID(i, l, r) for(int i = (l) ; i < (r); i++)
#define incII(i, l, r) for(int i = (l) ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) fo... | a.cc: In function 'int main()':
a.cc:185:25: error: no match for 'operator%' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<ModInt<> >, ModInt<> >::value_type' {aka 'ModInt<>'} and 'int')
185 | cout << c[0][0] % (1'000'000'007) << endl;
In file included from /usr/include/c++/14/valarray:605,
... |
s745735888 | p03749 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long signed int LL;
typedef long long unsigned int LU;
#define incID(i, l, r) for(int i = (l) ; i < (r); i++)
#define incII(i, l, r) for(int i = (l) ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) fo... | a.cc: In function 'int main()':
a.cc:185:25: error: no match for 'operator%' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<ModInt<> >, ModInt<> >::value_type' {aka 'ModInt<>'} and 'double')
185 | cout << c[0][0] % (1e9 + 7) << endl;
In file included from /usr/include/c++/14/valarray:605,
... |
s925576622 | p03749 | C++ | 10 9
1 2 3 4 5 6 7 8 9 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 9
| ^~
|
s449439612 | p03749 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<iostream>
const long long mod=1000000007;
using namespace std;
long long pos[100003];
long long n,m;
struct node{
long long x[3][3];
inline void operator *=(const node &a){
long long c[3][3]={0};
for(int i=0;i<=2;i++... | a.cc: In member function 'void node::operator*=(const node&)':
a.cc:18:80: error: expected ';' before 'mod'
18 | c[i][j]=(c[i][j]+x[i][k]*a.x[k][j]%mod)mod;
| ^~~
|
s611451557 | p03749 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long giant;
inline char nchar() {
static const int bufl=1<<20;
static char buf[bufl],*a=NULL,*b=NULL;
return a==b && (b=(a=buf)+fread(buf,1,bufl,stdin),a==b)?EOF:*a++;
}
inline int read() {
int x=0,f=1;
char c=nchar();
for (;!isdigit(c);c=nchar()) if (c=='... | a.cc: In function 'int main()':
a.cc:70:37: error: no matching function for call to 'generate_n(int*, int&, <unresolved overloaded function type>)'
70 | n=read(),m=read(),generate_n(c+1,m,read);
| ~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
... |
s359295276 | p03749 | C++ | #include <stdio.h>
const long long mod = 1000000007;
struct mat {
long long a[3][3];
mat operator -(mat t) {
mat r;
for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++){
r.a[i][j] = (a[i][j] + mod - t.a[i][j]) % mod;
}
return r;
}
mat operator *(mat t){
mat r;
for (int i = 0; i < 3; i++) for (... | a.cc: In function 'int main()':
a.cc:59:44: error: cannot bind non-const lvalue reference of type 'mat&' to an rvalue of type 'mat'
59 | D[i] = get(pow(base, X[i]) - sum);
| ~~~~~~~~~~~~~~~~^~~~~
a.cc:44:20: note: initializing argument 1 of 'long long int get(mat&)'... |
s692836369 | p03749 | C++ | #include <stdio.h>
const long long mod = 1000000007;
struct mat {
long long a[3][3];
mat operator -(const mat& t) const {
mat r;
for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++){
r.a[i][j] = (a[i][j] + mod - t.a[i][j]) % mod;
}
return r;
}
mat operator *(const mat& t) const {
mat r;
for (i... | a.cc: In function 'int main()':
a.cc:59:44: error: cannot bind non-const lvalue reference of type 'mat&' to an rvalue of type 'mat'
59 | D[i] = get(pow(base, X[i]) - sum);
| ~~~~~~~~~~~~~~~~^~~~~
a.cc:44:20: note: initializing argument 1 of 'long long int get(mat&)'... |
s339412427 | p03749 | C++ | // This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using ... | a.cc:48:18: warning: overflow in conversion from 'long long int' to 'LL' {aka 'int'} changes value from '2305843009213693952' to '0' [-Woverflow]
48 | const LL Linf=1ll<<61;
| ~~~^~~~
a.cc: In function 'int main()':
a.cc:102:24: error: lvalue required as left operand of assignment
102 | ... |
s270364205 | p03750 | C++ | #include <cstring>
#include <utility>
#include <cstdio>
#include <queue>
std::priority_queue<std::pair<int, int> > que;
int a[100005], b[100005], c[100005], pre[100005], lst[100005];
int ans[100005], flg[100005];
bool up[100005];
int main()
{
// freopen("AGC013-F.in", "r", stdin);
memset(lst, -1, sizeof(lst));
int n... | a.cc: In function 'int main()':
a.cc:20:14: error: 'sort' is not a member of 'std'
20 | std::sort(c + 1, c + n + 2);
| ^~~~
|
s619256912 | p03750 | C++ | #include<set>
#include<map>
#include<deque>
#include<queue>
#include<stack>
#include<cmath>
#include<ctime>
#include<bitset>
#include<string>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<complex>
#include<iostream>
#include<algorithm>
#define ll long long
#define inf ... | a.cc: In function 'int main()':
a.cc:53:28: error: narrowing conversion of '1.000000001e+9' from 'double' to 'int' [-Wnarrowing]
53 | S.insert((node){inf+1,n+1});
| ^
|
s714626090 | p03750 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In function 'void solve()':
a.cc:72:9: error: 'asert' was not declared in this scope; did you mean 'assert'?
72 | asert(N*Q<=1000000);
| ^~~~~
| assert
a.cc: In instantiation of 'V BIT<V, ME>::add(int, V) [with V = int; int ME = 20]':
a.cc:33:19: required from here
33 |... |
s478234046 | p03750 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
using namespace std;
typedef long long LL;
const int N=2e5;
int gi() {
int w=0;bool q=1;char c=getchar();
while ((c<'0'||c>'9') && c!='-') c=getcha... | a.cc: In function 'int main()':
a.cc:40:25: error: reference to 'next' is ambiguous
40 | next[i]=head[a[i]-1],head[a[i]-1]=i;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s194599255 | p03751 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n,k;cin>>n>>k;
vector<long long> A(n);for(int i = 0; n > i; i++)cin>>A[i];
long long ans = 1000000000000000LL;
for(int bit = 0; (1<<(n-1)) > bit; bit++){
if(__builtin_popcount(bit)+1 != k)continue;
long long he = A[0];
long l... | a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s142527901 | p03751 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <utility>
#include <algorithm>
#define llint long long
#define inf 1000000000000LL
using namespace std;
typedef pair<string, llint> P;
llint n;
string s[10005];
string t;
vector<P> vec;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n... | a.cc: In function 'int main()':
a.cc:57:10: error: redeclaration of 'std::string T'
57 | string T = t;
| ^
a.cc:34:10: note: 'std::string T' previously declared here
34 | string T = t;
| ^
|
s891919306 | p03751 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <utility>
#define llint long long
#define inf 1000000000000LL
using namespace std;
typedef pair<string, llint> P;
llint n;
string s[100005];
string t;
vector<P> vec;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for(int i = 1; i... | a.cc: In function 'int main()':
a.cc:38:3: error: 'sort' was not declared in this scope; did you mean 'short'?
38 | sort(vec.begin(), vec.end());
| ^~~~
| short
|
s515713102 | p03751 | C++ | #include <iostream>
using namespace std;
int main(){
int n;cin>>n;
string a[n];
for(int i = 0; n > i; i++){
cin>>a[i];
}
//上にしかいない、下にしかいないを探す
string m;cin>>m;
int uponly = 0;
int downonly = 0;
for(int i = 0; n > i; i++){
bool up = false;
bool down = false;
if(a[i]==a[j]){
up = tr... | a.cc: In function 'int main()':
a.cc:16:16: error: 'j' was not declared in this scope
16 | if(a[i]==a[j]){
| ^
|
s940073026 | p03751 | C++ | #include <iostream>
using namespace std;
int main(){
int n;cin>>n;
string a[n];
for(int i = 0; n > i; i++){
cin>>a[i];
}
//上にしかいない、下にしかいないを探す
string m;cin>>m;
int uponly = 0;
int dwnonly = 0;
for(int i = 0; n > i; i++){
bool up = false;
bool down = false;
if(a[i]==a[j]){
up = tru... | a.cc: In function 'int main()':
a.cc:16:16: error: 'j' was not declared in this scope
16 | if(a[i]==a[j]){
| ^
a.cc:32:21: error: invalid types 'int[int]' for array subscript
32 | if(a[i][j]>n[j]){
| ^
a.cc:35:29: error: invalid types 'int[int]' for array... |
s721919099 | p03751 | C++ | #include<iostream>
#include<vector>
#include<cstring>
#include<queue>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstdlib>
#include <math.h>
using namespace std;
char s[10001][30],s1[30];
int ans[10000],len,kk=0,n;
int strcmp1(const char *str1,const char *str2)
{
if(*str1=='?'&&*str2!='z')
re... | a.cc: In function 'int main()':
a.cc:63:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
63 | gets(s1);
| ^~~~
| getw
|
s125947868 | p03751 | C++ | #include <bits/stdc++.h>
using namespace std;
string s[10001], smin[10001], smax[10001], target;
int strict, pos, n;
int main(){
cin>>n;
for(int i=0; i<n; i++){
cin>>s[i];
smin[i]=s[i];
smax[i]=s[i];
for(int j=0; j<s[i].size(); j++){
if(s[i][j]=='?')smin[i][j]='... | a.cc: In function 'int main()':
a.cc:31:20: error: 'i' was not declared in this scope
31 | cout << strict+i+pos;
| ^
|
s635107086 | p03751 | C | #include<stdio.h>
char s[10000][21],t[21];
int main(int argc, char const *argv[]){
int n,a=0,b=0,i,j,bf,nf;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",s[i]);
}
scanf("%s",t);
for(i=0;i<n;i++){
af=1;
bf=1;
for(j=0;j<20;j++){
if(s[i][j]=='\0'){
if(t[j]!='\0'){
if(af) a++;
}
break;
}... | main.c: In function 'main':
main.c:11:17: error: 'af' undeclared (first use in this function); did you mean 'nf'?
11 | af=1;
| ^~
| nf
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
|
s277842832 | p03751 | C++ | #include<iostream>
using namespace std;
#include<algorithm>
#include<vector>
bool c(string a,string b)
{
for(int i=0;i<a.size();i++)a[i]=='?'&&(a[i]='z');
return b<=a;
}
bool d(string a,string b)
{
for(int i=0;i<a.size();i++)a[i]=='?'&&(a[i]='a');
return a<=b;
}
main()
{
vector<string>a;int n;cin>>n;
string t;
f... | a.cc:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
15 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:30:52: error: expected ';' before 'ans'
30 | if(d(a[i],t)&&(i==n-1||c(a[i+1],t))ans.push_back(i+2);
| ... |
s590935108 | p03751 | C++ | #include <bits/stdc++.h>
using namespace std;
string s[10001], smin[10001], smax[10001], target;
int strict, pos, n;
int main(){
cin>>n;
for(int i=0, i<n; i++){
cin>>s[i];
smin[i]=s[i];
smax[i]=s[i];
for(int j=0; j<s[i].size(); j++){
if(s[i][j]=='?')smin[i][j]='a';
if(s[i][j]=='?')smax[i][j]='z';
}
}
cin>>target;
fo... | a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before '<' token
10 | for(int i=0, i<n; i++){
| ^
| ;
a.cc:10:15: error: expected primary-expression before '<' token
a.cc:20:15: error: expected ';' before '<' token
20 | for(int i=0, i<n; i++){
| ... |
s962962544 | p03751 | C++ | #include <vector>
#include <string.h>
#include<iostream>
#include<set>
#include<map>
#include<unordered_map>
#include<string.h>
#include<algorithm>
#include <stdlib.h>
#include<queue>
using namespace std;
int main(){
int n;
int before=0,after=0i, ambiguous=0;
cin>>n;
vector<string>vec(n);
for(in... | a.cc: In function 'int main()':
a.cc:18:24: error: cannot convert '__complex__ int' to 'int' in initialization
18 | int before=0,after=0i, ambiguous=0;
| ^~
|
s704167684 | p03751 | C++ | #include <iostream>
#include <cstring>
#define offcin ios::sync_with_stdio(false)
using namespace std;
const int maxn = 1e4 + 5;
string s[maxn], a[maxn], b[maxn];
int main(int argc, const char * argv[]) {
offcin;
int N;
cin>>N;
for (int i = 1; i <= N; i ++) {
cin>>s[i];
long... | a.cc: In function 'int main(int, const char**)':
a.cc:25:5: error: 'sort' was not declared in this scope; did you mean 'short'?
25 | sort(a + 1, a + N + 1);
| ^~~~
| short
|
s121472744 | p03751 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s[n];
for (int i = 0; i < n; i++) {
cin >> s[i];
}
string t;
cin >> t;
sort(s.begin(), s.end());
for (int i = 0; i < n; i++) {
if (t < s[i]) {
cout << i + 1 << endl;
... | a.cc: In function 'int main()':
a.cc:13:12: error: request for member 'begin' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'}
13 | sort(s.begin(), s.end());
| ^~~~~
a.cc:13:23: error: request for member 'end' in 's', which is of non-class type 's... |
s974244420 | p03751 | C++ | #include <bits/stdc++.h>
using namespace std;
int n;
string s[100010], t;
int main()
{
cin >> n;
for(int i = 1; i <= n; i ++)
cin >> s[i];
cin >> t;
int ansl = 1, ansr = 1;
for(int i = 1; i <= n; i ++)
{
bool L = 0, R = 0;
string x = s[i];
for(int j = 0; j < x.size(); j ++)
if(s[i][j] == '?') x[j] = ... | a.cc: In function 'int main()':
a.cc:27:35: error: 'r' was not declared in this scope
27 | cout<<i<<" \n"[i==r];
| ^
|
s730486901 | p03751 | C++ | #include <bits/stdc++.h>
#define
using namespace std;
int n;
string s[100010], t;
int main()
{
cin >> n;
for(int i = 1; i <= n; i ++)
cin >> s[i];
cin >> t;
int ansl = 1, ansr = 1;
for(int i = 1; i <= n; i ++)
{
bool L = 0, R = 0;
string x = s[i];
for(int j = 0; j < x.size(); j ++)
if(s[i][j] == '?... | a.cc:2:9: error: no macro name given in #define directive
2 | #define
| ^
|
s099949644 | p03751 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin(... | a.cc: In function 'int main()':
a.cc:41:34: error: request for member 'size' in 's', which is of non-class type 'std::string [10010]' {aka 'std::__cxx11::basic_string<char> [10010]'}
41 | rep(i, s.size()){
| ^~~~
a.cc:7:33: note: in definition of macro '... |
s584414021 | p03751 | C++ | import java.util.Scanner;
public class Main {
static boolean win(StringBuilder a, StringBuilder b){
StringBuilder c = new StringBuilder(a);
StringBuilder d = new StringBuilder(b);
for(int i=0; i<c.length(); i++){
if(c.charAt(i) == '?') c.setCharAt(i, 'a');
}
for(int i=0; i<d.length(); i++){
if(d.charA... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
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 {
| ^~~~~~
|
s554951685 | p03751 | C++ | #include<stdio.h>
#include<string.h>
int main (){
char moji[10003][21],s[10003][21],tmp[21];
int n,i,j,a;
scanf("%d",&n) ;
for(i=0;i<n+1;i++){
scanf("%s",moji[i]);
}
a=n;
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
if(strcmp(moji[j-1], moji[j])>0){
strcpy(tmp, moji[j-1]);
strcpy(moji[j-1], moji[j]);
strcpy(moji[j], tmp);
if ... | a.cc: In function 'int main()':
a.cc:24:4: error: expected '(' before 'else'
24 | if else break;
| ^~~~
| (
|
s438064014 | p03751 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<int, int> pi;
bool win(string a, string b){
for(auto &i : a) if(i == '?') i = 'a';
for(auto &i : b) if(i == '?') i = 'z';
return a <= b;
}
int n;
string a, b[10005];
int main(){
cin >> n;
for(int i=0; i<n... | a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
28 | }
| ^
a.cc:16:11: note: to match this '{'
16 | int main(){
| ^
|
s618425134 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rrep(i,n) for (int i = 1; i <= (n); i++)
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
int main(){
ll n,k;
cin >> n >> k;
ll a[n];
rep(i,n) cin >> a[i... | a.cc: In function 'int main()':
a.cc:20:15: error: 'j' was not declared in this scope
20 | if(bit>>j&1) s.push_back(i);
| ^
|
s974348388 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rrep(i,n) for (int i = 1; i <= (n); i++)
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
int main(){
ll n,k;
cin >> n >> k;
ll a[n];
rep(i,n) cin >> a[i... | a.cc: In function 'int main()':
a.cc:20:15: error: 'j' was not declared in this scope
20 | if(bit>>j&1) s.push_back(i);
| ^
|
s259293708 | p03752 | Java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
//int t = sc.nextInt();
//while(t-- > 0)
solve();
out.close();
}
private static void solve() {
//String s = sc.next();
int n = sc.nextInt();
int kk = sc.nextInt();
... | Main.java:394: error: class, interface, enum, or record expected
}import java.io.*;
^
Main.java:395: error: class, interface, enum, or record expected
import java.util.*;
^
2 errors
|
s020849782 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define all(v) begin(v),end(v)
using ll = long long;
int main() {
| a.cc: In function 'int main()':
a.cc:7:13: error: expected '}' at end of input
7 | int main() {
| ~^
|
s396003396 | p03752 | C | #include<bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long dp[100010];
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
long lo... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s372253551 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
int main() {
ll n,k;
cin >> n >> k;
vector<ll>a(n);
for(ll i=0;i<n;i++){
cin >> a[i];
}
ll ans=1e15;
for(ll i=0;i<(1<<n);i++){
ll cost=0;
ll mh=0;
ll num=0;
vecto... | a.cc: In function 'int main()':
a.cc:20:26: error: no matching function for call to 'max(int, ll)'
20 | cost+=max(0,mh+1-b[j]);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++... |
s659502087 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
int main() {
ll n,k;
cin >> n >> k;
vector<ll>a(n);
for(ll i=0;i<n;i++){
cin >> a[i];
}
ll ans=1e15;
for(ll i=0;i<(1<<n);i++){
ll cost=0;
ll mh=0;
ll num=0;
vecto... | a.cc: In function 'int main()':
a.cc:19:18: error: no match for 'operator&' (operand types are 'std::vector<long long int>' and 'int')
19 | if(b & (1<<i)){
| ~ ^ ~~~~~~
| | |
| | int
| std::vector<long long int>
I... |
s486078590 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void chmin(ll& a, ll b) {
if (a > b) a = b;
}
int main() {
int N, K;
cin >> N >> K;
vector<ll> a(N);
for (int i = 0; i < N; i++) {
cin >> a[i];
}
// i番目までで最も高いもの
vector<ll> height(N);
height[0] = 0;
height[1] = a[0];... | a.cc: In function 'int main()':
a.cc:47:28: error: expected ';' before 'continue'
47 | if (!(bit & (1 << 0)) continue;
| ^~~~~~~~~
| ;
a.cc:49:7: error: expected primary-expression before 'if'
49 | if (bit & (1 << i)) {
| ^~... |
s694552120 | p03752 | C++ | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
typedef long long ll;
vector<int> v;
ll dfs(ll i, ll N, ll K, ll *a, ll m) {
if (i == N) {
if (v.size() < K)
return 999999999999;
return 0;
}
ll ans;
if (a[i] <= m) {
v.push_ba... | a.cc: In function 'll dfs(ll, ll, ll, ll*, ll)':
a.cc:30:19: error: no matching function for call to 'std::vector<int>::pop_back(ll&)'
30 | v.pop_back(i);
| ~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:132... |
s908297210 | p03752 | C++ | include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int main(){
int n,k;
cin >> n >> k;
vector<ll> a(n);
for(int i=0; i<n; i++) cin >> a[i];
ll ans=1e18;
for(int bit = 0; bit<(1<<n-1); bit++){
if(__builtin_popcount(bit) != k-1) continue;
ll s=0;
... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s997966211 | p03752 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
#include<map>
#include<stack>
#include<set>
#include<tuple>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ll> pll;
const int INF=1e18;
const ll... | a.cc:17:15: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
17 | const int INF=1e18;
| ^~~~
a.cc: In function 'int main()':
a.cc:55:18: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long... |
s488688900 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,K;
cin >> N >> K;
int A[N];
for (int i=0; i<N; i++) {
cin >> A[i];
}
cout << total << endl;
for (int tmp=0; tmp<(1<<15); tmp++) {
bitset<15> s(tmp);
int B[K],C[N],count=0;
if (!s.test(count)) continue;
... | a.cc: In function 'int main()':
a.cc:11:12: error: 'total' was not declared in this scope
11 | cout << total << endl;
| ^~~~~
|
s600322014 | p03752 | C++ | #include <bits/stdc++.h>
#include <math.h>
#include <cmath>
using namespace std;
using ll =long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vs = vector<string>;
using vvs = vector<vs>;
using vc = vector<char>;
using vvc = vector<vc>;
using vb = vecto... | a.cc:151:6: error: redefinition of 'bool is_int_lround(double)'
151 | bool is_int_lround(double x){
| ^~~~~~~~~~~~~
a.cc:27:6: note: 'bool is_int_lround(double)' previously defined here
27 | bool is_int_lround(double x){
| ^~~~~~~~~~~~~
a.cc:154:4: error: redefinition of 'll keta(ll)'
154 |... |
s175502532 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
int N, K;
vector<ll> A;
void solve(){
ll m = 1e+10;
ll height = A[0];
if(N == K){
ll cost = 0;
for (int i = 1; i < N; i++){
ll dif = height - A[i];
if(dif >= 0){
... | a.cc: In function 'void solve()':
a.cc:34:20: error: wrong number of template arguments (0, should be 1)
34 | bitset<> bs(b);
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bitset:804:11: note: pr... |
s933958887 | p03752 | C++ | #include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#defi... | a.cc: In function 'int main()':
a.cc:41:8: error: 'bitset' was not declared in this scope
41 | if(bitset<16>(i).count() != K or
| ^~~~~~
a.cc:11:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
10 | #include<iomanip>
+++ |+#include <... |
s228305968 | p03752 | C++ | #include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#defi... | a.cc: In function 'int main()':
a.cc:41:8: error: 'bitset' was not declared in this scope
41 | if(bitset<16>(i).count() != K or
| ^~~~~~
a.cc:11:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
10 | #include<iomanip>
+++ |+#include <... |
s861198318 | p03752 | C++ |
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#d... | a.cc: In function 'int main()':
a.cc:34:12: error: 'cin' was not declared in this scope
34 | ll N, K; cin >> N >> K;
| ^~~
a.cc:11:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
10 | #include<iomanip>
+++ |+#include <iostream>
... |
s789298393 | p03752 | C++ | #include<bits/stdc++.h>
using namespace std;
int64_t f(vector<int64_t>a,int64_t k){
int N=a.size();
if(N<k)
return 200000000000;
else if(k==1){
return 0;
}else {
if(a.at(0)<a.at(1)){
a.erase(a.begin());
return f(a,k-1);
}else{
int t=a.at(0)+1-a.at(1);
a.erase(a.begin());
a.erase(a.begin())... | a.cc: In function 'int main()':
a.cc:29:17: error: could not convert 'a' from 'vector<int>' to 'vector<long int>'
29 | int64_t ans=f(a,K);
| ^
| |
| vector<int>
|
s403710025 | p03752 | C++ | #include<bits/stdc++.h>
using namespace std;
int64_t f(vector<int64_t>a,int64_t k){
int N=a.size();
if(N<k)
return 200000000000;
else if(k==1){
return 0;
}else {
if(a.at(0)<a.at(1)){
a.erase(a.begin());
return f(a,k-1);
}else{
int t=a.at(0)+1-a.at(1);
a.erase(a.begin());
a.erase(a.begin())... | a.cc: In function 'int main()':
a.cc:29:13: error: could not convert 'a' from 'vector<int>' to 'vector<long int>'
29 | int ans=f(a,K);
| ^
| |
| vector<int>
|
s774853047 | p03752 | C++ | #include<bits/stdc++.h>
using namespace std;
int f(vector<int>a,int k){
int N=a.size();
if(N<k)
return 20000000000;
else if(k==1){
return 0;
}else {
if(a.at(0)<a.at(1){
a.erase(a.begin());
return f(a,k-1);
}else{
int t=a.at(0)+1-a.at(0);
a.erase(a.begin());
a.erase(a.begin());
return m... | a.cc: In function 'int f(std::vector<int>, int)':
a.cc:6:10: warning: overflow in conversion from 'long int' to 'int' changes value from '20000000000' to '-1474836480' [-Woverflow]
6 | return 20000000000;
| ^~~~~~~~~~~
a.cc:10:21: error: expected ')' before '{' token
10 | if(a.at(0)<a.at(1){
... |
s913264216 | p03752 | C++ | #include<bits/stdc++.h>
using namespace std;
const long long int INF = 1000000000000000000;
int main(){
int N, K;
cin >> N >> K;
long long int a[N];
for (int i = 0; i < N; i++)
{
cin >> a[i];
}
long long int ans = INF;
if(K <= 1) ans = 0;
for (int bit = 0; bit < (1 << (N-1)... | a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s750239336 | p03752 | C++ | int main() {
int n,k;
cin>>n>>k;
ll a[n];
ll ok=0,temp1=0,temp1in=0;
rep(i,n) cin>>a[i];
rep(i,n){
if(temp1<a[i]) ok++,temp1=a[i];
else break;
}
if(k<=ok){
cout<<0<<endl;
return 0;
}
ll ans=1000000000000000;
for(ll bit=0;bit<(1<<(n-ok));bit++){
ll cansee=0;
fo... | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin>>n>>k;
| ^~~
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll a[n];
| ^~
a.cc:5:5: error: expected ';' before 'ok'
5 | ll ok=0,temp1=0,temp1in=0;
| ^~~
| ;
a.cc:... |
s097782493 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
lli bitCnt(lli now){
lli... | a.cc: In function 'int main()':
a.cc:41:28: error: 'bit' was not declared in this scope
41 | if(bit&(1LL<<i)==0)continue;
| ^~~
|
s982657645 | p03752 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll inf = 1e18;
int main() {
int n, k;
cin >> n >> k;
vector<int> a(n);
rep(i,n) cin >> a[i];
ll ans = inf;
rep(i,1<<n) {
ll t = 0;
int fla... | a.cc: In function 'int main()':
a.cc:22:22: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, ll)'
22 | tmp = max(a[j],tmp+1);
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
fr... |
s032227643 | p03752 | C++ | #include <bits/stdc++.h>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector... | a.cc: In function 'int main()':
a.cc:42:56: error: expected ';' before '}' token
42 | highest.at(i+1) = max(a.at(i+1), highest.at(i))
| ^
| ;
43 | }
| ~ ... |
s103295353 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int N, K; cin >> N >> K;
vector<long long> a(N);
for(int i = 0; i < N; i++){
cin >> a[i];
}
long long ans = 1e18;
for(int i = 0; i < 1 << (N - 1); i++){
int cnt = 0;
for(int j=0;j < N-1;j++){
cnt += (i>>j)&1;
... | a.cc: In function 'int main()':
a.cc:24:20: error: no matching function for call to 'max(long int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
24 | now = max(now + 1, a[j + 1]);
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/... |
s901616929 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int N, K; cin >> N >> K;
vector<int> a(N);
for(int i = 0; i < N; i++){
cin >> a[i];
}
ll ans = 1e11;
for(int i = 0; i < (1 << (N - 1)); i++){
bitset<16> bit(i);
if(bit.count() != K - 1) continue;
ll ans1 = 0;
... | a.cc: In function 'int main()':
a.cc:23:20: error: no matching function for call to 'max(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
23 | bound = max(bound, a[j + 1]);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s563915444 | p03752 | C++ | /*
Problem 14
https://atcoder.jp/contests/s8pc-4/tasks/s8pc_4_b
*/
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
#include <stack>
#include <cctyp... | a.cc: In function 'int main()':
a.cc:63:2: error: expected '}' at end of input
63 | }
| ^
a.cc:31:11: note: to match this '{'
31 | int main(){
| ^
|
s261962767 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
int main()
{
int N, K;
cin >> N >> K;
vector<int> a(N);
long long ans = INF;
for (int i = 0; i < N; ++i)
{
cin >> a.at(i);
}
for (int i = 0; i < 1 << N; ++i)
{
if (__builtin_popcountll(i) != K)
{
continue;
}
... | a.cc: In function 'int main()':
a.cc:32:22: error: no matching function for call to 'max(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
32 | max_hight = max(max_hight,a.at(j));
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorit... |
s060853873 | p03752 | C++ | //This template was last modified on 2/26/2020.
//Define many functions and words.
//The functions I have defined start with a capital letter.
#include <bits/stdc++.h>
using namespace std;
//#define MOD 998244353
#define MOD 1000000007
typedef long long ll;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vect... | a.cc: In lambda function:
a.cc:241:16: error: inconsistent types 'long int' and 'long long int' deduced for lambda return type
241 | return res;
| ^~~
a.cc: In function 'int main()':
a.cc:245:24: error: no matching function for call to 'Chmin(ll&, long int)'
245 | rep(sub, ALL) Chmi... |
s677863927 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long int N,K,m=0,M,w;bool x=true;cin>>N>>K;vector<int>a(N);
for(int i=0;i<N;i++)cin>>a.at(i);
for(long int i=0;i<(1<<16);i++){
bitset<16>p(i);
if(p.test(N-1))break;
w=a.at(0),M=0;
if(p.count()==K-1){
for(int j=1;j<N;j++){
if(p... | a.cc: In function 'int main()':
a.cc:13:16: error: no matching function for call to 'max(long int, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
13 | w=max(w+1,a.at(j));
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /... |
s571692505 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,K,m,M,w;cin>>N>>K;vector<int>a(N);
for(int i=0;i<N;i++)cin>>a.at(i);
for(int i=0;i<(1<<15);i++){
bitset<16>p(i);
if(p.test(N))break;
w=a.at(0),M=0;
if(p.count()==K){
if(int j=0;j<N;j++){
w=max(w+1,a.at(j));
if(p.... | a.cc: In function 'int main()':
a.cc:11:21: error: expected ')' before ';' token
11 | if(int j=0;j<N;j++){
| ~ ^
| )
a.cc:11:22: error: 'j' was not declared in this scope
11 | if(int j=0;j<N;j++){
| ^
|
s914932626 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,K,m,M,w;cin>>N>>K;vector<int>a(N);
for(int i=0;i<N;i++)cin>>a.at(i);
for(int i=0;i<(1<<15);i++){
bitset<16>p(i);
if(p.test(N))break;
w=a.at(0),M=0;
if(p.count()==K){
if(int j=0;j<N;j++){
w=max(w+1,a.at(j));
if(p.... | a.cc: In function 'int main()':
a.cc:11:21: error: expected ')' before ';' token
11 | if(int j=0;j<N;j++){
| ~ ^
| )
a.cc:11:22: error: 'j' was not declared in this scope
11 | if(int j=0;j<N;j++){
| ^
|
s722545068 | p03752 | C++ | #include <bits/stdc++.h>
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];
int tall = 0;
int c = 0;
int ans = 0;
for(int i = 0; i < n; i++){
tall = max(tall, a[i]);
} | a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s483171312 | p03752 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n,k;cin>>n>>k;
vector<long long> A(n);for(int i = 0; n > i; i++)cin>>A[i];
long long ans = 0;
for(int bit = 0; (1<<(n-1)) > bit; bit++){
if(__builtin_popcount(bit)+1 != k)continue;
long long he = A[0];
long long tmp = 0;
... | a.cc: In function 'int main()':
a.cc:18:16: error: 'ht' was not declared in this scope; did you mean 'he'?
18 | tmp =ht-A[i+1];
| ^~
| he
|
s216568970 | p03752 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n,k;cin>>n>>k;
for(int i = 0; n > i; i++){
vector<int> A(n);
}
int ans = -1;
for(int bit = 0; (1<<n) > bit; bit++){
if(__builtin_popcount(bit) != k)continue;
int nya = -1;
int tmp = 0;
for(int i = 0; n > i; i++){
... | a.cc: In function 'int main()':
a.cc:17:17: error: 'A' was not declared in this scope
17 | nya = A[i];
| ^
a.cc:19:20: error: 'A' was not declared in this scope
19 | if(nya < A[i]){
| ^
|
s685248724 | p03752 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
//TEMPLATE START---------------8<---------------8<---------------8<---------------8<---------------//
typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll>... | a.cc: In function 'int main()':
a.cc:119:35: error: no matching function for call to 'max(int, long long int)'
119 | int need = max(0, (max(mx[i], hei) + 1) - A[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s898213254 | p03752 | C++ | // #include <bits/stdc++.h>
#include<climits>
#include<cmath>
#include<cstdio>
#include<deque>
#include<map>
#include<set>
#include<vector>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<numeric>
#include<string>
#include<tuple>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
using n... | a.cc:16:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
16 | #include <boost/multiprecision/cpp_int.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s898065200 | p03752 | C++ | // #include <bits/stdc++.h>
#include<climits>
#include<cmath>
#include<cstdio>
#include<deque>
#include<map>
#include<set>
#include<vector>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<numeric>
#include<string>
#include<tuple>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
using n... | a.cc:16:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
16 | #include <boost/multiprecision/cpp_int.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s717907838 | p03752 | C++ | #include <iostream>
using namespace std;
long h[20][20], dp[20][20];
int main() {
int N, K, a[20]; cin >> N >> K;
for(int i=0; i<N; ++i) cin >> a[i];
h[0][0]=h[0][1]=a[0];
for(int i=1; i<N; ++i){
h[i][0]=max(h[i-1][0], a[i]);
for(int j=1; j<i+2; ++j){
if(a[i]>h[i-1][j-1]){
h[i][j]=a... | a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'max(long int&, int&)'
10 | h[i][0]=max(h[i-1][0], a[i]);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes... |
s186399636 | p03752 | C++ | #include "bits/stdc++.h"
using namespace std;
using namespace std::chrono;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
#define _overload4(_1,_2,_3,_4,name,...) name
#define _overload3(_1,_2,_3,name,...) name
#define _overload2(_1,_2,name,...) name
#define _re(n) _rep(i,n)
#define _rep... | a.cc: In function 'll dp(ll, ll, ll)':
a.cc:80:52: error: no matching function for call to 'max(int, ll)'
80 | return dp(k-1,at+1,max(height+1,a[at]))+max(0,height+1-a[at]);
| ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s023136740 | p03752 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
long long N, K;
vector<long long> buildings;
long long build(long long now, long long back_building_height, long long increase_buildings){
if(increase_buildings == K){
return 0;
}else if(N - now == K - increase_buildings){... | a.cc: In function 'long long int build(long long int, long long int, long long int)':
a.cc:13:19: error: no matching function for call to 'max(long int, long long int)'
13 | return max(0l, back_building_height + 1 - buildings[now]) + build(now + 1, max(back_building_height + 1, buildings[now]), increase_buil... |
s042037143 | p03752 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define long long long
int N, K;
vector<long> buildings;
long build(int now, long back_building_height, int increase_buildings){
if(increase_buildings == K){
return 0;
}else if(N - now == K - increase_buildings){
re... | a.cc: In function 'long long int build(int, long long int, int)':
a.cc:13:19: error: no matching function for call to 'max(long int, long long int)'
13 | return max(0l, back_building_height + 1 - buildings[now]) + build(now + 1, max(back_building_height + 1, buildings[now]), increase_buildings + 1);
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.