submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s714809592
p04006
C++
#include<bits/stdc++.h> using namespace std; int n,k,a[1010]; long long dp[2010][2010]; int main() { cin>>n>>k; for(int i=1;i<=n;++i)scanf("%d",a+i); for(int i=1;i<=n;++i){ dp[i][0]=a[i]; for(int j=1;j<n;++j){ int y=i-j;if(y<1)y+=n; dp[i][j]=min(dp[i][j-1],a[y]); } } ...
a.cc: In function 'int main()': a.cc:13:25: error: no matching function for call to 'min(long long int&, int&)' 13 | dp[i][j]=min(dp[i][j-1],a[y]); | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu...
s562249969
p04006
C++
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 2e3 + 5; LL a[maxn]; LL b[maxn][maxn];//b[i][k] : 当整个过程使用了【k】次魔法,获得【color i】时的最少花费的时间。(不包括【k * x】). int main(){ int n; LL x,sum = 1LL << 60LL; cin >> n >> x; for(int i = 1;i <= n;i++) cin >> a[i]; for(int i = 1;i <...
a.cc:30:2: error: expected unqualified-id before numeric constant 30 | }1 | ^
s166224571
p04006
C++
#include<stdio.h> int main(){ long n,i,j,a[2222],min[2222][2222],ans,x,p; scanf("%ld%ld",&n,&x); for(i=0;i<n;i++) scanf("%ld",&a[i]); for(i=0;i<n;i++) for(j=0;j<n;j++) min[i][j]=100000000000; for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(a[(i-j)%n]<min[i][(i-j+1)%n]) min[i][(i-j)%n]=a[(i-j)%n]; else min[i][(i-j)%n]=min[i][(i-...
a.cc: In function 'int main()': a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s944926459
p04006
C++
#include "testlib.h" #include <bits/stdc++.h> using namespace std; using ll = long long; const int MX = 2007; int a[MX]; int cost[MX]; int main() { #ifdef BZ freopen("input.txt", "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; int x; ...
a.cc:1:10: fatal error: testlib.h: No such file or directory 1 | #include "testlib.h" | ^~~~~~~~~~~ compilation terminated.
s448705412
p04006
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll ; long long gcd(long long aaa,long long bbb) { if(bbb==0) { return aaa; } return gcd(bbb,aaa%bbb); } int main (){ ll N,x; cin >> N >> x; ll a[N],s=0,cmp,tmp[2000]={},l=0,count=-1,o,countt=0,n[2000]={},tmpp=0; m...
a.cc: In function 'int main()': a.cc:73:14: error: 'i' was not declared in this scope 73 | if(m[i] == 1) { | ^ a.cc:78:13: error: break statement not within loop or switch 78 | break; | ^~~~~
s906683406
p04006
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll ; long long gcd(long long aaa,long long bbb) { if(bbb==0) { return aaa; } return gcd(bbb,aaa%bbb); } int main (){ ll N,x; cin >> N >> x; ll a[N],s=0,cmp,tmp[2000]={},l=0,count=-1,o,countt=0,n[2000]={},tmpp[2000]={}...
a.cc: In function 'int main()': a.cc:83:13: error: expected primary-expression before '}' token 83 | }else { | ^
s592349049
p04006
C++
#include <bits/stdc++.h> #define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(long long int i=(a);i<(b);i++) #define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Abs(a,b) max(a,b)-min(a,b) #define YES(condition...
a.cc: In function 'int main()': a.cc:44:18: error: expected ';' before 'b' 44 | pos+=a[i] | ^ | ; 45 | b[i]=INF; | ~
s130777874
p04006
C++
#include "iostream" #include "algorithm" #include "string" #include "vector" #include "cmath" #include "bitset" #include "queue" #include "functional" #include "map" #include "unordered_map" #define lp(n) for (int i = 0; i < n; i++) #define LP(n,i) for (int i = 0; i < n; i++) #define mod 1000000007 #define sp ' ' #def...
a.cc: In function 'int main()': a.cc:42:26: error: no matching function for call to 'max(ll&, int&)' 42 | mem = max(mem, mx[i].second); | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_class...
s413089840
p04006
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.*; public class AGC004B{ public static void main(String[] args) throws IOException { MyScanner sc = new MyScanner(System.in); int n; long x; n = sc.nextInt(); x = sc.nex...
Main.java:7: error: class AGC004B is public, should be declared in a file named AGC004B.java public class AGC004B{ ^ 1 error
s776932696
p04006
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; int N, x; int a[2010]; ll dp[2010][2010], dp2[2010][2010]; int main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin >> N >> x; for (int i = 0; i < N; i++) { cin >> ...
a.cc: In function 'int main()': a.cc:34:12: error: no matching function for call to 'max(int&, ll&)' 34 | s = max(s, dp2[i][N - 1]); | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s453456959
p04006
C++
#include <cstdio> #include <vector> #include <algorithm> #include <stdint.h> int64_t prev[100000]; int64_t next[100000]; int64_t as[100000]; int64_t bs[100000]; int64_t slope[100000]; int64_t total_slope; int64_t t; std::vector<int64_t> vanish[100001]; void calc_slope(int64_t x){ bs[x]+=t*slope[x]; total_slope-=...
a.cc: In function 'int main()': a.cc:35:8: error: 'iota' is not a member of 'std' 35 | std::iota(prev+1,prev+N,0); | ^~~~ a.cc:37:8: error: 'iota' is not a member of 'std' 37 | std::iota(next,next+N-1,1); | ^~~~
s127508208
p04006
C++
#include <algorithm> #include <iostream> #include <vector> #include <math.h> #include <set> #include <map> #include <string> #include <stack> #include <queue> #include <iomanip> #define _USE_MATH_DEFINES using namespace std; typedef long long ll; typedef pair<int, int> pii; double pi = 3.141592653589793; ll mod = 10000...
a.cc:20:13: warning: integer constant is so large that it is unsigned 20 | ll llmin = -9223372036854775808; | ^~~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:42:18: error: 'accumulate' was not declared in this scope 42 | ll num = accumulate(m[n], m[n] + N, 0ll) + x * n; | ...
s807571451
p04006
C++
#include <algorithm> #include <iostream> #include <vector> #include <math.h> #include <set> #include <map> #include <string> #include <stack> #include <queue> #include <iomanip> #include <functional> #define _USE_MATH_DEFINES using namespace std; typedef long long ll; typedef pair<int, int> pii; double pi = 3.141592653...
a.cc:21:13: warning: integer constant is so large that it is unsigned 21 | ll llmin = -9223372036854775808; | ^~~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:43:18: error: 'accumulate' was not declared in this scope 43 | ll num = accumulate(m[n], m[n] + N, 0) + x * n; | ...
s259198751
p04006
C++
#include <algorithm> #include <iostream> #include <vector> #include <math.h> #include <set> #include <map> #include <string> #include <stack> #include <queue> #include <iomanip> #define _USE_MATH_DEFINES using namespace std; typedef long long ll; typedef pair<int, int> pii; double pi = 3.141592653589793; ll mod = 10000...
a.cc:20:13: warning: integer constant is so large that it is unsigned 20 | ll llmin = -9223372036854775808; | ^~~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:42:18: error: 'accumulate' was not declared in this scope 42 | ll num = accumulate(m[n], m[n] + N, 0) + x * n; | ...
s791958363
p04006
C++
#include <cstdio> #include <iostream> #include <bitset> #include <cmath> #include <vector> #include <algorithm> using namespace std; typedef long long ll; #define ALL(obj) (obj).begin(), (obj).end() #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define rep(i,n) FOR(i,0,n) ll *buildRMQ(ll *a, ll n) { ll logn = 1; ...
a.cc:36:1: error: '::main' must return 'int' 36 | ll main(){ | ^~
s749032583
p04006
C++
#include <bits/stdc++.h> using namespace std; long long n, x, menor = LONG_MAX, answer = 0, val; long long colors[2010]; bool ready[2010]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); colors[0] = 0; cin >> n >> x; int inicial; for(int i = 0; i < n; ++i){ cin >> colors[i]; ...
a.cc: In function 'int main()': a.cc:28:17: error: 'color' was not declared in this scope; did you mean 'colors'? 28 | menor = color[l]; | ^~~~~ | colors
s756980316
p04006
C++
#include<iostream> #include<climits> #include<algorithm> using namespace std; typedef long long int ll; int main(){ ll n, k, a[2000]; int memo[2001][2000]; cin >> n >> k; for(ll i = 0; i < n; i++) cin >> a[i]; ll ans = LLONG_MAX; for(int i = 0; i <= n; i++){ ll cnt = 0; for(int j = 0; j < n; j++){ if(i == ...
a.cc: In function 'int main()': a.cc:16:57: error: no matching function for call to 'min(int&, ll&)' 16 | else if (i > j) memo[i][j] = min(memo[i - 1][j], a[j - i + n]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/i...
s183781891
p04006
C++
C:\Users\tassa\CLionProjects\CP\cmake-build-debug\CP.exe 3 10 100 1 100 23 Process finished with exit code 0
a.cc:1:3: error: stray '\' in program 1 | C:\Users\tassa\CLionProjects\CP\cmake-build-debug\CP.exe | ^ a.cc:1:9: error: stray '\' in program 1 | C:\Users\tassa\CLionProjects\CP\cmake-build-debug\CP.exe | ^ a.cc:1:15: error: stray '\' in program 1 | C:\Users\tassa\CLionProjects\CP\cmake...
s499871466
p04006
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include <functional> using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define inf INT_MAX/3 ...
a.cc: In function 'int main()': a.cc:14:13: error: 'INT_MAX' was not declared in this scope 14 | #define INF INT_MAX/3 | ^~~~~~~ a.cc:76:25: note: in expansion of macro 'INF' 76 | long long ans = INF; | ^~~ a.cc:6:1: note: 'INT_MAX' is defined in header '<cl...
s433311308
p04006
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++...
a.cc: In function 'int main()': a.cc:40:17: error: no matching function for call to 'max(ll&, int&)' 40 | mx = max(mx, cnt); | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: ...
s610794938
p04006
C++
N, x = list(map(int, input().split())) n = N a = list(map(int, input().split())) b = [[1000000000000000000000 for i in range(n)] for j in range(n)] for i in range(n): b[i][0] = a[i] for j in range(1, n): b[i][j] = min(b[i][j-1], a[(i-j+n)%n]) s = [0 for i in range(n)] for i in range(n): for j in range(n): s[j] +...
a.cc:4:7: warning: integer constant is too large for its type 4 | b = [[1000000000000000000000 for i in range(n)] for j in range(n)] | ^~~~~~~~~~~~~~~~~~~~~~ a.cc:13:7: warning: integer constant is too large for its type 13 | ans = 1000000000000000000000 | ^~~~~~~~~~~~~~~~~~~~~~ a.cc:1:1:...
s966966144
p04006
C++
#include<iostream> #include<cstdio> #include<queue> #include<functional> #include<vector> #include<deque> #define int long long #define P pair<int,int> using namespace std; int c[4000]; signed main() { int a, b; scanf("%lld%lld", &a, &b); for (int d = 0; d < a; d++) { scanf("%lld", &c[d]); c[d + a] = c[d]; } i...
a.cc: In function 'int main()': a.cc:18:19: error: 'LLONG_MAX' was not declared in this scope 18 | int MIN = LLONG_MAX; | ^~~~~~~~~ a.cc:5:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include<functional> +++ ...
s010800558
p04006
C++
#include<bits/stdc++.h> #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; const l...
In file included from /usr/include/c++/14/cassert:44, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106, from a.cc:1: a.cc: In function 'int main()': a.cc:34:9: error: void value not ignored as it ought to be 34 | assert(parent < 2000) | ^~~~~~
s202032276
p04006
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<cmath> #include<cstring> #include<queue> #include<stack> #include<cstdio> #include<sstream> #include<iomanip> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb...
a.cc: In function 'int main()': a.cc:41:16: error: unable to find numeric literal operator 'operator""LL' 41 | ll out=1e16LL; | ^~~~~~
s141970191
p04006
C++
// 23:38~ #include <bits/stdc++.h> using namespace std; #define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl #define repi(i,a,b) for(int i=int(a);i<int(b);i++) #define peri(i,a,b) for(int i=int(b);i-->int(a);) #define rep(i,n) repi(i,0,n) #define per(i,n) peri(i,0,n) #define all(c) begin(c),end(c) #def...
a.cc: In function 'int main()': a.cc:65:40: error: no matching function for call to 'min(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)' 65 | rep(j,n) mn=min(mn,a[j]+(i-j+n)%n*x); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from...
s687841858
p04006
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; bool SortComp(pair<long long int, int> p1, pair<long long int, int> p2) { if(p1.first < p2.first) return true; else return false; } int main(void) { int num; long long int changet, catcht[2010]= {}, maxchange= 0, sum= 0; pair<l...
a.cc: In function 'int main()': a.cc:43:92: error: expected primary-expression before 'long' 43 | maxchange= max(maxchange, (long long int)num-timecheck[0].second+i(long long int)); | ^~~~ a.cc:43...
s858305787
p04006
C++
// #include <iostream> // #include <algorithm> #include <bits/stdc++.h> #define ll long long #define INF 1LL << 60 using namespace std; ll N, x; int a[2010]; ll b[2010]; int main(){ cin >> N >> x; for (int i = 0; i < N; ++i) { cin >> a[i]; b[i] = a[i]; } ll ans = INF; for (int k = 0; k < N; ++k)...
a.cc: In function 'int main()': a.cc:27:17: error: no matching function for call to 'min(long long int&, int&)' 27 | b[i] = min(b[i], a[(i - k + N) % N]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-g...
s887448900
p04006
C++
// #include <iostream> // #include <algorithm> #include <bits/stdc++.h> #define ll long long #define INF 1LL << 60 using namespace std; ll N, x; int a[2010]; ll b[2010]; int main(){ cin >> N >> x; for (int i = 0; i < N; ++i) { cin >> a[i]; b[i] = a[i]; } ll ans = INF; for (int k = 0; k < N; ++k)...
a.cc: In function 'int main()': a.cc:27:17: error: no matching function for call to 'min(long long int&, int&)' 27 | b[i] = min(b[i], a[(i - k + N) % N]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-g...
s720365072
p04006
C++
#include <iostream> #include <algorithm> #define ll long long #define INF 1LL << 60 using namespace std; ll N, x; int a[2010]; ll b[2010]; int main(){ cin >> N >> x; for (int i = 0; i < N; ++i) { cin >> a[i]; b[i] = a[i]; } ll ans = INF; for (int k = 0; k < N; ++k) { ll tmp = k * x; fo...
a.cc: In function 'int main()': a.cc:26:17: error: no matching function for call to 'min(long long int&, int&)' 26 | b[i] = min(b[i], a[(i - k + N) % N]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/local...
s016613314
p04006
C++
my ($N, $x) = <STDIN>; my $a = split(/ /,<STDIN>); calculate($N, $x, $a); sub calculate{ my $min_val_id = 0; my ($N, $x, $a) = @_; foreach my $i (0..$N-1){ $min_val_id = $i if($a->[$min_val_id] > $a->[$i]); } my $sum_time = 0; my $max_changed_count = 0; my $changed_count = 0; #I shuld be this p...
a.cc:8:21: error: stray '@' in program 8 | my ($N, $x, $a) = @_; | ^ a.cc:10:18: error: too many decimal points in number 10 | foreach my $i (0..$N-1){ | ^~~~~ a.cc:18:4: error: invalid preprocessing directive #I 18 | #I shuld be this program refactering ...
s639371321
p04006
C++
#include <iostream> #include <cstdint> #include <vector> #include <algoirhtm> using namespace std; int main() { int64_t N, x; cin >> N >> x; vector<int64_t> times(N); for (int64_t &t : times) cin >> t; int64_t best=N*(int64_t)2000000000; int64_t dx = 0; for (int i=0 ; i<N ; i++, dx+=x) { int64_t sum=0; for (int j=0...
a.cc:4:10: fatal error: algoirhtm: No such file or directory 4 | #include <algoirhtm> | ^~~~~~~~~~~ compilation terminated.
s502823081
p04006
C++
/* *********************************************** Author :devil ************************************************ */ #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <map> #include <string> #include <cmath> #include <stdlib.h...
a.cc:38:16: error: macro "rep" requires 3 arguments, but only 2 given 38 | rep(1,n) now+=(i>l)?mi[i-l][i]:min(mi[1][i],mi[i+n-l][n]); | ^ a.cc:17:9: note: macro "rep" defined here 17 | #define rep(i,a,b) for(int i=a;i<=b;i++) | ^~~ a.cc: In function 'int main()': a.cc:38...
s256506425
p04006
C++
#include <iostream> #include <sstream> #include <string> #include <cmath> #include <cstdio> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <functional> #include <numeric> #include <iomanip> using namespace std; typedef unsigned int uint; typedef long lon...
a.cc: In function 'int main()': a.cc:53:24: error: 'Bs' was not declared in this scope; did you mean 'As'? 53 | vector<ll> costs = Bs; | ^~ | As
s501967631
p04006
C++
#include<bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f using namespace std; ll a[5000]; int main() { ll n,x,ans=0,MIN=inf; scanf("%lld%lld",&n,&x); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); MIN=min(a[i],MIN); } for(int i=1;i<=n;i++) ans+=min(a[i],MIN+x); printf("%lld",ans); return 0; }
a.cc: In function 'int main()': a.cc:17:1: error: 'printf\U0000ff08' was not declared in this scope; did you mean 'printf'? 17 | printf("%lld",ans); | ^~~~~~~~ | printf
s398311132
p04006
C++
#include <iostream> #define REP(i, a, n) for(int i = a; i < n; i++) using namespace std; long N, x, a[2001]; int main(void) { cin >> N >> x; REP(i, 1, N + 1) cin >> a[i]; long cost = 0; long cnt = 0; REP(i, 1, N + 1) { long m = a[i]; long p = a[i]; REP(j, 1, N) { int k = (i - j + N - 1)...
a.cc: In function 'int main()': a.cc:23:18: error: no matching function for call to 'max(long int&, int&)' 23 | cnt = max(cnt, j); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /...
s049377361
p04006
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2005; const int M = 1000000007; int n; ll x; ll dp[N][N]; int main() { while (~scanf("%d%I64d", &n, &x)) { for (int i = 0; i < n; i++) { scanf("%I64d", &dp[i][0]); } for (int i = 0; i < n; i++) { for (int j = ...
a.cc: In function 'int main()': a.cc:19:38: error: 'a' was not declared in this scope 19 | dp[i][j] = min(dp[i][j - 1], a[(i - j + n) % n]); | ^
s015463777
p04006
C++
#include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <complex> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <bitset> #include <ctime> #include <map> #include <uno...
In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h: In instantiation of '_OIter std::copy_n(_IIter, _Size, _OIter) [with _IIter = __gnu_cxx::__normal_iterator<long long int*, vector<long long int> >; _Size = __gnu_cxx::__normal_iterator<long long in...
s545089990
p04006
C++
// include #include <algorithm> #include <iterator> #include <vector> #include <iomanip> #include <iostream> #include <stack> #include <queue> #include <list> #include <utility> #include <string> #include <cstring> #include <stdio.h> #include <cassert> // M_PI for pi #define _USE_MATH_DEFINES #include <math.h> #def...
a.cc:27:1: error: 'longlong' does not name a type 27 | longlong x; | ^~~~~~~~ a.cc: In function 'int main(int, char**)': a.cc:37:17: error: 'x' was not declared in this scope 37 | cin >> N >> x; | ^
s356748411
p04006
C++
int main(){ int N, x; cin >> N >> x; vector<int> a(N); for (int i = 0; i < N; ++i){ cin >> a[i]; } vector<int> minA = a; long long minTTTime = 9223372036854775807; for (int ms = 0; ms < N; ++ms){ for (int i = 0; i<N; ++i){ int mIndex = i - ms; if (mIndex<0) mIndex += N; if (minA[i]>a[mIndex]) minA...
a.cc: In function 'int main()': a.cc:3:9: error: 'cin' was not declared in this scope 3 | cin >> N >> x; | ^~~ a.cc:4:9: error: 'vector' was not declared in this scope 4 | vector<int> a(N); | ^~~~~~ a.cc:4:16: error: expected primary-expression before 'int' 4 | ...
s027389484
p04006
C++
#include <cstdio> #include <iostream> #include <cmath> #include <cstring> #include <sstream> #include <iostream> #include <algorithm> #include <cstdlib> #include <map> #include <queue> #include <utility> #include <vector> #include <set> #include <memory.h> #include <iomanip> #include <bitset> #include <list> #include ...
a.cc:57:2: error: 'v' does not name a type 57 | }v | ^
s061537542
p04006
C++
// include #include <algorithm> #include <iterator> #include <vector> #include <iomanip> #include <iostream> #include <stack> #include <queue> #include <list> #include <utility> #include <string> #include <cstring> #include <stdio.h> #include <cassert> // M_PI for pi #define _USE_MATH_DEFINES #include <math.h> #def...
a.cc: In function 'int main(int, char**)': a.cc:22:13: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000005' to '1410065413' [-Woverflow] 22 | #define MAX 10000000005 | ^~~~~~~~~~~ a.cc:44:13: note: in expansion of macro 'MAX' 44 | int S = MAX; | ...
s040583438
p04006
C++
#include<iostream> #include<vector> #include <algorithm> using namespace std; int main() { vector<long int> a; int b, p, flag = 0; long int count = 0, kiroku = 0, cowcow = 0, tiisai; long int c, d, hozon; long long int ans = 0; cin >> b >> d; for(int i = 0; i < b; i++) { cin >> c; a.push_back(c);...
a.cc: In function 'int main()': a.cc:44:27: error: 'endk' was not declared in this scope 44 | cout << tiisai * d << endk; | ^~~~
s107452148
p04006
C++
#include<bits/stdc++.h> #define REP(i,s,n) for(int i=s;i<n;++i) #define rep(i,n) REP(i,0,n) using namespace std; #define MAX_N 2016 typedef long long ll; const bool debug = false; int N,x; ll a[MAX_N]; ll mini[MAX_N]; bool fin[MAX_N]; //bool check(ll cnt) { ll compute(ll cnt) { if( debug ) { puts(""); ...
a.cc: In function 'int main()': a.cc:117:3: error: expected primary-expression before '/' token 117 | /.cout<< ternarySearch() << endl; | ^ a.cc:117:4: error: expected primary-expression before '.' token 117 | /.cout<< ternarySearch() << endl; | ^
s188888120
p04006
C++
#include <iostream> using namespace std; int cost[2000]; bool own[2000]; int n, x ; long long decide() { long long costtt =INT_MAX; int minplace = 0; long long sum = 0, sumslide = 0 ; bool gotdemall = true; for(int i=0 ; i<n ; ++i) { if(!own[i]) { sum+=cost[i]; ...
a.cc: In function 'long long int decide()': a.cc:8:23: error: 'INT_MAX' was not declared in this scope 8 | long long costtt =INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostre...
s612952648
p04006
C++
#include <iostream> using namespace std; int cost[2000]; bool own[2000]; int n , x ; long long decide(){ long long costtt =INT_MAX; int minplace = 0; long long sum = 0 , sumslide = 0 ; bool gotdemall = true; for(int i=0 ; i<n ;++i){ if(!own[i]){ sum+=cost[i]; gotdemall = false; if(cost[i]< c...
a.cc: In function 'long long int decide()': a.cc:6:19: error: 'INT_MAX' was not declared in this scope 6 | long long costtt =INT_MAX; int minplace = 0; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #inc...
s344770524
p04006
Java
import java.util.*; public class B { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int N = sc.nextInt(); int x = sc.nextInt(); sc.nextLine(); int[] as = new int[N]; for (int i = 0; i < N; i++) { as[i] = sc.nextInt(); } int min = Integer.MAX_VALUE; ...
Main.java:3: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s793005205
p04006
C++
#include <bits/stdc++.h> using namespace std; __int64 a[2010]; __int64 maxDis[2010]; __int64 cnt[2010]; int main() { __int64 n, x; scanf("%I64d%I64d", &n, &x); for(__int64 i = 1; i <= n; ++i) scanf("%I64d", &a[i]); for(__int64 i = 1; i <= n; ++i) { __int64 min_j = i; __int64...
a.cc:4:1: error: '__int64' does not name a type; did you mean '__int64_t'? 4 | __int64 a[2010]; | ^~~~~~~ | __int64_t a.cc:5:1: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | __int64 maxDis[2010]; | ^~~~~~~ | __int64_t a.cc:6:1: error: '__int64' does not name a type...
s331341106
p04006
C++
#include <iostream> #include <vector> #include<algorithm> using namespace std; long long secNeed(vector<int> &a, int ori, int moveStep,int N,int x){ int index = ori >= moveStep ? ori - moveStep : ori + N - moveStep; return a[index] + moveStep*x; } int main() { int N, x; int maxStep = 0; cin >> N >> x; vector<int...
a.cc: In function 'int main()': a.cc:41:26: error: expected primary-expression before 'long' 41 | sum += i*long long(x); | ^~~~
s751546360
p04006
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) //#define int long long typedef long long ll; using namespace std; ll N, x; ll a[2000]; ll magic[2001]; pair<ll, ll> d[2010]; signed main() { cin >> N >> x; rep(i,N) { cin >> a[i]; d[i].first = a[i]; //コスト d[i].second = 0; //魔法の回数 } /* rep(i,N...
a.cc: In function 'int main()': a.cc:60:36: error: no matching function for call to 'max(int&, long long int&)' 60 | magic_max_cnt = max(magic_max_cnt, d[i].second); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s493358144
p04006
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<vector> #include<string> #include<map> #include<cmath> #include<queue> #include<functional> #include<climits> #include<tuple> #include<utility> #include<cassert> using namespace std; //define #define ALL(a) a.begin(),a.end() #define REP(i,n) for(int i...
a.cc: In function 'int main()': a.cc:102:38: error: expected primary-expression before 'long' 102 | res = min(res, sum + long long int(x)*i); | ^~~~
s806224471
p04006
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<vector> #include<string> #include<map> #include<cmath> #include<queue> #include<functional> #include<climits> #include<tuple> #include<utility> #include<cassert> using namespace std; //define #define ALL(a) a.begin(),a.end() #define REP(i,n) for(int i...
a.cc:48:9: warning: overflow in conversion from 'double' to 'int' changes value from '3.0e+9' to '2147483647' [-Woverflow] 48 | int x = 3e9; | ^~~ a.cc: In function 'int main()': a.cc:104:38: error: expected primary-expression before 'long' 104 | res = min(res, sum + long long int(x)*...
s736098346
p04006
C++
#include <iostream> #include <algorithm> #include <climits> #define N 2010 #define LL long long using namespace std; LL a[N]; LL b[N][N]; int main(int argc, char* argv[]) { LL n, x; while(cin >> n >> x) { for(int i = 0; i < n ; ++i ) { cin >> a[i]; } for(int i = 0; i < n; ++...
a.cc: In function 'int main(int, char**)': a.cc:33:14: error: expected '}' at end of input 33 | return 0; | ^ a.cc:11:1: note: to match this '{' 11 | { | ^
s020354450
p04006
C++
#include <iostream> #include <queue> #include <set> #include <cassert> #include <map> #include <reverse> #include <sstream> using namespace std; long long a[2010]; int mn[4010][4010]; int main(){ int N,x; cin >> N >> x; for(int i = 0 ; i < N ; i++) cin >> a[i]; reverse(a,a+N); for(int i = 0 ; i < 4010 ; i++) ...
a.cc:6:10: fatal error: reverse: No such file or directory 6 | #include <reverse> | ^~~~~~~~~ compilation terminated.
s705188564
p04006
C++
#include <iostream> #include <queue> #include <set> #include <cassert> #include <map> #include <sstream> using namespace std; long long a[2010]; int mn[4010][4010]; int main(){ int N,x; cin >> N >> x; for(int i = 0 ; i < N ; i++) cin >> a[i]; reverse(a,a+N); for(int i = 0 ; i < 4010 ; i++) for(int j = 0 ; j ...
a.cc: In function 'int main()': a.cc:16:9: error: 'reverse' was not declared in this scope 16 | reverse(a,a+N); | ^~~~~~~
s348978824
p04006
C++
//ここからテンプレート //#define PLASMA_NO_BOOST #if 1 #include<iostream> #include<list> #include<algorithm> #include<utility> #include<type_traits> #include<tuple> #include<memory> #include<iterator> #include<string> #include<functional> #include<list> #include<array> #include<complex> #include<numeric> #include<iomanip> #incl...
a.cc:29:9: fatal error: boost/optional.hpp: No such file or directory 29 | #include<boost/optional.hpp> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s017825861
p04006
C++
#include <bits/stdc++.h> using namespace std; int main() { long long n, x, mn = (1<<30); cin >> n >> x; long long a[n]; for(int i=0; i<n; i++) { cin >> a[i]; mn = min(a[i], mn); } long long ans = 0 for(int i=0; i<n; i++) ans += min(x + mn, a[i]); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: expected ',' or ';' before 'for' 14 | for(int i=0; i<n; i++) ans += min(x + mn, a[i]); | ^~~ a.cc:14:22: error: 'i' was not declared in this scope 14 | for(int i=0; i<n; i++) ans += min(x + mn, a[i]); | ^
s486226597
p04006
Java
import java.util.Scanner; public class B { public static void main (String args[]){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long x= sc.nextLong(); long[] a = new long[2*(int)n]; for (int i = 0; i<n; i++) { a[i]=sc.nextLong(); a[i+(int)n]=a[i]; } long[][] costs = new long[(int)...
Main.java:3: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s219031906
p04006
C++
//魔法をかける回数を固定(Kに)する。すると、色iのスライムは色i~i-Kのスライムから作れる。 //魔法によるコストは同じなので、この中から最小のものを選べばよい。 //愚直にやると、魔法回数O(N), 色O(N), 最小値O(N)だが、ナイーブに更新すると最小値クエリO(1)になって間に合う。 #include <iostream> #include <string> #include <algorithm> #include <functional> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #incl...
a.cc: In function 'int main()': a.cc:40:29: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive] 40 | cst += mini; | ~~~~^~~~~~~ | | | long long int*
s781722760
p04006
C++
# define _CRT_SECURE_NO_WARNINGS 1 # define _USE_MATH_DEFINES # include <iostream> # include <numeric> # include <string> # include <bitset> # include <vector> # include <algorithm> # include <cstdlib> # include <cstdio> # include <cstring> # include <cstdlib> # include <iomanip> # include <queue> # include <sstream> #...
a.cc:60:13: error: '::main' must return 'int' 60 | #define int lint | ^~~~ a.cc:62:1: note: in expansion of macro 'int' 62 | int main() | ^~~ a.cc: In function 'int main()': a.cc:91:32: error: no matching function for call to 'max(lint&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>:...
s876332058
p04006
C++
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> // C++ #include <algorithm> #include <bits...
a.cc: In function 'int main()': a.cc:156:14: error: no matching function for call to 'chmax(ll&, int&)' 156 | chmax(ma, cost[i].second); | ~~~~~^~~~~~~~~~~~~~~~~~~~ a.cc:91:23: note: candidate: 'template<class T> bool chmax(T&, const T&)' 91 | template<class T>bool chmax(T &a, const T &b) { i...
s723936460
p04006
C
#include <cstdio> #include <algorithm> using namespace std; typedef long long ll; int n; ll a[2222], x; int main(void) { scanf("%d%d", &n, &x); for (int i = 0; i < n; i++) scanf("%lld", a+i); ll res = 0; int ml = 0; for (int i = 0; i < n; i++) { ll m = a[i]; int idx = i; int l = 0; for (int...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s521973643
p04006
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> a(n, 0); for(int i = 0; i < n; ++i) cin >> a[i]; int64_t ans = 1e9; ans = ans * ans; vector<vector<int>> partMin(n, vector<int> (n, 1e9 + 5)); for(int i = 0; i < n; ++i) { ...
a.cc: In function 'int main()': a.cc:36:18: error: no matching function for call to 'min(int64_t&, long long int)' 36 | ans = min(ans, 1LL * slides * x + temp); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x...
s657289177
p04006
C++
#include <iostream> #include <algorithm> #include <vector> #include <numeric> using namespace std; typedef long long ll; #define reps(i,f,n) for(int i=f; i<int(n); ++i) #define rep(i,n) reps(i,0,n) int main() { ll n, x; cin >> n >> x; vector<ll> a(n); rep(i, n){ cin >> a[i]; } ...
a.cc: In function 'int main()': a.cc:22:23: error: 'LLONG_MAX' was not declared in this scope 22 | vector<ll> sec(n, LLONG_MAX); | ^~~~~~~~~ a.cc:5:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <numeric>...
s850157770
p04007
C++
/** * author: nok0 * created: 2020.09.13 22:45:14 **/ #ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include<bits/stdc++.h> using namespace std; #include<atcoder/all> using namespace atcoder; #pragma region Macros #define ll long long #define ld long double #define FOR(i,l,r) for(int i=(l);i<(r);++i) #define REP(i,n) FO...
a.cc:10:9: fatal error: atcoder/all: No such file or directory 10 | #include<atcoder/all> | ^~~~~~~~~~~~~ compilation terminated.
s774003425
p04007
C++
#include <bits/stdc++.h> using namespace std; const long long INF = 0x3f3f3f3f3f3f3f3f; long long n,m; char p[505][505] = {0},k; int r[505][505] = {0},b[505][505] = {0}; int main() { cin >> n >> m; for(int i = 1;i <= n;i ++){ for(int j = 1;j <= m;j ++){ cin >> k; if(k == '#') r[i][j] = b[i][j] = p[i][j] = 1; ...
a.cc: In function 'int main()': a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:12:31: note: to match this '{' 12 | for(int i = 1;i <= n;i ++){ for(int j = 2;j < m;j ++){ if(i & 1) r[i][j] = 1; else b[i][j] = 1; | ^ a.cc:16:2: error: expected '}' at en...
s489004003
p04007
C++
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define fi first #define se second #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)((x).size())) typedef pair<int, int> PII; typedef vector<int> VI; typedef long long int64; typedef unsigned int uint; typedef unsi...
a.cc:66:1: error: extended character   is not valid in an identifier 66 |    | ^ a.cc:66:1: error: extended character   is not valid in an identifier a.cc:66:1: error: '\U00003000\U00003000' does not name a type 66 |    | ^~~~
s405413451
p04007
C++
#include<bits/stdc++.h> using namespace std; long long n,m; char a[1001][1001],k; long long b[1001][1001],c[1001][1001]; int main(){ scanf("%lld%lld",&n,&m); for(register int i=0;i<n;++i){ for(register int j=0;j<m;++j){ k=getchar(); if(k=='#'){ a[i][j]=1; b[i][j]=1; c[i][j]=1; } } } ...
a.cc: In function 'int main()': a.cc:8:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 8 | for(register int i=0;i<n;++i){ | ^ a.cc:9:42: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 9 | ...
s729829567
p04007
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; class UnionFind{ public: //親の番号を格納する。親だった場合は-(その集合のサイズ) vector<int> parent; //-1で初期化。最初はすべてバラバラ UnionFind(int N){ parent = vector<int>(N,-1); } //Aがどのグループに属しているか(Aの根)を調べる int root(int A){ if(parent[A] <...
a.cc: In function 'int main()': a.cc:86:14: error: 'j' was not declared in this scope 86 | a[0][j]='#'; | ^
s554250611
p04007
C++
to be coded
a.cc:1:1: error: 'to' does not name a type; did you mean 'auto'? 1 | to be coded | ^~ | auto
s304289061
p04007
C++
#include <algorithm> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <string> #include <string.h> #include <unordered_map> #include <unordered_set> #include <vector> #define rep(i,n) for(int i=0;i...
a.cc: In function 'int main()': a.cc:42:27: error: 'j' was not declared in this scope 42 | else b[i][j-1]=true; | ^
s301616130
p04007
C++
#include <bist/stdc++.h> using namespace std; char a[505][505]; int main () { int n, m; cin >> n >> m; for(int i = 1; i <= n; i++) for(int j = 1; j <= m; j++) cin >> a[i][j]; for(int i = 1; i <= n; i++, cout << endl) for(int j = 1; j <= m; j++) cout << a[i][j]; }
a.cc:1:10: fatal error: bist/stdc++.h: No such file or directory 1 | #include <bist/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s673718177
p04007
C++
7 13 ............. .###.###.###. .#.#.#...#... .###.#...#... .#.#.#.#.#... .#.#.###.###. .............
a.cc:3:2: error: stray '##' in program 3 | .###.###.###. | ^~ a.cc:3:4: error: stray '#' in program 3 | .###.###.###. | ^ a.cc:3:6: error: stray '##' in program 3 | .###.###.###. | ^~ a.cc:3:8: error: stray '#' in program 3 | .###.###.###. | ^ a.cc:3:10: error: st...
s177039859
p04007
C++
#include<iomanip> #include<limits> #include<thread> #include<utility> #include<iostream> #include<string> #include<algorithm> #include<set> #include<map> #include<vector> #include<stack> #include<queue> #include<cmath> #include<numeric> #include<cassert> #include<random> #include<chrono> #include<unordered_map> #includ...
a.cc: In function 'int main()': a.cc:62:28: error: no match for 'operator&' (operand types are 'std::basic_ostream<char>' and 'int') 62 | cout<<ans[i][t]&1?'#':'.'; | ^~ | | | int a.cc:62:28: note: candid...
s065986081
p04007
C++
#include <bits/stdc++.h> using namespace std; int main(){ int h,w; char c[500][500]; cin>>h>>w; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>c[i][j]; } } char r[500][500]; char b[500][500]; for(int i=0;i<h;i++){ if(i%2){ for(int j=0;j<w-1;j++){ r[i][j]=‘#’; } ...
a.cc:17:17: error: extended character ‘ is not valid in an identifier 17 | r[i][j]=‘#’; | ^ a.cc:17:18: error: stray '#' in program 17 | r[i][j]=‘#’; | ^ a.cc:17:19: error: extended character ’ is not valid in an identifier 17 | r[i][j]=‘#’; ...
s619329348
p04007
C++
def recover(purple): h = len(purple) w = len(purple[0]) red = [] blue = [] for i in xrange(h): if (i&1)==0: red.append(['#' for j in xrange(w-1)]+['.']) blue.append(['.' for j in xrange(w-1)]+['#']) else: red.append(['#']+['.' for j in xrange(w-1)]...
a.cc:27:11: error: empty character constant 27 | print '' | ^~ a.cc:31:14: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 31 | if __name__=='__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def recover(purple): ...
s317998244
p04007
C++
#include<iostream> #include<cstring> #include<cstdio> #include<vector> #define MN 100000 #define ll long long using namespace std; inline int read() { int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar(); return x*f; } char...
/tmp/ccc0MQkm.o: in function `Check(int)': a.cc:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccc0MQkm.o a.cc:(.text+0x23): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccc0MQkm.o a.cc:(.text+0x3b): relocation ...
s659398036
p04007
C++
#include <bits/stdc++.h> typedef long long int ll; #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define EREP(i, n) for (int i = (n)-1; i >= 0; --i) #define mod 1000000007 #define pb(a) push_back((a)) #define INF 93193111451418101 #define MIN -93193111451418101 #define EPS 1e-11 //#...
a.cc:23:4: error: expected unqualified-id before numeric constant 23 | ll 4x[]={0,1,0,-1,0}; | ^~ a.cc: In function 'int main()': a.cc:45:7: error: 'class std::queue<std::pair<long long int, long long int> >' has no member named 'push_back' 45 | q.push_back(P(i,j)); | ^~~~~~~~~ a.cc:45:19...
s869375614
p04007
C++
include <bits/stdc++.h> typedef long long int ll; #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define EREP(i, n) for (int i = (n)-1; i >= 0; --i) #define mod 1000000007 #define pb(a) push_back((a)) #define INF 93193111451418101 #define MIN -93193111451418101 #define EPS 1e-11 //#d...
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc:13:9: error: 'pair' does not name a type 13 | typedef pair<ll, ll> P; | ^~~~ a.cc:21:1: error: 'll' does not name a type 21 | ll h,w; | ^~ a.cc: In function 'int main()': a.cc:25:5: error: 'cin...
s812355610
p04007
C++
#include <bits/stdc++.h> #define rep(i, a, n) for(int i = a; i < n; i++) #define REP(i, n) rep(i, 0, n) #define repb(i, a, b) for(int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define int long long #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) using namespace std; typedef pair<int, int...
a.cc:2:22: error: expected unqualified-id before 'for' 2 | #define rep(i, a, n) for(int i = a; i < n; i++) | ^~~ a.cc:32:5: note: in expansion of macro 'rep' 32 | rep(i, 0, h){ | ^~~ a.cc:32:9: error: 'i' does not name a type 32 | rep(i, 0, h){ | ^ a....
s290158801
p04007
C++
#pragma region include #include <iostream> #include <iomanip> #include <stdio.h> #include <sstream> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <cstring> #include <vector> #include <tuple> #include <bitset> #include <queue> #include <complex> #include <set> #include <map> #inc...
a.cc: In function 'void solve()': a.cc:51:9: error: 'UnionFind' was not declared in this scope 51 | UnionFind uf(H*W); | ^~~~~~~~~ a.cc:60:33: error: 'uf' was not declared in this scope 60 | uf.add((h-1)*W + w,h*W + w); | ...
s796183194
p04007
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s475268195
p04007
C++
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) #define forE(i,x) for(int i=head[x];i!=-1;i=ne[i]) using namespace std; typedef long long i64; typedef unsigned long long u64; typedef unsigned u32; typedef pair<int,int> pin; #define mk(a,b) make_pair(a,b)...
a.cc:33:35: error: expected initializer before '\U0000ff1a' 33 | char s1[maxn][maxn],s2[maxn][maxn]: | ^~ a.cc: In function 'int main()': a.cc:36:14: error: 'n' was not declared in this scope; did you mean 'yn'? 36 | read(n);read(m); | ^ | ...
s416425044
p04007
C++
#include<bits/stdc++.h> using namespace std; int N, M; char sir[509][509]; bool A[509][509], B[509][509]; int main () { //freopen ("input", "r", stdin); //freopen ("output", "w", stdout); scanf ("%d %d\n", &N, &M); for (int i=1; i<=N; i++) gets (sir[i] + 1); for (int i=1; i<=N; i++) for (int j=1; j<=M; j++)...
a.cc: In function 'int main()': a.cc:16:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 16 | gets (sir[i] + 1); | ^~~~ | getw
s677170271
p04008
C++
#include<iostream> #include<iomanip> #include<cmath> #include<string> #include<cstring> #include<vector> #include<list> #include<algorithm> #include<map> #include<set> #include<queue> #include<stack> using namespace std; typedef long long ll; #define fi first #define se second #define mp make_pair #define mt make_tuple...
a.cc: In function 'int main()': a.cc:52:3: error: 'prepare' was not declared in this scope 52 | prepare(); | ^~~~~~~ a.cc:61:8: error: 'ok' was not declared in this scope 61 | if(ok[arr[i].se]) continue; | ^~ a.cc:66:10: error: 'ok' was not declared in this scope 66 | if(ok[now...
s832278668
p04008
C++
#include <bits/stdc++.h> using namespace std; #define pb push_back const int N = 100100; int n, k, ans, par[N]; vector<int> g[N]; int dfs(int v, int p = -1) { int res = 0; for (int to: g[v]) { if (to == p) continue; res = max(res, dfs(to, v)); } if (res == k - 1 && par[v] != 1) { ans++; return 0; } re...
a.cc: In function 'int main()': a.cc:29:29: error: 'x' was not declared in this scope 29 | else ans += x != 1; | ^
s512195024
p04008
C++
#include <bits/stdc++.h> using namespace std; #define pb push_back const int N = 100100; int n, k, ans; vector<int> g[N]; bool used[N]; void dfs(int v, int d = 0) { used[v] = true; if (d - mns == k + 1) { ans++; d = 0; } for (int to: g[v]) if (!used[to]) dfs(to, d + 1); } int main() { cin >> n >> k; fo...
a.cc: In function 'void dfs(int, int)': a.cc:14:17: error: 'mns' was not declared in this scope; did you mean 'ans'? 14 | if (d - mns == k + 1) { | ^~~ | ans
s282779080
p04008
C++
#include <bits/stdc++.h> using namespace std; #define pb push_back const int N = 100100; int n, k, ans; vector<int> g[N]; bool used[N]; void dfs(int v, int d = 0) { used[v] = true; if (d - mns == k + 1) { ans++; d = 0; } for (int to: g[v]) if (!used[to]) dfs(to, d + 1, mns); } int main() { cin >> n >> k...
a.cc: In function 'void dfs(int, int)': a.cc:14:17: error: 'mns' was not declared in this scope; did you mean 'ans'? 14 | if (d - mns == k + 1) { | ^~~ | ans a.cc:19:47: error: 'mns' was not declared in this scope; did you mean 'ans'? 19 | if (!u...
s109100532
p04008
C++
#include <iostream> #include <vector> #include <map> #include <set> #include <queue> #include <algorithm> #include <cassert> #include <bitset> #include <fstream> #include <cstring> #include <stack> using namespace std; #define fst first #define snd second #define pb push_back #define mp make_pair #define ll long long...
a.cc:23:15: error: 'acos' was not declared in this scope 23 | const ld pi = acos(-1); | ^~~~
s058966407
p04008
C++
#include <bits/stdc++.h> using namespace std; typedef long long llo; #define mp make_pair #define pb push_back #define a first #define b second //#define endl '\n' int n,k; int it[100001]; vector<int> adj[100001]; int co=0; int ss[100001]; int endd[100001]; vector<pair<int,int>> ss3; int par[100001]; set<int> cur2; ...
a.cc: In function 'int main()': a.cc:72:25: error: expected ';' before 'vis' 72 | vis[ss2[i]]=1; | ^~~
s695720512
p04008
C++
#include <iostream> #include <vector> using namespace std; const int maxSize=44000; vector<int> graph[maxSize]; bool visited[maxSize][maxSize]; int distances[maxSize][maxSize], amount, required; vector<int> exceeded; void fillingGraph() { cin>>amount>>required; int vertex0; for(int i=1; i<=amount; ++i) { cin>>ver...
/tmp/ccBA9oq2.o: in function `fillingGraph()': a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `amount' defined in .bss section in /tmp/ccBA9oq2.o a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `required' defined in .bss section in /tmp/ccBA9oq2.o a.cc:(.text+0x...
s714697224
p04008
C++
#include <iostream> #include <vector> using namespace std; const int maxSize=44000; vector<int> graph[maxSize]; bool visited[maxSize][maxSize]; int distances[maxSize][maxSize], amount, required; vector<int> exceeded; void fillingGraph() { cin>>amount>>required; int vertex0; for(int i=1; i<=amount; ++i) { cin>>ver...
/tmp/cczQfPx4.o: in function `fillingGraph()': a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `amount' defined in .bss section in /tmp/cczQfPx4.o a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `required' defined in .bss section in /tmp/cczQfPx4.o a.cc:(.text+0x...
s013178622
p04008
C++
#include <iostream> #include <vector> using namespace std; const int maxSize=400000; vector<int> graph[maxSize]; bool visited[maxSize][maxSize]; int distances[maxSize][maxSize], amount, required; vector<int> exceeded; void fillingGraph() { cin>>amount>>required; int vertex0; for(int i=1; i<=amount; ++i) { cin>>ve...
/tmp/ccrv7OdW.o: in function `fillingGraph()': a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `amount' defined in .bss section in /tmp/ccrv7OdW.o a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `required' defined in .bss section in /tmp/ccrv7OdW.o a.cc:(.text+0x...
s512665529
p04008
C++
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<queue> #include<vector> #include<stack> #include<map> #include<deque> #include<set> #define inf 1e9 #define eps 1e-6 #define N 200010 using namespace std; typedef long long ll; typedef unsigned long long ull; inline ll re...
a.cc: In function 'void dfs(int)': a.cc:35:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 35 | for(register int i=head[now];i;i=e[i].next) | ^ a.cc: In function 'int main()': a.cc:46:26: warning: ISO C++17 does not allow 'register' storage...
s379444523
p04008
C++
#include<bits/stdc++.h> #define ll long long #define N 100010 using namespace std; int n,a[N],k,ans; int dfn[N],size[N],tot,fk[N],sonk[N],f[N],dep[N]; int s[N],cnt; int t[N<<2]; struct member { int x; }; bool operator <(const member &x,const member &y) { return dep[x.x]<dep[y.x]; } priority_queue<member> qx[N]; struc...
a.cc: In function 'void dfs(int, int, int)': a.cc:31:9: error: reference to 'size' is ambiguous 31 | size[x]=1; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++...
s364529949
p04008
C++
#include<cstdio> using namespace std; typedef const int& cint; const int MAXN = 100010; int N, K, ans; struct Edge{ int to, nxt; Edge(){} Edge(cint to_, cint nxt_){to = to_, nxt = nxt_;} }ed[MAXN << 1]; int head[MAXN], tot; int par[MAXN], dep[MAXN], mx[MAXN]; inline void add(cint u, cint v){ ed[++tot] = Edg...
a.cc:24:8: error: ISO C++ forbids declaration of 'chkmax' with no type [-fpermissive] 24 | inline chkmax(int& a, int b){if (b > a) a = b;} | ^~~~~~ a.cc: In function 'int chkmax(int&, int)': a.cc:24:47: warning: no return statement in function returning non-void [-Wreturn-type] 24 | inline chkmax(int...
s364457382
p04008
C++
#include <iostream> #include <vector> #include <queue> using namespace std; typedef pair<int, int> P; struct Graph { int n; vector<vector<int>> g; Graph(int n) : n(n){ g.resize(n); } void init(int n_){ n = n_; g.resize(n_); } void add_edge(int from, in...
a.cc: In function 'int main()': a.cc:88:5: error: 'sort' was not declared in this scope; did you mean 'short'? 88 | sort(p, p + n, greater<P>()); | ^~~~ | short
s170025943
p04008
C++
//#include<bits/stdc++.h> #include<iostream> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <queue> #include <deque> #include <map> #include <stack> #include<bitset> #include<list> #include<cassert> #include<numeric> using namespace std; const int N = 1e5 + 5; vector<int> rgraph[N]; v...
a.cc: In function 'int main()': a.cc:115:9: error: 'memset' was not declared in this scope 115 | memset(mark, 0, sizeof mark); | ^~~~~~ a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 14 | #include<numeric> +++ |+#include <...
s281113254
p04008
C++
//#include<bits/stdc++.h> #include<iostream> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <queue> #include <deque> #include <map> #include <stack> #include<bitset> #include<list> #include<cassert> #include<numeric> using namespace std; const int N = 1e5 + 5; vector<int> rgraph[N]; v...
a.cc: In function 'int main()': a.cc:150:9: error: 'memset' was not declared in this scope 150 | memset(mark, 0, sizeof mark); | ^~~~~~ a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 14 | #include<numeric> +++ |+#include <...
s521399888
p04008
C++
#include<vector> #include<algorithm> #include<string> using namespace std; #define int long long int ans, K, X; int dfs(vector<vector<int>> & tree, int depth, int now, int per){ int maximum = depth; for(int next : tree[now]){ maximum = max(maximum, dfs(tree, depth+1, next, now)); // cout<<now<<" -> "<<n...
a.cc: In function 'int main()': a.cc:46:3: error: 'cin' was not declared in this scope 46 | cin>>N>>K; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<string> +++ |+#include <iostream> 4 | using namespace st...
s834485378
p04008
C++
int LongestIncreasingSubsequenceLength(std::vector<int>& v) { if (v.size() == 0) return 0; std::vector<int> tail(v.size(), 0); int length = 1; // always points empty slot in tail tail[0] = v[0]; for (int i = 1; i < v.size(); i++) { // Do binary sea...
a.cc:1:45: error: 'vector' is not a member of 'std' 1 | int LongestIncreasingSubsequenceLength(std::vector<int>& v) | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vecto...