criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

using namespace std;

int my_abs_A(int num) {
    if (num > 0)
        return num;
    else
        return -num;
}

int my_abs_B(long long num,long long numb) {
    if (num - numb >= 0)
        return num - numb;
    else
        return -1 * (num - numb);
}

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}

long long lcm(long long a, long long b) {
    return a * b / gcd(a, b);
}

int main() {
    long long A, B, C;
    cin >> A >> B >> C;
    vector<long long> ans(A);
    if (C == 1000000000) {
        ok = false;
    }
    
    for (long long i = 0; i < B; i++) {
        ans.at(i) = C;
    }
    if (ok == true) {
        C = C + 1;
    }
    else {
        C = 1;
    }
    
    for (long long j = B; j < A; j++) {
        ans.at(j) = C;
    }
    for (long long k = 0; k < A; k++) {
        cout << ans.at(k) << " ";
    }
    cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:9: error: 'ok' was not declared in this scope
   49 |         ok = false;
      |         ^~
a.cc:55:9: error: 'ok' was not declared in this scope
   55 |     if (ok == true) {
      |         ^~
Language: C

#include <bits/stdc++.h>
using namespace std;
int main(){
int a,s,d;
  cin >>a >>s >>d;
  for(int q=0;q<s;q++){
  cout << d <<" " ;
  }for(int q=a-s;q>0;q--){
  cout <<d-1<<" ";}
  return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <stdio.h>
int main(){
int a,s,d;
  scanf(%d%d%d,&a,&s,&d);
  for(int q=0;q<s;q++){
  frintf(%d%s,d);
  }for(int q=a-s;q>0;q++){
  printf(%d%s,d-1);
  }
return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define int int64_t
#define double long double
#define rep(i, N) for(int i=0; i<N; i++)
#define repr(i, N) for(int i=N-1; i>=0; --i)
#define all(v) v.begin(),v.end() 
using namespace std;
//using pr = pair<int, int>;
using tup  = tuple<int, int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;

//プロトタイプ宣言

//グローバル変数
const int INF = 1000000000;
//const int MAX_N = ;
//const int MAX_M = ;
//vvec dp(MAX_N, vec(MAX_M));

//関数：
/* メイン・プログラム */
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, k, s; cin >> n >> k >> s;
	vec ans(n);
	
	//if(s <= n-k+1) {
	//	rep(i, s+k-1) ans[i] = 1;
	//	for(int i=s+k-1; i<n; i++) ans[i] = 0;
	//} else {
	//	int tp = s/(n-k+1);
	
	//	rep(i, n-k) {
	//		ans[i] = tp;
	//	}
	//	ans[n-k] = s - ((s/(n-k+1)) * (n-k));
	//	for(int i=n-k+1; i<n; i++) {
	//		ans[i] = tp;
	//	}
	//}
	
	rep(i, n) {
		if(i < k) ans[i] = s;
		if(s != 1) s--; else s++;
		else ans[i] = s;
	}
	
	rep(i, n) {
		cout << ans[i] << ' ';
	}
	cout << endl;
	return 0;
}

/*	(n * m) % dvs = ((n%dvs) * (m%dvs)) % dvs
*/

//std::string str;
//str = std::to_string(int i);
//bitset<3> s(N);
//int ans = (char)grid - '0';
//int id = lower_bound(all(arr), x) - arr.begin();
//cout << fixed << setprecision(10) << tld << endl;
//vector<int> sub(itr,itr+d); //イテレーターで部分数列(i=0...d)を指定

/*	struct data {
	char *name;
	int age;
	int height;
	double weight;
};*/

/*	string ans(lgd, '0');
	string &refer = ans;
	for(int i=0; i<lgd; i++) refer[i] = (char)vd[i] + '0';*/

/*	map<int,int> mp;
for(auto p : mp) {
	ct += p.second*(p.second-1); }

map<int,int>::iterator itr;
for(itr = mp.begin(); itr != mp.end(); itr++) {
	ans += itr->second * (itr->second-1);
}*/


Compiler output:
a.cc: In function 'int main()':
a.cc:49:17: error: 'else' without a previous 'if'
   49 |                 else ans[i] = s;
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const double eps = 1e-9;

int main()
{
    ll N, K, S, tmp = 10^9;
    cin >> N >> K >> S;
    if (S == 10^9) tmp = 1;
    for (int i = 0; i < K; i++) cout << S << " ";
    for (int i = K; i < N; i++) cout << t,p << " ";
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
   11 |     ll N, K, S, tmp = 10^9;
      |                         ^
      |                       ---
      |                       1e
a.cc:11:23: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   11 |     ll N, K, S, tmp = 10^9;
      |                       ^~
      |                       0xa
a.cc:15:41: error: 't' was not declared in this scope
   15 |     for (int i = K; i < N; i++) cout << t,p << " ";
      |                                         ^
a.cc:15:43: error: 'p' was not declared in this scope
   15 |     for (int i = K; i < N; i++) cout << t,p << " ";
      |                                           ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
int main() {
	int N, K, S;
	cin >> N >> K >> S;
	vector<int>A(N);
	A.at(0) = S;
	long long count;
	else count = 1;
	for (int i = 1; i < N; i++) {
		if (count != K) {
			A.at(i) = S;
			count++;
		}
		else {
			A.at(i) = (S == 1 ? 2 : S - 1);
		}
	}
	for (int i = 0; i < N; i++) {
		cout << A.at(i);
		if (i != N - 1) cout << ' ';
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'else' without a previous 'if'
    9 |         else count = 1;
      |         ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)

int main(){
    ll n,k,s;
    cin >> n >> k >> s;
    for (ll i=0;i <n;i++){
        if (i < k) cout << s << " ";
        else {
            if (s-1 ==0) s++;
            cout << s-1 << " ";
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

//
//  atcoder.cpp
//
//
///
#include <bits/stdc++.h>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/bimap/bimap.hpp>
#include <boost/bimap/multiset_of.hpp>
#include <boost/multi_array.hpp>
#include <boost/math/common_factor.hpp>
#include <boost/algorithm/string.hpp>

#define REP(i, N) for(int i=0; i<(N); i++)
#define REC(f, ...) (void)0; const auto f = [&](const auto f, __VA_ARGS__)
using namespace std;
using namespace boost::math;

using ll = long long;
namespace bst = boost;
template<typename T> class in {
    T value;
public:
    in() { cin >> value; }
    operator const T&() const { return value; }
    operator T&() { return value; }
    in& operator=(T source) { value = source; return *this; }
};
template<> class in<string> : public string {
public:
    in() { cin >> *this; }
};
template<class T> class inseq : public T {
public:
    template<typename... Arg> inseq(Arg... arg) : T(forward<Arg>(arg)...) { for (auto&& i : *this) cin >> i; }
};
template<class T> using invec = inseq<vector<T>>;

auto solve() {
  in<ll> N,K,S;
  vector<ll> r(N);
  ll hoge = 1;
  for (int i = 0; i < N; i++) {
    if (i < K)
      r[i] = (i % 2) ? hoge : S - hoge;
    else
      r[i] = (S ? 1) ? 2 : S - 1;
  }
  
    


  for (auto i : r)
    cout << i << endl;
}

template<typename T> void plot(const T& func) { cout << func() << endl; }
template<> void plot<void()>(void(&func)()) { func(); }

int main() {
  plot(solve);

  return 0;
}




Compiler output:
a.cc:7:10: fatal error: boost/optional.hpp: No such file or directory
    7 | #include <boost/optional.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >>N;
  vector<int>X(N);
  vector<int>L(N);
  vector<int>S(N);
  for(int i=0;i<N;i++){
    cin>>X[i]>>L[i];
    S[i]=X[i]+L[i];
  }
  for(int i=N-2;i>0;i--){
    if(S[i]>=)
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected primary-expression before ')' token
   15 |     if(S[i]>=)
      |              ^
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <cstdio>
#include <numeric>

using namespace std;

using ll=long long;

vector<ll> v;
ll N,K,S;

int main()
{
    cin >> N >> K >> S;
    v.resize(N);
    fill(v.begin(), v.end(), 1);
    if(K == 0)
    {
        if( S+1 <= 1e9)
        {
            fill(v.begin(), v.end(),S+1);
        }
        else
        {
            fill(v.begin(), v.end(),1);
        }
    }
    else if(K == N)
    {
        fill(v.begin(), v.end(),S);
    }
    else if(N == 1)
    {
        v[0] = S;
    }
    else
    {
        if(S == 1)
        {
            fill(v.begin()+K, v.end(), 2);
        }
        else
        {
            ll cnt = 0;
            ll d;
            if(S == 3)
            {
                d = 10
            }
            else
            {
                d = 2;
            }
            fill(v.begin(), v.end(), d);
            v[0] = S-d;
            for(int i = 1; i < N;i++)
            {
                if(i % 2 == 1)
                {
                    v[i] = d;
                }
                else
                {
                    v[i] = S-d;
                }
                cnt++;
                if(cnt >= K)
                {
                    break;
                }
            }
        }
    }
    for(int i = 0;i < N - 1;i++)
    {
        cout << v[i] << " ";
    }
    cout << v[N-1] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:23: error: expected ';' before '}' token
   53 |                 d = 10
      |                       ^
      |                       ;
   54 |             }
      |             ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 5;
ll a[N];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k, s;
	cin >> n >> k >> s;
	for (int i = 1; i <= k; i++) {
		a[i] = s;
	}
	if (n - k < s) {
		for (int i = k + 1; i <= n; i++) {
			a[i] = 1;
		}
	} else {
		for (int i = k + 1; i <= n; i++) {
			a[i] = min(s + 1, 1e9);
		}
	}
	for (int i = 1; i <= n; i++) {
		cout << a[i] << " ";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:35: error: no matching function for call to 'min(ll, double)'
   22 |                         a[i] = min(s + 1, 1e9);
      |                                ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:22:35: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'double')
   22 |                         a[i] = min(s + 1, 1e9);
      |                                ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:22:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |                         a[i] = min(s + 1, 1e9);
      |                                ~~~^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int i,j,n,k;
  long long int s;
  cin>>n>>k>>s;
  for(i=0;i<k;i++)
  {
    cout<<s<<" ";
  }
  int a=0;
  for(i=n-1;i>=k;i--)
  {
    if(a==0)
    {
      if(s!=2)
      cout<<"1"<<" ";
      else
      {
        cout<<"5"<<;
      }
    }
    else if(a==1)
    {
      if(s!=1000000000)
      cout<<s+1<<" ";
      else
      {
        cout<<s-1009<<" ";
      }
    }
    a=1-a;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: expected primary-expression before ';' token
   21 |         cout<<"5"<<;
      |                    ^
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main(){
    int N,K,S;
    cin >> N >> K >> S;
    if (S > N - K){
        rep(i,N){
            if (i <= K - 1) cout << S << ' ';
            else cout << 1 << ' ';
        }
    }
    else if (S <= N - K){
        if (i < N - 1) cout << S << ' ';
        else if (N - 1 <= i && i < N - 1 + K) cout << 1 << ' ';
        else cout << 1000000001 << ' ';
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         if (i < N - 1) cout << S << ' ';
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;


int main(){
	int n,k,S;
	
	
	cin >> n >> k >> S;
	for(int i=1;i<=k;i++){
		if(i!=1)
			cout << " ";
		cout << s;
	}
	if(s==1e9)
		s-=2;
	
	
	for(int i=k+1;i<=n;i++){
		cout << " " << s+1;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 's' was not declared in this scope
   13 |                 cout << s;
      |                         ^
a.cc:15:12: error: 's' was not declared in this scope
   15 |         if(s==1e9)
      |            ^
a.cc:20:32: error: 's' was not declared in this scope
   20 |                 cout << " " << s+1;
      |                                ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
#include <array>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define INF I64_MAX
#define MOD 1000000007
#define MEM_SIZE = 1e5+5;

template<typename T> void DEBUG(T e){std::cout <<"DEBUG>>"<< e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ DEBUG(v); } }

//-----CODE------//

void solve(void)
{
  int N,K,S;
  cin>>N>>K>>S;

  vector<int> ANS(N,0);
  if(K == N)
  {
    for (int i = 0; i < N; i++)
    {
      if(i!=0)cout<<" ";
      cout<<S;
    }
    cout<<endl;
    return;
  }

  for (int i = 0; i < N; i++)
  {

    if(i <= K)
    {
    ANS[i] =  S/2;
    if(S%2 == 1)
    {
      if(i%2 == 1)
      {
        
        ANS[i]++;
      }
    }
      if((K == 0)&&(S == 1e9))
      {
        ANS[i] = 999999999;
      }
    }
    else
    {
      if(S != 1e9)
      {
        ANS[i] = 1;
      }
      ANS[i] = 1e9;
      else
      {
        ANS[i] = 999999999;
      }
      
    }
  }
  for (int i = 0; i < N; i++)
  {
    if(i!= 0)cout<<" ";
    cout<<ANS[i];
  }
  cout<<endl;
  
  
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // std::cout << std::fixed;
  // std::cout << std::setprecision(8);
  solve();

 
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:80:7: error: 'else' without a previous 'if'
   80 |       else
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
#define INF 1000000000
using namespace std;

int main() {

    int64_t N,K,S;
    cin >> N>>K>>S;
  if(S!=1000000000){
for(int i=0; i<K;i++){
    cout<<S; if(i!=N-1)cout<<" ";}
  for(int i=0; i<N-K;i++){
    cout<<S+1;if(i!=N-1-K)cout<<" ";}
  cout<<endl;}
  else{for(int i=0; i<K;i++){
    cout<<S; if(i!=N-1)cout<<" ";}
  for(int i=0; i<N-K;i++){
    cout<<1;if(i!=N-1-K)cout<<" ";}
  cout<<endl;}}
}
    


Compiler output:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C

#include <stdio.h>

int main()
{
    int n,k,s;
    scanf("%d %d %d",&n,&k,&s);

    int i;
    for (i = 0; i < k; i++)
    {
        printf("%d ",s);
    }
    for (; i < n; i++)
    {
        printf("%d ",s != 1 ? s - 1 ? 2);
    }
    
    
}


Compiler output:
main.c: In function 'main':
main.c:15:40: error: expected ':' before ')' token
   15 |         printf("%d ",s != 1 ? s - 1 ? 2);
      |                                        ^
      |                                        :
Language: C

#include <iostream>
#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{   long long int n,i,k,s,flag=0;
   scanf("%lld %lld %lld",&n,&k,&s);
   if(k==0)
   {   for(i=0;i<n;i++)
        {if(flag==0)printf("%lld",s+100),flag=1;
          else printf(" %lld",s+100);}
   }
  else{
   for(i=1;i<=k;i++)
   {  if(flag==0)printf("%lld",s),flag=1;
      else printf(" %lld",s);
   }
   for(i=k;i<n;i++)printf(" %lld",s+100);
  }

    return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#define _USE_MATH_DEFINES // M_PI
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define rREP(i,a,n) for(int (i)=(n)-1; (i)>=(a);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 2147483647;
constexpr ll mod = 1000000007;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N, K, S; cin >> N >> K >> S;
	vector<int>ans(N, S - 1);
	if (S == 1) {
		rep(i, n)ans[i]++;
	}
	rep(i, K)ans[i] = S;
	rep(i, N) {
		cout << ans[i] << (i == N - 1 ? "\n" : " ");
	}
	




	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:24: error: 'n' was not declared in this scope
   40 |                 rep(i, n)ans[i]++;
      |                        ^
a.cc:6:47: note: in definition of macro 'REP'
    6 | #define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
      |                                               ^
a.cc:40:17: note: in expansion of macro 'rep'
   40 |                 rep(i, n)ans[i]++;
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);

	int n,k,d;
	cin >> n;
	cin >> k;
	cin >> s;
  	
  for (int i = 0; i < n; i++)
  {
    if (i < k) cout << s;
    else cout << 0;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 's' was not declared in this scope
   10 |         cin >> s;
      |                ^
Language: C++

import java.util.*;
import java.io.*;
public class GFG{
   
public static void main (String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int k=sc.nextInt();
    int s=sc.nextInt();
    if(k==0)
    {
        if(s==1)
        {
            for(int i=0;i<n;i++)
            System.out.print((s+1)+" ");
            System.out.println();
        }
        if(s!=1)
        {
             for(int i=0;i<n;i++)
            System.out.print((s-1)+" ");
            System.out.println();
        }
    }
    if(k==n)
    {
            for(int i=0;i<n;i++)
            System.out.print(s+" ");
            System.out.println();
    }
    if(k>0&&k<n)
    {
        for(int i=0;i<k;i++)
        System.out.print(s+" ");
        for(int i=k;i<n;i++)
        System.out.print((s!=1000000000?s+1:s-1)+" ");
        System.out.println();
    }
}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class GFG{
      | ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
const ll MOD = 1000000007;
const int MAX = 100000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }


int main(){
    int N,K,S; cin >> N >> K >> S;
    bool f=false;
    if(K==N) f=true;
    int cnt=0;
    for(int i=0;i<N;i++){
        if(i<K) cout << S << " ";
        else{
            if(S==1) cout << S+1 << " ";
            else cout << S-1 << " ";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:60:11: note: to match this '{'
   60 | int main(){
      |           ^
Language: Java

package keyence2020;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class MainC {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int s = sc.nextInt();
		sc.close();
		if (k == 0) {
			List<String> list = new ArrayList<>();
			String string = String.valueOf(s + 1);
			for (int i = 0; i < n; i++) {
				list.add(string);
			}
			System.out.println(String.join(" ", list));
		} else if (k <= n) {
			List<String> list = new ArrayList<>();
			String just = String.valueOf(s);
			for (int i = 0; i < k; i++) {
				list.add(just);
			}
			String string = String.valueOf(s + 1);
			for (int i = 0; i < n - k; i++) {
				list.add(string);
			}
			System.out.println(String.join(" ", list));
		}
	}
}


Compiler output:
Main.java:7: error: class MainC is public, should be declared in a file named MainC.java
public class MainC {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  long n,k,s;
  cin >> n >> k >> s;
  vector<int> ans(n,0);
  for(int i; i<k; i++){
    ans[i]=s;
  }
  for(int j; j<n;j++){
    cout << ans[j] << " ";
  }
  cout << << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected primary-expression before '<<' token
   14 |   cout << << endl;
      |           ^~
Language: Java

package keyence2020;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class MainC {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int s = sc.nextInt();
		sc.close();
		if (k == 0) {
			List<String> list = new ArrayList<>();
			String string = String.valueOf(s - 1);
			for (int i = 0; i < n; i++) {
				list.add(string);
			}
			System.out.println(String.join(" ", list));
		} else if (k <= n) {
			List<String> list = new ArrayList<>();
			String just = String.valueOf(s);
			for (int i = 0; i < k; i++) {
				list.add(just);
			}
			String string = String.valueOf(1000000001);
			for (int i = 0; i < n - k; i++) {
				list.add(string);
			}
			System.out.println(String.join(" ", list));
		}
	}
}


Compiler output:
Main.java:7: error: class MainC is public, should be declared in a file named MainC.java
public class MainC {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
typedef long long ll;
using namespace std;
int main(void){
    ll n,k,s;cin>>n>>k>>s;
    vector<ll> a(n);
    rep(i,k) a[i]=s;
    for(int i=k;i<n;i++){
        if(s!=1e+9)a[i]=s+1;
        else a[i]=a[i]=s-1;
    rep(i,n)cout<<a[i]<<" ";
    cout<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:6:15: note: to match this '{'
    6 | int main(void){
      |               ^
Language: C++

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define endl "\n"
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main(){
  ll n,k,s;
  cin>>n>>k>>s;
  vector<ll> ans;
  if(s!=100000000){
    rep(i,0,k){
      ans.pb(s);
    }
    rep(i,0,n-k){
      ans.pb(1000000000);
    }
  }
  else{
    assert(false);
  }
  rep(i,0,ans.sz){
    cout << ans[i];
    if(i!=ans.sz-1)cout << " ";
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:5: error: 'assert' was not declared in this scope
   53 |     assert(false);
      |     ^~~~~~
a.cc:19:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   18 | #include <utility>
  +++ |+#include <cassert>
   19 | #include <vector>
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main()
{
    ll n,k,s;
    cin>>n>>k>>s;
    if(s==pow(10,9))
    {
        for(int i=0;i<n;i++)
        {
            if(i<k)
            cout<<s<<" ";
            else
            cout<<1<<" ";
        }
    }
    else
    {
        for(int i=0;i<n;i++)
        {
            if(i<k)
            cout<<s<<" ";
            else
            cout<<s+1<<" ";
        }
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'll' was not declared in this scope
    6 |     ll n,k,s;
      |     ^~
a.cc:7:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     cin>>n>>k>>s;
      |          ^
      |          yn
a.cc:7:13: error: 'k' was not declared in this scope
    7 |     cin>>n>>k>>s;
      |             ^
a.cc:7:16: error: 's' was not declared in this scope
    7 |     cin>>n>>k>>s;
      |                ^
Language: C++

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define endl "\n"
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main(){
  ll n,k,s;
  cin>>n>>k>>s;
  vector<ll> ans;
  if(s!=100000000){
    rep(i,0,k){
      ans.pb(s);
    }
    rep(i,0,n-k){
      ans.pb(1000000000);
    }
  }
  else{
    aseert(false);
  }
  rep(i,0,ans.sz){
    cout << ans[i];
    if(i!=ans.sz-1)cout << " ";
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:5: error: 'aseert' was not declared in this scope
   53 |     aseert(false);
      |     ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const int MOD = 1e9+7;


#define REP(i, N) for (int i = 0; i < (N); i++)
#define REPP(i, a, b) for (int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define VSORT(c) sort((c).begin(),(c).end())
#define SZ(x) ((int)(x).size())
//vvintを作る　マクロで　 #define vvint(N,M) vector<vector<int>>

using namespace std;


int main(){
    
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N,K,S;
    cin >> N >> K >> S;
    ll ans[N];

    for(ll i = 0; i < N;i++){
        if(i < K){
            ans[i] = S;
        }else{
            ans[i] = (S+1)%1e9;
        }
    }

    for(ll i = 0; i < N;i++){
        cout << ans[i] <<  " ";
    }
    cout << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:27: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   45 |             ans[i] = (S+1)%1e9;
      |                      ~~~~~^~~~
      |                        |   |
      |                        |   double
      |                        ll {aka long long int}
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define vector2(a,b,c) vector<vector<int>> a(b/*縦！w*/,vector<int>(c/*横！w*/))
#define INF 1e10
#define MOD 1e9+7
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; }
using Graph = vector<vector<int>>;
signed main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(c!=1000000000){
  rep(i,a){
    if(b<i)
      cout<<1000000000<<' ';
    else if(i%2==0)
  cout<<c/2<<' ';
    else
  cout<<c-c/2<<' ';
  }
    }
  else{
   rep(i,a){
    if(b<i)
      cout<<1<<' ';
    else if(i%2==0)
  cout<<c/2<<' ';
    else
  cout<<c-c/2<<' ';
  }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:18:14: note: to match this '{'
   18 | signed main(){
      |              ^
Language: Java

import java.util.*;

//update 2020/1/1 23:01

public class C{

  static Scanner sc = new Scanner(System.in);
  static StringBuilder sb = new StringBuilder();

  public static void main(String[] args) {

    int n = nextInt();
    int k = nextInt();
    int s = nextInt();

    if(s%2==0){ //sが偶数
      for(int i=0;i<n;i++){
        if(i<=k){
          System.out.print(s/2+" ");
        }
        else{
          System.out.print(2*s+" ");
        }
      }
    }






    //System.out.println();

  }
  /*
    static String toSmall(String s){
      char c = s.charAt(0);
      //if(Character.isUpperCase(c)){
      if(c<=90){
        c += 32;
      }
      return String.valueOf(c);
    }
    static String toBig(String s){
      char c = s.charAt(0);
      //if(Character.isLowerCase(c)){
      if(c>=97){
        c -= 32;
      }
      return String.valueOf(c);
    }
  */

  static String toSmall(String s){
    return s.toLowerCase();
  }

  static String toBig(String s){
    return s.toUpperCase();
  }

  static String next(){
    return sc.next();
  }

  static int nextInt(){
    return Integer.parseInt(sc.next());
  }

  static long nextLong(){
    return Long.parseLong(sc.next());
  }

  static double nextDouble(){
    return Double.parseDouble(sc.next());
  }

  static String[] splitString(String s){
    return s.split("");
  }

  static char[] splitChar(String s){
    return s.toCharArray();
  }

  static int charToInt(char a){
    return a - 48;
  }

////////////////////////////////////////////
  public static int max(int[] a){
    int lng = a.length;
    int max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
  public static long max(long[] a){
    int lng = a.length;
    long max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
////////////////////////////////////////////

////////////////////////////////////////////
  public static int min(int[] a){
    int lng = a.length;
    int min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
  public static long min(long[] a){
    int lng = a.length;
    long min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
////////////////////////////////////////////

}


Compiler output:
Main.java:5: error: class C is public, should be declared in a file named C.java
public class C{
       ^
1 error
Language: C++

#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <numeric>
#include <mutex>
#include <cmath>
#include <set>
#include <climits>
#include <math.h>
#define lli long long int
#define ll long long
#define mod 1000000007
#define pii pair<int,int>
#define mp make_pair

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;

int main(){
    ll N, K, S;
    cin >> N >> K >> S;
    ll a = 0;
  	ll X = S+1;
    if(S == 1e9) X = 1;
    rep(i, N){
        if(a == K) {
            cout << X << " ";
            continue;
        }
        a++;
        cout << S << " ";
    	}
    }
    return 0;
}

Compiler output:
a.cc:35:5: error: expected unqualified-id before 'return'
   35 |     return 0;
      |     ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(void) {

	int N, K, S;
	cin >> N >> K >> S;

	std::vector<long long int> A(N);

	// SをK個埋めて、他はそれ以上の数にする
	if (S != 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10) {
		for (int i = 0; i < N; i++) {
			if (i < K) {
				A[i] = S;
			}
			else {
				A[i] = S + 1;
			}
		}
	}
	else {
		for (int i = 0; i < N; i++) {
			if (i < K) {
				A[i] = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10;
			}
			else {
				A[i] = 4 21;
			}
		}
	}
	
	// 確認用
	for (int i = 0; i < N; i++) {
		cout << A[i];
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:41: error: expected ';' before numeric constant
   29 |                                 A[i] = 4 21;
      |                                         ^~~
      |                                         ;
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
 int N,K,S,i;
  scanf("%d %d %d",&N,&K,&S);
  int *A=(int*)malloc(sizeof(int)*N);
  for(i=0;i<K;i++)A[i]=S;
  if(S==1000000000)S=0;
  for(i=K;i<N;i++)A[i]=S+1;
  for(i=0;i<N;i++)printf("%d ",A[i]);
  free(a);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:8: error: 'a' undeclared (first use in this function)
   12 |   free(a);
      |        ^
main.c:12:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define mod 1000000007
#define pll pair<long long,long long>
#define pdd pair<long double,long double>
#define vll vector<ll>
#define rep(i,j,n) for(int i=j;i<n;i++)
#define mp make_pair
#define pb push_back
#define pf push_front
priority_queue<pll,vector<pll>,greater<pll> >pq;
priority_queue<ll,vector<ll>,greater<ll> >pq1;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,k,s;
    cin>>n>>k>>s;
    vector<ll>arr(n);
    for(int i=0;i<k;i++){
        arr[i]=s;
    }
    for(int j=k;j<n;j++){
        arr[i]=s+1;
    }
    for(int i=0;i<n;i++)
        cout<<arr[i]<<" ";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: 'i' was not declared in this scope
   27 |         arr[i]=s+1;
      |             ^
Language: C++

clude<bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mk make_pair
ll n, k, s;
 
int main(){
 
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
 
    cin >> n >> k >> s;
 
    for(int i = 1; i <= k; ++i){
        cout << s << ' ';
    }
    for(int i = k + 1; i <= n; ++i){
        cout << 999999999 << ' ';
    }
 
    return 0;
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude<bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:14:5: error: 'ios_base' has not been declared
   14 |     ios_base::sync_with_stdio(0);
      |     ^~~~~~~~
a.cc:15:5: error: 'cin' was not declared in this scope
   15 |     cin.tie(0);
      |     ^~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout.tie(0);
      |     ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>

typedef long long int lli;
#define rep(i,s,N) for(int i=s;i<N;i++)
using namespace std;


int main(void)
{
	int N, K;
	lli S;
	cin >> N >> K >> S;
	rep(i, 0, K)cout << S << " ";
	lli S_n = (S >= LLONG_MAX ? (S - 1) : (S + 1));
	rep(i, 0, N - K)cout << S_n << " ";
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: 'LLONG_MAX' was not declared in this scope
   21 |         lli S_n = (S >= LLONG_MAX ? (S - 1) : (S + 1));
      |                         ^~~~~~~~~
a.cc:8:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <cmath>
  +++ |+#include <climits>
    8 | #include <limits>
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n , k ,s;
  cin >> n >> k >> s;
  for(int i = 1; i<=k; i++)cout << s << " ";
  for(int i = k+1; i<=n; i++) if(s<=100)cout << (s+1) << " ";
  else cout << (s-1) << " "
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: expected ';' before 'return'
   11 |   else cout << (s-1) << " "
      |                            ^
      |                            ;
   12 |   return 0;
      |   ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)

int main() {
    int n, k, s;
    cin >> n >> k >> s;
    
    rep(i, k) {
        cout << s << " ";
    }
    int sub = (s == 123 ? 100 : 123)
    rep(i, n - k) {
        cout << sub << (i == n - k - 1 ? "\n" : " ");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: expected ',' or ';' before 'for'
    4 | #define rep(i, n) for (int i = 0; i < (n); i++)
      |                   ^~~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, n - k) {
      |     ^~~
a.cc:14:9: error: 'i' was not declared in this scope
   14 |     rep(i, n - k) {
      |         ^
a.cc:4:35: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i = 0; i < (n); i++)
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int N,K,S; cin>>N>>K>>S;
  if(S==1000000000){
    rep(i,0,K)cout<<S<<" ";
  rep(i,0,N-K)cout<<0<<" ";
  cout<<endl;
    }
  else
  rep(i,0,K)cout<<S<<" ";
  rep(i,0,N-K)cout<<S+1<<" ";
  cout<<endl;
  }
  }


Compiler output:
a.cc:26:3: error: expected declaration before '}' token
   26 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

const int INF = 1e9;

int n,k,s;

int main(){
	scanf("%d%d%d",&n,&k,&s);
	if(k==0){
		for(int i=1;i<=n;i++){
			if(i>1) printf(" ");
			if(s != INF){
				printf("%d",INF);
			} else {
				printf("1");
			}
		}
		printf("\n");
		return 0;
	}
	printf("%d",s);
	for(int i=2;i<=k;i++){
		printf(" 0");
	}
	for(int i=k+1;i<=n;i++){
		if(s==INF){
			printf(" 1");
		} else {
			printf(" %d",s+1);
		}
	}1
	printf("\n");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:11: error: expected ';' before 'printf'
   32 |         }1
      |           ^
      |           ;
   33 |         printf("\n");
      |         ~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int a[20][2], n, f[262144][19][2];
int F(int i,int j,int ok)
{
    if(f[i][j][ok]!=-1) return f[i][j][ok];
    if(i==(1<<n)-1) return 0;

    int res = 1e9, sl = 0, t = 0;
    for(int id = 1; id <= n; id++)
        if(i >> (id-1) &1) sl++;
    for(int id = 1; id <= n; id++)
    {
        if(i >> (id-1)) & 1 ^ 1)
        {
            int nok = abs(sl-id+1)%2;
            if(a[id][nok] >=a [j][ok]) res = min(res, F(i|(1<<(id-1)), id, nok) + id - t - 1);
        }
        else t++;
    }
    f[i][j][ok] = res;
    return res;
}

main()
{
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> a[i][0];
    for(int i = 1; i <= n; i++) cin >> a[i][1];

    memset(f, -1, sizeof(f));
    int ans = F(0,0,0);
    if(ans == 1e9) ans = -1;
    cout << ans;
}


Compiler output:
a.cc: In function 'int F(int, int, int)':
a.cc:16:27: error: lvalue required as unary '&' operand
   16 |         if(i >> (id-1)) & 1 ^ 1)
      |                           ^
a.cc: At global scope:
a.cc:27:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   27 | main()
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

struct Vec {
        int x, y, n, t;
        bool operator < (const Vec &temp) const {
                return x < temp.x;
        }
};

signed main () {
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;
	for(int k = 0; k <= 1; ++k)
		for(int i = 1; i <= n; ++i) cin >> a[i][k];
	for(int mask = 0; mask < (1 << n); ++mask) {
		vector<Vec> v(n + 1);
		int moves = 0, step = n;
		for(int i = 1; i <= n; ++i) v[i] = {a[i][0], a[i][1], 0, ((mask >> (i - 1)) & 1)};
		while(step > 0) {
			int mx = 0, pos = 0;
			for(int i = 1; i <= step; ++i) {
				int after = ((step - i) % 2) ^ v[i].n;
				if(after != v[i].t) continue;
				int destval = (after == v[i].n ? v[i].x : v[i].y);
				if(destval >= mx) mx = destval, pos = i;
			}
			if(pos == 0) {
                moves = 2e9;
				break;
			}
			for (int i = pos; i < step; ++i, ++moves) {
				swap(v[i].x, v[i].y);
				v[i].n ^= 1;
				swap(v[i + 1].x, v[i + 1].y);
				v[i + 1].n ^= 1;
				swap(v[i], v[i + 1]);
			}
			--step;
		}
		if(is_sorted(v.begin() + 1, v.end())) ans = min(ans, moves);
	}
	cout << (ans == 2e9 ? -1 : ans);
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 |         cin >> n;
      |                ^
      |                yn
a.cc:17:52: error: 'a' was not declared in this scope
   17 |                 for(int i = 1; i <= n; ++i) cin >> a[i][k];
      |                                                    ^
a.cc:21:53: error: 'a' was not declared in this scope
   21 |                 for(int i = 1; i <= n; ++i) v[i] = {a[i][0], a[i][1], 0, ((mask >> (i - 1)) & 1)};
      |                                                     ^
a.cc:21:97: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Vec>, Vec>::value_type' {aka 'Vec'} and '<brace-enclosed initializer list>')
   21 |                 for(int i = 1; i <= n; ++i) v[i] = {a[i][0], a[i][1], 0, ((mask >> (i - 1)) & 1)};
      |                                                                                                 ^
a.cc:4:8: note: candidate: 'constexpr Vec& Vec::operator=(const Vec&)'
    4 | struct Vec {
      |        ^~~
a.cc:4:8: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const Vec&'
a.cc:4:8: note: candidate: 'constexpr Vec& Vec::operator=(Vec&&)'
a.cc:4:8: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'Vec&&'
a.cc:43:55: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |                 if(is_sorted(v.begin() + 1, v.end())) ans = min(ans, moves);
      |                                                       ^~~
      |                                                       abs
a.cc:45:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   45 |         cout << (ans == 2e9 ? -1 : ans);
      |                  ^~~
      |                  abs
Language: C++

#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=mod*mod*3LL;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

void chmin(int &a, int b){a = min(a, b);}
int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int n, a = 1e9;
    cin >> n;
    vector<vector<int> > v(n, vector<int> (2));
    for(int i=0;i<n;i++) cin >> v[i][0];
    for(int i=0;i<n;i++) cin >> v[i][1];
    int maki = 1 << n;
    vector<vector<int> > dp(maki, vector<int> (51, a));
    p[0][0] = 0;
    for(int bit=0;bit<maki;bit++){
    	int cnt = 0;
    	vector<int> d(n);
    	for(int i=0;i<n;i++) if(!(bit>>i&1)) d[i] = cnt++;
    	for(int i=0;i<n;i++){
    		int k = abs(i - n + cnt);
    		for(int j=0;j<=v[i][k&1];j++)
    			chmin(dp[bit|(1<<i)][v[i][k&1]], dp[bit][j] + d[i]);
    	}
    }
    for(int i=0;i<50;i++) chmin(a, dp[maki-1][i]);
    cout << (a==1e9? -1: a) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'p' was not declared in this scope; did you mean 'dp'?
   21 |     p[0][0] = 0;
      |     ^
      |     dp