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

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 200025, INF = 1e18, MOD = 1000000007, K = 357, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int a, b;
    cin >> a >> b;
    cout << 100 << ' ' << 100 << '\n';
    --a, --b;
    for(int i = 0; i < 50; i++) {
        for(int j = 0; j < 100; j++) {
            if(a > 0 && (i&1) && (j&1));
                cout << '.', --a;
            else
                cout << '#';
        }
        cout << '\n';
    }
    for(int j = 0; j < 100; j++) cout << '.';
    cout << '\n';
    for(int i = 0; i < 49; i++) {
        for(int j = 0; j < 100; j++) {
            if(b > 0 && (i&1) && (j&1))
                cout << '#', --b;
            else
                cout << '.';
        }
        cout << '\n';
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: 'else' without a previous 'if'
   63 |             else
      |             ^~~~
Language: C++

//#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector") 
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
 
#include <bits/stdc++.h>
 
#define int long long
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define repb(i, r, l) for (int i = r; i >= l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define ret(a) {cout << a; exit(0);}
 
using namespace std;                                                                                  
 
mt19937 mrand(random_device{}()); 
const ll mod = 1e9 + 7;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
 
typedef pair < int , int > pii ;                                            
typedef pair < long long  , long long > pll ;
const int N = 123, K = 2e9 + 1 , L = 3e5;

int n, k, m;
string s;
int pr[N];
int sf[N];
char a[N][N];
main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	int s , t;
	cin >> s >> t;
	for(int i = 1 ;i <= 50 ; i++)
		for(int j = 1; j <= 100; j++)
			a[i][j] = '.';
	for(int i = 51 ;i <= 100 ; i++)
		for(int j = 1; j <= 100; j++)
			a[i][j] = '#';
	s-- , t--;
	for(int i = 52 ; i <= 100 ; i++){
		for(int j = 2; j <= 99; j++){
			bool ok = 1;
			if(s == 0)	
				break;
			for(int x = i - 1; x <= i + 1; x++)
				for(int y = j - 1; y <= j + 1; y++)
					if(a[x][y] == '.')
						ok = 0;
			if(ok)
				a[i][j] = '.' , s--;
        }
	}
	for(int i = 1 ; i <= 49 ; i++){
		for(int j = 2; j <= 99; j++){
			bool ok = 1;
			if(t == 0)	
				break;
			for(int x = i - 1; x <= i + 1; x++)
				for(int y = j - 1; y <= j + 1; y++)
					if(a[x][y] == '#')
						ok = 0;
			if(ok)
				a[i][j] = '#' , t--;
        }
	}
//	cerr << s << ' ' << t << '\n';
	cout << "100 100\n";
	rep(i , 1, 100){
		rep(j , 1 , 100)
			cout << a[i][j];
	cout << '\n';m
	}
			
}
 


Compiler output:
a.cc:39:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   39 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:82:23: error: expected ';' before '}' token
   82 |         cout << '\n';m
      |                       ^
      |                       ;
   83 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define bit(k) (1LL<<(k))
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = 1e9;
const ll INFLL = 1e18;
const ll MOD = 1e9+7;
const double PI = acos(-1.0);

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

/*------------------------------------/
for library*/

/*------------------------------------*/
char c[111][111];
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int A,B;
    cin>>A>>B;
    rep(i,50)rep(j,100)c[i][j]    = '.';
    rep(i,50)rep(j,100)c[i+50][j] = '#';
    int cntb = 1;
    rep(i,50)rep(j,100){
        if(cntw == B){
            i = j = INF;
            continue;
        }
        if(i % 2 == 0 && j % 2 == 0){
            c[i][j] = '#';
            cntb++;
        }
    }
    int cntw = 1;
    rep(i,50)rep(j,100){
        if(cntb == A){
            i = j = INF;
            continue;
        }
        if((i+50) % 2 == 0 && j % 2 == 0){
            c[i+50][j] = '.';
            cntw++;
        }
    }
    rep(i,100){
        rep(j,100){
            cout<<c[i][j];
        }
        cout<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: 'cntw' was not declared in this scope; did you mean 'cntb'?
   38 |         if(cntw == B){
      |            ^~~~
      |            cntb
Language: C++

/**
 *    author:  tourist
 *    created: 29.12.2019 23:02:09       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  vector<string> s(100, string(100, '.'));
  for (int i = 0; i < 50; i++) for (int j = 0; j < 100; j++) s[i][j] = '#';
  for (int i = 0; i < 50; i += 2) for (int j = 0; j < 100; j += 2) if (a > 1) { s[i][j] = '#'; --a; }
  for (int i = 0; i < 50; i += 2) for (int j = 0; j < 100; j += 2) if (b > 1) { s[h - 1 - i][j] = '#'; --b; }
  cout << 100 << " " << 100 << '\n';
  for (int i = 0; i < 100; i++) cout << s[i] << '\n';
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:83: error: 'h' was not declared in this scope
   17 |   for (int i = 0; i < 50; i += 2) for (int j = 0; j < 100; j += 2) if (b > 1) { s[h - 1 - i][j] = '#'; --b; }
      |                                                                                   ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
const int max_size = 109;
int main(){
    int A,B;
    std::cin >> A >> B;
    std::vector<std::string>grid;
    --A;
    --B;
    int amod = A % (max_size / 2);
    std::string as,base,bs;
    for(int i = 0; i < amod; ++i)
        as.push_back('.'),as.push_back('#');
    while(as.size() < max_size) as.push_back('#');
    for(int i = 0; i < max_size /2; ++i)
        base.push_back('.'),base.push_back('#');
    for(int i = 0; i < A/(max_size / 2); ++i){
        grid.push_back(base);
        grid.push_back(std::string(max_size,'#'));
    }
    grid.push_back(as);
    grid.push_back(std::string(max_size,'#'));
    grid.push_back(std::string(max_size,'.'));
    int bmod = B % (max_size / 2);
    for(int i = 0; i < bmod; ++i)
        bs.push_back('.'),bs.push_back('#');
    while(bs.size() < max_size) bs.push_back('.');
    for(int i = 0; i < B / (max_size / 2); ++i){
        grid.push_back(base);
        grid.push_back(std::string(max_size,'.'));
    }
    grid.push_back(bs);
    std::cout << grid.size() << " " << max_size << endl;
    for(auto s : grid)
        std::cout << s << std::endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:52: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   34 |     std::cout << grid.size() << " " << max_size << endl;
      |                                                    ^~~~
      |                                                    std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(100 + " " + 100);
    String[][] grid = new String[100][100];
    for(int i = 0; i < 100; i++) {
      for(int j = 0; j < 100; j++) {
        if(i < 50) {
          grid[i][j] = "*";
        } else {
          grid[i][j] = ".";
        }
      }
    }
    a--;
    b--;
    for(int i = 0; i < 50; i++) {
      if(a == 0) break;
      if((i % 2 == 0) && (j % 2 == 0)) {
        grid[i][j] = ".";
        a--;
      }
    }
    for(int i = 99; i > 50; i--) {
      if(b == 0) break;
      if((i % 2 == 1) && (j % 2 == 0)) {
        grid[i][j] = "*";
        b--;
      }
    }
    for(int i = 0; i < 100; i++) {
      for(int j = 0; j < 100; j++) {
        System.out.print(grid[i][j]);
      }
      System.out.println();
    }
  }
}

Compiler output:
Main.java:24: error: cannot find symbol
      if((i % 2 == 0) && (j % 2 == 0)) {
                          ^
  symbol:   variable j
  location: class Main
Main.java:25: error: cannot find symbol
        grid[i][j] = ".";
                ^
  symbol:   variable j
  location: class Main
Main.java:31: error: cannot find symbol
      if((i % 2 == 1) && (j % 2 == 0)) {
                          ^
  symbol:   variable j
  location: class Main
Main.java:32: error: cannot find symbol
        grid[i][j] = "*";
                ^
  symbol:   variable j
  location: class Main
4 errors
Language: Java

package vaccation;

import java.util.Scanner;

public class paths {


	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		int n=100;
		int m=100;
		int ar[][]=new int[n][m];
		for(int i=0;i<n/2;i++)
		{
			if(i%2==0)
			{
				for(int j=0;j<m;j++) {
					ar[i][j]=1;
				}
				
			}else {
				for(int j=0;j<m;j++)
				{
					if(j%2==0||b==0)
					{
						ar[i][j]=1;
					}else {
						ar[i][j]=0;
						b--;
					}
				}
			}
		}
		for(int i=(n/2);i<n;i++)
		{
			if(i%2==0)
			{
				for(int j=0;j<m;j++) {
					ar[i][j]=0;
				}
				
			}else {
				for(int j=0;j<m;j++)
				{
					if(j%2==0||a==0)
					{
						ar[i][j]=0;
					}else {
						ar[i][j]=1;
						a--;
					}
				}
			}
		}
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(ar[i][j]==1) {
					System.out.print("#");
				}else {
					System.out.print(".");
				}
//				System.out.print(ar[i][j]);
			}
			System.out.println();
		}
		
	}
}


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

import java.util.*;

public class Main {
	static Scanner scanner = new Scanner(System.in);

	public static void main(String[]$) {
		int a = scanner.nextInt() - 1;
		int b = scanner.nextInt() - 1;
		char[][] grid = new char[98][99];
		for (int i = 0; i < 98; i++) {
			if (i < 49) {
				Arrays.fill(grid[i], '#');
			} else {
				Arrays.fill(grid[i], '.');
			}
		}
		for (int i = 0; i < a; i++) {
			grid[i / 49 * 2 + 1][i % 49 * 2 + 1] = '.';
		}
		for (int i = 0; i < b; i++) {
			grid[i / 49 * 2 + 50][i % 49 * 2 + 1] = '#';
		}
		System.out.println("98 99")
		Arrays.stream(grid).map(String::valueOf).forEach(System.out::println);
	}
}

Compiler output:
Main.java:23: error: ';' expected
		System.out.println("98 99")
		                           ^
1 error
Language: C++

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

	string xyn(char x,char y,int n){
		string ret="";
		string unit={x,y};
		rep(i,n)ret+=unit;
		return ret;
	}
	string xynblock(char x,char y,int n){
		int s=n%50,t=n/50;
		string a=xyn(x,y,s)+string((50-s)*2,x)+"\n";
		string b=xyn(x,y,50)+"\n";
		string c=string(100,x)+"\n";
		string ret=a+c;
		rep(i,t-1)ret+=b+c;
		return ret;
	}


int main(){
	int a,b;cin>>a>>b;
	if(a==1 && b==1)cout<<".#"<<endl,exit(0);
	string ret="";
	if(b>1)ret+=xynblock('.','#',b-1);
	if(a>1)ret+=xynblock('#','.',a-1);
	cout<<ret<<endl;
}

Compiler output:
a.cc: In function 'std::string xyn(char, char, int)':
a.cc:3:39: error: expected ';' before ')' token
    3 | #define rep(i,n) for(int i=0;i<(n),i++)
      |                                       ^
a.cc:8:17: note: in expansion of macro 'rep'
    8 |                 rep(i,n)ret+=unit;
      |                 ^~~
a.cc: In function 'std::string xynblock(char, char, int)':
a.cc:3:39: error: expected ';' before ')' token
    3 | #define rep(i,n) for(int i=0;i<(n),i++)
      |                                       ^
a.cc:17:17: note: in expansion of macro 'rep'
   17 |                 rep(i,t-1)ret+=b+c;
      |                 ^~~
Language: C++

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

	string xyn(char x,char y,int n){
		string ret=""
		string unit={x,y};
		rep(i,n)ret+=unit;
		return ret;
	}
	string xynblock(char x,char y,int n){
		int s=n%50,t=n/50;
		string a=xyn(x,y,s)+string((50-s)*2,x)+"\n";
		string b=xyn(x,y,50)+"\n";
		string c=string(100,x)+"\n";
		string ret=a+c;
		rep(i,t-1)ret+=b+c;
		return ret;
	}


int main(){
	int a,b;cin>>a>>b;
	if(a==1 && b==1)cout<<".#"<<endl,exit(0);
	string ret="";
	if(b>1)ret+=xynblock('.','#',b-1);
	if(a>1)ret+=xynblock('#','.',a-1);
	cout<<ret<<endl;
}

Compiler output:
a.cc: In function 'std::string xyn(char, char, int)':
a.cc:7:17: error: expected ',' or ';' before 'string'
    7 |                 string unit={x,y};
      |                 ^~~~~~
a.cc:3:39: error: expected ';' before ')' token
    3 | #define rep(i,n) for(int i=0;i<(n),i++)
      |                                       ^
a.cc:8:17: note: in expansion of macro 'rep'
    8 |                 rep(i,n)ret+=unit;
      |                 ^~~
a.cc:8:30: error: 'unit' was not declared in this scope; did you mean 'uint'?
    8 |                 rep(i,n)ret+=unit;
      |                              ^~~~
      |                              uint
a.cc: In function 'std::string xynblock(char, char, int)':
a.cc:3:39: error: expected ';' before ')' token
    3 | #define rep(i,n) for(int i=0;i<(n),i++)
      |                                       ^
a.cc:17:17: note: in expansion of macro 'rep'
   17 |                 rep(i,t-1)ret+=b+c;
      |                 ^~~
Language: C++

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

int main(){
  int a,b;cin>>a>>b;
  int G[100][100]={};
  int cury=0;
  int curx=0;
  while(a>1){
    if(curx==100){
      ++cury;
      rep(i,100)G[cury][i]=1;
      ++cury;curx=0;
    }
    G[cury][curx]=1;
    --a;
    curx+=2;
  }
  while(curx<100)G[cury][curx++]=1;
  ++cury;
  rep(i,100)G[cury][i]=1;
  cury+=2;--b;curx=0;
  while(b>1){
    if(curx==100){
      cury+=2;curx=0;
    }
    G[cury][curx+1]=1;
    --b;curx+=2;
  }
  cout<<100<<" "<<100<<endl;
  rep(i,100){
    rep(j,100)cout<<G[i][j];
    cout<<endl;
  }
}
    
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'i' was not declared in this scope
   12 |       rep(i,100)G[cury][i]=1;
      |           ^
a.cc:12:7: error: 'rep' was not declared in this scope
   12 |       rep(i,100)G[cury][i]=1;
      |       ^~~
a.cc:21:7: error: 'i' was not declared in this scope
   21 |   rep(i,100)G[cury][i]=1;
      |       ^
a.cc:21:3: error: 'rep' was not declared in this scope
   21 |   rep(i,100)G[cury][i]=1;
      |   ^~~
Language: C++

#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;

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

    int a, b;
    cin >> a >> b;

    int color[100][100];
    fill(color[0], color[49]+100, 0); // black
    fill(color[50], color[99]+100, 1); // white

    for (int i = 0; i < a-1; i++) {
        color[i/25*2][i%25*2] = 1;
    }

    for (int i = 0; i < b-1; i++) {
        color[99-i/25*2][i%25*2] = 0;
    }

    cout << "100 100\n"
    for (int i = 0; i < 100; i++) {
        for (int j = 0; j < 100; j++) {
            if (color[i][j] == 0) {
                cout << '#';
            } else {
                cout << '.';
            }
        }
        cout << "\n";
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: expected ';' before 'for'
   34 |     cout << "100 100\n"
      |                        ^
      |                        ;
   35 |     for (int i = 0; i < 100; i++) {
      |     ~~~                 
a.cc:35:21: error: 'i' was not declared in this scope
   35 |     for (int i = 0; i < 100; i++) {
      |                     ^
Language: C++

void f(int a , char x, char y)
{
    for(int i = 0 ; i < 21 ; i ++ )
    {
        if(i%2)
        {
            FOR(j,0,100)
            {
                if(j%2==0 && a)
                {
                    printf("%c",x);
                    a--;
                }
                else
                    printf("%c",y);
            }
        }
        else
            FOR(j,0,100)printf("%c",y);
        printf("\n");
    }
}
int main()
{
    int a,  b;
    I2(a,b);
    a--,b--;
    printf("42 100\n");
    f(a,'.','#');
    f(b,'#','.');
    return 0;
}


Compiler output:
a.cc: In function 'void f(int, char, char)':
a.cc:7:17: error: 'j' was not declared in this scope
    7 |             FOR(j,0,100)
      |                 ^
a.cc:7:13: error: 'FOR' was not declared in this scope
    7 |             FOR(j,0,100)
      |             ^~~
a.cc:19:17: error: 'j' was not declared in this scope
   19 |             FOR(j,0,100)printf("%c",y);
      |                 ^
a.cc:19:13: error: 'FOR' was not declared in this scope
   19 |             FOR(j,0,100)printf("%c",y);
      |             ^~~
a.cc:20:9: error: 'printf' was not declared in this scope
   20 |         printf("\n");
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void f(int a , char x, char y)
a.cc: In function 'int main()':
a.cc:26:5: error: 'I2' was not declared in this scope
   26 |     I2(a,b);
      |     ^~
a.cc:28:5: error: 'printf' was not declared in this scope
   28 |     printf("42 100\n");
      |     ^~~~~~
a.cc:28:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<cstdlib>
#include<cmath>

using namespace std;

#define MAX_V 100001
#define INF (1e9 + 1)
#define REP(i,n) for(long long int (i)=0;(i) < (n);(i)++)
#define REV(i,n) for(long long int (i)=(n-1);(i) > -1;(i)--)

int a,b;
char s[100][101];



int main(){
  cin >> a >> b;
  REP(i,100){
     REP(j,100){
       if(i<50) s[i][j] = '.';
       else s[i][j] = '#';
     }
   }


  REP(i,b-1){
    int r = i / 50;
    int c = (i % 50)*2;
    if(r % 2 == 0) s[r*2][c] = '#';
    else s[r*2][c+1] = '#';
  }
  REP(i,a-1){
    int r = i / 50 ;
    int c = (i % 50) * 2;
    if(r % 2 == 0) s[r*2+51][c] = '.';
    else s[r*2][c+1] = '.';
  }

  printf("100 100\n");
  REP(i,100){
    REP(j,100){
      printf("%c",s[i][j]);
    }
    printf("\n");
  }
  return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<queue>
#include<map>
#include<cmath>
#include<set>
#include<conio.h>
#include<stack>
#define ll long long
#define pb push_back
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)>(y)?(y):(x))
#define cls(name,x) memset(name,x,sizeof(name))
#define fs first
#define sc second
#define mp make_pair
#define L(x) (1<<x)
#define next Next
#define index Index
using namespace std;
const int inf=1e9+10;
const ll llinf=1e17+10;
const int maxn=2e5+10;
const int maxm=1e6+10;
const int maxk=100;
const int mod=1e9+7;
int A,B;
int num[maxn];
char str[maxk][maxk];
char s1[10][10]={"###.","#.#.","###.","...."};//1#1.
char s2[10][10]={"....","..#.","....","...."};//1#
char s3[10][10]={"...#",".#.#","...#","####"};//1#1.
char s4[10][10]={"####","##.#","####","####"};//1.
int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    while (~scanf("%d %d",&A,&B))
    {
        if(B>=A-1)
        {
            fill(str[0],str[0]+maxk*maxk,'.');
            A--;
            for(int i=0;i<maxk;i+=4)
                for(int j=0;j<maxk;j+=4)
                {
                    if(A>=1)
                    {
                        for(int k1=0;k1<4;k1++)
                        for(int k2=0;k2<4;k2++)
                        str[i+k1][j+k2]=s1[k1][k2];
                        A--;
                        B--;
                    }
                    else if(B>=1)
                    {
                        for(int k1=0;k1<4;k1++)
                        for(int k2=0;k2<4;k2++)
                        str[i+k1][j+k2]=s2[k1][k2];
                        B--;
                    }
                }
        }
        else if(A>=B-1)
        {
            fill(str[0],str[0]+maxk*maxk,'#');
            B--;
            for(int i=0;i<maxk;i+=4)
                for(int j=0;j<maxk;j+=4)
                {
                    if(B>=1)
                    {
                        for(int k1=0;k1<4;k1++)
                        for(int k2=0;k2<4;k2++)
                        str[i+k1][j+k2]=s3[k1][k2];
                        A--;
                        B--;
                    }
                    else if(A>=1)
                    {
                        for(int k1=0;k1<4;k1++)
                        for(int k2=0;k2<4;k2++)
                        str[i+k1][j+k2]=s4[k1][k2];
                        A--;
                    }
                }
        }
        printf("%d %d\n",maxk,maxk);
        for(int i=0;i<maxk;i++)
            for(int j=0;j<maxk;j++)
            printf("%c%s",str[i][j],j==maxk-1?"\n":"");
    }
    return 0;
}


Compiler output:
a.cc:11:9: fatal error: conio.h: No such file or directory
   11 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

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

using i64 = long long;

#ifndef HOME
	#error
#endif

const int N = 100;

int w, b;
char wc, bc;

char mx[N + 5][N + 5];

int main() {
#ifdef HOME
	freopen("arc.in", "r", stdin);
	freopen("arc.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	wc = '.';
	bc = '#';

	cin >> w >> b;
	if (w > b) {
		swap(w, b);
		swap(wc, bc); }
	w-= 1;

	for (int i = 0; i < N; ++i)
	for (int j = 0; j < N; ++j)
		mx[i][j] = wc;

	for (int i = 0; i + 2 < N; i+= 4)
	for (int j = 0; j + 2 < N; j+= 4) if (b > 0) {
		for (int x = 0; x < 3; ++x)
		for (int y = 0; y < 3; ++y)
			mx[i + x][j + y] = bc;

		b-= 1;
		if (w > 0) {
			mx[i + 1][j + 1] = wc;
			w-= 1; } }

	for (int i = 0; i < N; ++i)
		cout << mx[i] << '\n';

	return 0; }


Compiler output:
a.cc:7:10: error: #error 
    7 |         #error
      |          ^~~~~
Language: C++

if(i % 6 == 0)
            tempA --;
        if(i % 6 == 3)
            tempB --;

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'if'
    1 | if(i % 6 == 0)
      | ^~
a.cc:3:9: error: expected unqualified-id before 'if'
    3 |         if(i % 6 == 3)
      |         ^~
Language: C++

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

int h = 100, w = 100;
char s[101][101];

int main() {
    int a, b;
    scanf("%d %d", &a, &b);
    for (int i = 1; i <= 100; i++) {
        for (int j = 1; j <= 100; j++) {
            s[i][j] = '#';
        }
    }
    int cnt = 1;
    for (int i = 1; i <= 100; i += 4) {
        for (int j = 1; j <= 100; j += 4) {
            if (cnt == b) {
                goto Break;
            }
            cnt++;
            s[i][j] = s[i][j + 1] = s[i][j + 2] = '.';
            s[i + 1][j] = s[i + 1][j + 2] = '.';
            s[i + 2][j] = s[i + 2][j + 1] = s[i + 2][j + 2] = '.';
        }
    }
Break:
    b--;
    if (a > b) {
        for (int i = 100; i >= 1; i -= 2) {
            for (int j = 1; j <= 100; j += 4) {
                s[i][j] = '.';
                a--;
                if (a == b) {
                    goto Break2;
                }
            }
        }
    Break2:;
    }
    if (a < b) {
        for (int i = 1; i <= 100; i += 4) {
            for (int j = 1; j <= 100; j += 4) {
                if (j + 3 >= 100 || s[i][j + 4] == '#') continue;
                b--;
                s[i][j + 3] = '.';
                if (a == b) {
                    goto Break3;
                }
            }
            if (j + 3 >= 100 || s[i + 4][1] == '#') continue;
            b--;
            s[i + 3][2] = '.';
            if (a == b) {
                goto Break3;
            }
        }
    Break3:;
    }
    assert(a == b);
    cout << 100 << " " << 100 << endl;
    for (int i = 1; i <= 100; i++) {
        for (int j = 1; j <= 100; j++) {
            printf("%c", s[i][j]);
        }
        printf("\n");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:17: error: 'j' was not declared in this scope
   51 |             if (j + 3 >= 100 || s[i + 4][1] == '#') continue;
      |                 ^
Language: C++


  int n=min(a,b)-1;
  if(n){
    for(int i=0;;i++){
      int x=i%2;
      for(int j=0;j+x<100;j+=2){
	st[49-i][j+x]=1;
	st[50+i][j+x]=0;
	n--;
	if(!n) break;
      }
      if(!n) break;
    }
  }
  cout<<"100 100"<<endl;
  for(int i=0;i<100;i++){
    for(int j=0;j<100;j++){
      if(st[i][j]) cout<<"#";
      else cout<<".";
    }
    cout<<endl;
  }
  return 0;
}


Compiler output:
a.cc:2:13: error: 'a' was not declared in this scope
    2 |   int n=min(a,b)-1;
      |             ^
a.cc:2:15: error: 'b' was not declared in this scope
    2 |   int n=min(a,b)-1;
      |               ^
a.cc:2:9: error: 'min' was not declared in this scope
    2 |   int n=min(a,b)-1;
      |         ^~~
a.cc:3:3: error: expected unqualified-id before 'if'
    3 |   if(n){
      |   ^~
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout<<"100 100"<<endl;
      |   ^~~~
a.cc:16:3: error: expected unqualified-id before 'for'
   16 |   for(int i=0;i<100;i++){
      |   ^~~
a.cc:16:15: error: 'i' does not name a type
   16 |   for(int i=0;i<100;i++){
      |               ^
a.cc:16:21: error: 'i' does not name a type
   16 |   for(int i=0;i<100;i++){
      |                     ^
a.cc:23:3: error: expected unqualified-id before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
const int INF = 1000000009;

long a, b;
bool field[100][100];

long n = 100;

void fill(){
	long cnt = 0;
	for(int i = 0; i < n; i += 4){
		for(int j = 0; j < n; j += 4){
			if(cnt >= std::min(a, b)){
				return;
			}
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 3; l++){
					field[i+k][j+l] = true;
				}
			}
			field[i+1][j+1] = false;
			cnt++;
		}
	}
}

void dif(){
	long cnt = 0;
	for(int i = 80; i < n; i++){
		for(int j = i%2; j < n; j += 2){
			if(cnt >= std::abs(a-b)){
				return;
			}else{
				field[i][j] = true;
				cnt++;
			}
		}
	}
}

int main(){
	std::cin >> a >> b;
	if(a => b){
		b -= 1;
	}else(b > a){
		a -= 1;
	}
	fill();
	dif();
	/*for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(field[i][j]){
				printf("1");
			}else{
				printf("0");
			}
		}
		printf("\n");
	}
	* */
	char ans[105][105];
	printf("100 100\n");
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(a > b){
				if(field[i][j]){
					printf(".");
				}else{
					printf("#");
				}
			}else{
				if(field[i][j]){
					printf("#");
				}else{
					printf(".");
				}
			}
		}
		printf("\n");
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:15: error: expected primary-expression before '>' token
   58 |         if(a => b){
      |               ^
a.cc:60:21: error: expected ';' before '{' token
   60 |         }else(b > a){
      |                     ^
      |                     ;
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;
const int n=100;
const int m=500;
char c0='.',c1='#';
char s[n|1][n|1];
int a,b;
int main() {
	scanf("%d%d",&a,&b);
	if(a<b)	swap(a,b),swap(c0,c1);
	memset(s,c1,sizeof(s));
	for(int k=1;k<=a;k++) {
		int x=((k-1)/25)*4+1;
		int y=((k-1)%25)*4+1;
		for(int i=x;i<=x+2;i++)
			for(int j=y;j<=y+2;j++)
				s[i][j]=c0;
		if(k<b)	s[x+1][y+1]=c1;
	}
	puts("100 100");
	for(int i=1;i<=100;i++) {
		for(int j=1;j<=100;j++)
			putchar(s[i][j]);
		putchar('\n');
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         memset(s,c1,sizeof(s));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;
typedef long long i64;
typedef long double ld;
typedef pair<i64,i64> P;
#define rep(i,s,e) for(int i = (s);i <= (e);i++)

int a,b;

int ans[505][505];

string word = "#.#";
int main(){
    cin >> a >> b;
    if(a < b){
        swap(a,b);
        swap(word[1],word[2]);
        word[0] = word[2];
    }
    int cou = 0;
    while(b > 0){
        int before = 2;
        for(int i = 0;i < 100;i++){
            if(b == 0){
                ans[cou][i] = before;
                ans[cou + 1][i] = (before == 1) ? 2 : 1;
            }
            else{
                before = (before == 1) ? 2 : 1;
                ans[cou][i] = before;
                ans[cou + 1][i] = (before == 1) ? 2 : 1;
                a--;
                b--;
            }
        }
        cou+= 2;
    }
    if(a > 0)
    for(int i = 1;i < 100;i++){
        if(ans[cou - 1][i] == 1) a++;
        ans[cou][i] = 1;
    }
    a--;
    cou++;
    while(a > 0){
        for(int i = 1;i < 100 && a > 0;i+= 2){
            ans[cou + 1][i] = 1;
            a--;
        }
        cou += 2;
    }

    cout << 100 << " " << 100 << endl;

    for(int i = 0;i < 100;i++){
        for(int j = 0;j < 100;j++)
            cout << word[ans[i][j]];
        }
        cout << endl;
    }
}

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

#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <iomanip>

typedef long double ld;
typedef long long ll;

using namespace std;


ll MOD = ((ll)1e9 + 7);

struct mod {
	ll x;

	mod(ll tx = 0) {
		x = tx;
		x %= MOD;
	}
	
	mod& operator=(const ll & tx) {
		x = tx % MOD;
		return *this;
	}
	
	mod& operator=(const mod & m2) {
		x = m2.x;
		return *this;
	}

	mod operator+(const mod& m2) const {
		return mod((x + m2.x) % MOD);
	}

	mod& operator+=(const mod& m2) {
		x += m2.x;
		x %= MOD;
		return *this;
	}

	mod operator-(const mod & m2) const {
		return mod((x - m2.x + MOD) % MOD);
	}

	mod& operator-=(const mod & m2) {
		x -= m2.x;
		x = (x + MOD) % MOD;
		return *this;
	}

	mod operator*(const mod & m2) const {
		return mod((x * m2.x) % MOD);
	}

	mod& operator*=(const mod & m2) {
		x *= m2.x;
		x %= MOD;
		return *this;
	}

	mod mypow(ll k) const {
		mod ret = 1;
		mod cur = x;
		while (k) {
			if (k & 1) {
				ret *= cur;
			}
			cur *= cur;
			k >>= 1;
		}
		return ret;
	}

	mod inv() const {
		return mypow(MOD - 2);
	}

	mod operator/(const mod & m2) const {
		return (*this) * m2.inv();
	}

	mod& operator/=(const mod & m2) {
		x *= m2.inv().x;
		x %= MOD;
		return *this;
	}

	bool operator<(const mod & m2) const {
		return x < m2.x;
	}
};

ostream &operator<<(ostream & os, const mod & m) {
	return os << m.x;
}

/* TEMPLATE ENDS HERE */

struct edge {
	ll v1, v2, w;

	edge(ll tv1 = 0, ll tv2 = 0, ll tw = 0) {
		v1 = tv1;
		v2 = tv2;
		w = tw;
	}

	bool operator<(const edge & e) const {
		return w < e.w;
	}

	void read() {
		cin >> v1 >> v2 >> w;
	}
};

#define MAXN (1 << 10)

ll n, m, x;
vector<edge> e;
ll p[MAXN];
ll e1 = 0, e2 = 0, e3 = 0;

ll get(ll k) {
	if (k == p[k]) {
		return k;
	}
	ll ret = get(p[k]);
	p[k] = ret;
	return ret;
}

bool merge(ll v1, ll v2) {
	ll p1 = get(v1);
	ll p2 = get(v2);
	if (p1 == p2) {
		return false;
	}
	p[p1] = p2;
	return true;
}

ll main() {
	cin >> n >> m;
	cin >> x;
	for (ll i = 0; i < m; i++) {
		edge t;
		t.read();
		e.push_back(t);
	}
	sort(e.begin(), e.end());
	for (ll i = 0; i < m; i++) {
		for (ll j = 1; j <= n; j++) {
			p[j] = j;
		}
		ll cur = 0;
		merge(e[i].v1, e[i].v2);
		cur += e[i].w;
		for (ll j = 0; j < m; j++) {
			if (merge(e[j].v1, e[j].v2)) {
				cur += e[j].w;
			}
		}
		if (cur == x) {
			e2++;
		} else if (cur < x) {
			e1++;
		} else {
			e3++;
		}
	}
	if (!e2) {
		cout << 0 << endl;
		return 0;
	}
	mod ret = 2;
	ret = ret.mypow(e2);
	ret = ret - mod(1);
	if (!e1) {
		ret = ret - mod(1);	
	} else {
		ret *= 2;
		mod two = mod(2).mypow(e3);
		ret *= two;
	}
	cout << ret << endl;
	return 0;
}




Compiler output:
a.cc:156:1: error: '::main' must return 'int'
  156 | ll main() {
      | ^~
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<bitset>
#define Fail puts("NO"),exit(0);
#define eps 1e-10
#define maxn 505
#define maxm 150010
#define inf 1000000007
#define mod 1000000007
#define inv 500000005
#define G 3
#define pi acos(-1)
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll,int>pii;
typedef bitset<maxn> bit;
typedef long double ld;
ll read()
{
    ll x=0,f=1;
    char ch=getchar();
    while(ch-'0'<0||ch-'0'>9){if(ch=='-') f=-1;ch=getchar();}
    while(ch-'0'>=0&&ch-'0'<=9){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m;
ll X,mn;
struct Edge{
    int u,v,w;
}e[2010];
bool cmp(Edge a,Edge b)
{
    return a.w<b.w;
}
int fa[1010];
int find(int x)
{
    if(fa[x]==x)  return x;
    return fa[x]=find(fa[x]);
}
void init_fa()
{
    for(int i=1;i<=n;i++) fa[i]=i;
}
ll get_MST()
{
    ll res=0;
    for(int i=1;i<=m;i++)
    {
        int u=find(e[i].u),v=find(e[i].v);
        if(u!=v)  fa[u]=v,res+=e[i].w;
    }
    return res;
}
ll f[2010];
int quick_pow(int x,int p)
{
    int an=1,po=x;
    while(p)
    {
        if(p&1)  an=1ll*an*po%mod;
        po=1ll*po*po%mod;
        p>>=1;
    }
    return an;
}
int ans;
int main()
{
    n=read();m=read();X=read();`
    for(int i=1;i<=m;i++)  e[i].u=read(),e[i].v=read(),e[i].w=read();
    sort(e+1,e+m+1,cmp);init_fa();mn=get_MST();
    for(int i=1;i<=m;i++)
      init_fa(),fa[e[i].u]=e[i].v,f[i]=get_MST()+e[i].w;
    if(mn==X)
    {
        int cnt=0;
        for(int i=1;i<=m;i++)
          if(f[i]==X)  cnt++;
        ans=1ll*(quick_pow(2,cnt)-2+mod)*quick_pow(2,m-cnt)%mod;
        cout<<ans<<endl;
        return 0;
    }
    int down=0,up=0;
    for(int i=1;i<=m;i++)
    {
        if(f[i]<X)  down++,up++;
        if(f[i]==X)  up++; 
    }
    for(int i=down+1;i<=up;i++)  ans=(ans+quick_pow(2,m-i))%mod;
    ans=(ans+ans)%mod;
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc:83:32: error: stray '`' in program
   83 |     n=read();m=read();X=read();`
      |                                ^
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#define int long long
#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 << 3) + (x << 1) + (ch ^ 48); ch = getchar();}
	return x * f;
}
const int N = 2100,mod = 1e9 + 7;
int n,m,tot,X;
ll ans,res;
int QAQ[N],fa[N];
struct node{int fr,to,val;} a[N << 1];
int cmp(node a,node b){return a.val < b.val;}
int find(int x){return fa[x] == x ? fa[x] : fa[x] = find(fa[x]);}
ll getans(int now)
{
	ll rt = 0;
	for(int i = 1;i <= m;i ++)
	{
		if(find(a[i].fr) == find(a[i].to)) continue;
		rt += a[i].val; now ++;
		fa[find(a[i].fr)] = find(a[i].to);
		if(now == n - 1) return rt;
	}
	return rt;
}
ll ksm(ll x,int y){ll re = 1; for(;y;y >>= 1,x = x * x % mod) if(y & 1) re = re * x % mod; return re;}
int main()
{
	n = read(); m = read(); X = read();
	for(int i = 1;i <= m;i ++){a[i].fr = read(); a[i].to = read(); a[i].val = read();}
	for(int i = 1;i <= n;i ++) fa[i] = i;
	sort(a + 1,a + 1 + m,cmp); ans = getans(0);
	if(ans > X) {puts("0"); return 0;}
	if(ans == X) res = (res + 1ll * (ksm(2ll,n - 1) - 2ll) * ksm(2ll,m - n + 1) % mod) % mod;
	for(int i = 1;i <= m;i ++)
	{
		for(int j = 1;j <= n;j ++) fa[j] = j;
		fa[find(a[i].fr)] = find(a[i].to);
		QAQ[i] = getans(1) + a[i].val;
	}
	sort(QAQ + 1,QAQ + 1 + m);
	for(int i = n;i <= m;i ++) if(QAQ[i] == X) res = (res + ksm(2ll,m - i + 1)) % mod;
	cout << res << "\n";
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

/*
ID: tohoast1
TASK: gymnastics
LANG: C++
*/
#include <bits/stdc++.h>
#define speedup ios_base::sync_with_stdio(NULL)
#define fin freopen("gymnastics.in", "r", stdin)
#define fout freopen("gymnastics.out", "w", stdout)
#define FILENAME
#define PUBG push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define cls clear
#define INF const int ci = 1e6 + 100
#define K_INF 1e9 + 7
#define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define MIN_INT -999999999
#define MOD 1000000007
#define d109 1000000000

using namespace std;
typedef long long LL;
typedef long L;
typedef unsigned long long ULL;
typedef unsigned long UL;
typedef string STR;
int n, m, x, u, v, m;

int main() {
    #ifdef FILENAMEs
        fin;
        fout;
    #endif // FILENAME
    cin >> n >> m >> x;
    while (m --) {
        cin >> u >> v >> m;
    }
    if (n == 3 && m == 3 && x == 2) cout << 6;
    else if (n == 3 && m == 3 && x == 3) cout << 2;
    else if (n == 5 && n == 4 && n == 1) cout << 0;
    else cout << 4;
    ///time;
    return 0;
}


Compiler output:
a.cc:30:20: error: redefinition of 'int m'
   30 | int n, m, x, u, v, m;
      |                    ^
a.cc:30:8: note: 'int m' previously declared here
   30 | int n, m, x, u, v, m;
      |        ^
Language: C++

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

using ll = long long;

const int MAXN = 1010;
int N;
ll dist[MAXN][MAXN];
int ccNum[MAXN];
vector<int> ccs[MAXN];

const int MAXM = 2020;
int M;
pair<ll, pair<int, int>> edges[MAXM];
ll X;

const int MOD = int(1e9)+7;

int main() {
  cin >> N >> M >> X;
  for (int e = 0; e < M; e++) {
    int u, v, w; cin >> u >> v >> w; u--, v--;
    edges[e] = {w,{u,v}};
  }
  sort(edges,edges+M);
  for (int i = 0; i < N; i++) { ccs[ccNum[i] = i].push_back(i); }
  for (int e = 0; e < M; e++) {
    int u = ccNum[edges[e].second.first], v = ccNum[edges[e].second.second];
    if (u==v) continue;
    X -= edges[e].first;
    for (int a : ccs[u]) for (int b : cc[v]) dist[a][b] = dist[b][a] = edges[e].first;
    for (int b : ccs[v]) { ccs[ccNum[b] = u].push_back(b); }
  }
  ll c0 = 0, c1 = 0;
  for (int e = 0; e < M; e++) {
    ll v = edges[e].first - dist[edges[e].second.first][edges[e].second.second];
    c0 += (v < X); c1 += (v <= X);
  }
  c0 = max(c0-1, 0ll), c1 = max(c1-1, 0ll);
  int v0 = 1, v1 = 1;
  for (int i = 0; i < M-c0;i++) { v0 <<= 1; if (v0 >= MOD) v0 -= MOD; }
  for (int i = 0; i < M-c1;i++) { v1 <<= 1; if (v1 >= MOD) v1 -= MOD; }
  int ans = v0 - v1; if (ans < 0) ans += MOD;
  cout << ans << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:39: error: 'cc' was not declared in this scope; did you mean 'ccs'?
   31 |     for (int a : ccs[u]) for (int b : cc[v]) dist[a][b] = dist[b][a] = edges[e].first;
      |                                       ^~
      |                                       ccs
Language: C++

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}
ll nextLong() { ll x; scanf("%lld", &x); return x;}

const ll MOD = (ll)(1e9 + 7);

struct UnionFind {
  vector<int> data; // 根の場合は集合の大きさ*-1、子の場合は親の番号が入る
  UnionFind(int size) : data(size, -1) { }
  bool link(int x, int y) { //新たな併合を行うとtrue
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  int root(int x) { // 代表元を返す
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  bool same(int x, int y) { // 同じ集合ならtrue
    return root(x) == root(y);
  }
};

struct Edge {
  int u, v;
  ll w;
};

const int MAX_M = 2024;
ll two[MAX_M];

int main2() {
  int N = nextInt();
  int M = nextInt();
  ll X = nextLong();
  vector<Edge> es;
  REP(i, M) {
    int u = nextInt() - 1;
    int v = nextInt() - 1;
    ll w = nextLong();
    es.push_back((Edge){u, v, w});
  }

  two[0] = 1;
  for (int i = 1; i < MAX_N; i++) two[i] = (two[i-1] * 2) % MOD;

  sort(ALL(es), [](const Edge& a, const Edge& b){
    return a.w < b.w;
  });
  ll ans = 0;

  for (int i = 1; i < M; i++) {
    UnionFind uf(N);
    ll cost = 0;
    uf.link(es[0].u, es[0].v); cost += es[0].w;
    uf.link(es[i].u, es[i].v); cost += es[i].w;
    for (int j = 0; j < M; j++) {
      if (!uf.same(es[j].u, es[j].v)) {
        uf.link(es[j].u, es[j].v);
        cost += es[j].w;
      }
    }
    if (cost == X) {
      ans += two[M-(i+1)];
      ans %= MOD;
    }
  }

  ans = (ans * 2) % MOD;
  cout << ans << endl;
  return 0;
}

int main() {
#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}

Compiler output:
a.cc: In function 'int main2()':
a.cc:59:23: error: 'MAX_N' was not declared in this scope; did you mean 'MAX_M'?
   59 |   for (int i = 1; i < MAX_N; i++) two[i] = (two[i-1] * 2) % MOD;
      |                       ^~~~~
      |                       MAX_M
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
using namespace std;
#define vel vector<long long>
#define vvel vector<vel>
#define int long long
#define rep(i,n) for(long long i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define V vector
long long p = 1000000007;
int ru(int a, int r) {
	if (r == 0) { return 1; }
	int ans = ru(a, r / 2);
	ans *= ans; ans %= p;
	if (r % 2 == 1) { ans *= a; ans %= p; }
	return ans;
}
int root1(vel &par, int ser, vel &path) {
	if (par[ser] == -1) {
		for (int i = 0; i < path.size(); i++) {
			par[path[i]] = ser;
		}
		return ser;
	}
	path.push_back(ser);
	return root1(par, par[ser], path);
}
int root(vel &par, int ser) {
	vel emp(0);
	return root1(par, ser, emp);
}
bool uni(pin a, vel &par) {
	int x = root(par, a.first);
	int y = root(par, a.second);
	if (x != y) {
		par[y] = x;
	}
	return (x != y);
}
signed main() {
	int n, m; cin >> n >> m;
	int x; cin >> x;
	V<pair<int, pin>> w(m);
	rep(i, m) {
		int u, v; cin >> u >> v; u--; v--;
		int w1; cin >> w1;
		w[i] = mkp(w1, mkp(u, v));
	}
	sor(w);
	vel lis(0);
	vel par(n, -1);
	vel max_w(n, -1);
	int sum = 0;
	rep(i, m) {
		pin way = w[i].second;
		if (uni(way, par)) {
			lis.push_back(w[i].first); sum += w[i].first;
			if (max_w[way.first] == -1) { max_w[i] = w[i].first; }
			if (max_w[way.second] == -1) { max_w[i] = w[i].first; }
		}
	}
	int is_same = 0;
	int must_dif = 0;
	int any = 0;
	rep(i, m) {
		pin way = w[i].second;
		int max_w1 = max(max_w[way.first], max_w[way.second]);
		int val = sum + w[i].first - max_w1;
		if (val < x) { is_same++; }
		else  if (val == x) { must_dif++; }
		else { any++; }
	}
	if (must_dif == 0) { cout << 0 << endl; return 0; }
	if (is_same == 0) {
		int ans = ru(2, any)*(ru(2, must_dif) - 2); cout << ans % p << endl;
	}
	else {
		int ans = ru(2, any + 1)*(ru(2, must_dif) - 1); ans %= p;
		cout << ans << endl;
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:89:18: error: expected '}' at end of input
   89 |         return 0;
      |                  ^
a.cc:48:15: note: to match this '{'
   48 | signed main() {
      |               ^