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

#include<iostream>
using namespace std;
int main(){
string s,c;
  cin>>s>>c;int sum=0,ma=-1;
  for(int i=0;i<s.length()-t.length()+1;i++){
  if(s[i]==t[sum]){sum++;ma=max(ma,sum);}
  else
    sum=0;
  
  
  }

cout<<ma;

return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: 't' was not declared in this scope
    6 |   for(int i=0;i<s.length()-t.length()+1;i++){
      |                            ^
Language: C++

 /*Author: S7a2a7d */
    #include <bits/stdc++.h>
    #pragma GCC optimize("Ofast")
    using namespace std;
     
    #define pb push_back
    #define ll long long
    #define rep(i,n)  for(ll i=0;i<n;i++)
    #define repi(i,n)  for(ll i=1;i<=n;i++)
    #define mem(arr,x) memset(arr,x,sizeof(arr))
     
    #define mp make_pair
    #define f first
    #define s second
     
    const double PI = 3.1415926535897932;
    const int mod = 1e9 + 7;  
    const int inf = 1e9 + 5;
    ll lcm(ll a,ll b)
    {
        return (a*b)/__gcd(a,b);
    }

    int main()
    {
        
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
     
   string s,t;
   cin>>s>>t;
   int res=inf;
  for(int i=0;i<s.length()-t.length();i++)
  {  ll int ans=0;
	  for(int j=0;j<t.length();j++)
	  {
		  if(s[i+j]==t[j])
		  {
			  continue;
		 }
		 else
		 ans++;
	 }
	 res=min(res,ans);
 }
 cout<<res<<'\n';
		  
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: no matching function for call to 'min(int&, long long int&)'
   45 |          res=min(res,ans);
      |              ~~~^~~~~~~~~
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:2:
/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:45:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   45 |          res=min(res,ans);
      |              ~~~^~~~~~~~~
/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:45:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   45 |          res=min(res,ans);
      |              ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

#define rep(i, o) for (ll i = 0; i < (o);i++)
#define rep_s(i, o) for (int i = 1; i <= (o);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<(int)(b);i++)
#define NUM 1e5

typedef long long ll;
typedef unsigned long long ull;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll c, ll d) { return c / gcd(c, d) * d; }


template<class T>
bool chmax(T &a, const T &b) { if (a < b) { return b; } return a; }

template<class T>
bool chmin(T &a, const T &b) { if (a > b) { a = b; return a; } return a; }

const int MOD = 1000000007;
int main() {
    string t, s; cin >> s >> t;

    ll replace = s.size();
    rep(i, s.size()) {
        ll count = 0;
        rep(j, t.size()) {
            if (t[j] == s[i+j]) count++;
        }
        replace = min(replace, t.size() - count);
    }
    cout << replace << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:22: error: no matching function for call to 'min(ll&, long long unsigned int)'
   39 |         replace = min(replace, t.size() - count);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:39:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   39 |         replace = min(replace, t.size() - count);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:39:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   39 |         replace = min(replace, t.size() - count);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize 03
#pragma GCC optimize ("unroll-loops")
#define int long long
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
using namespace std;
const int N = 3e5 + 2e5;
const int inf = 2e9;
const int MOD = 998244353;
const int LogN = 30;
 
void solve() {
    int D, T, S;
    string s, t;
    cin >> t >> s;
    int ans = inf;
    for (int i = 0; i <= t.size() - s.size(); ++i) {
        int sum = 0;
        for (int j = 0; j < s.size(); ++j)
        if (s[j] != t[i + j])
            ++sum;
        ans = min(ans, sum);
    }
    cout << ans;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
string t;
cin>>s;
cin>>t;
long long count=0;
long long ans=t.size();
for(long long i=0;i<s.size();i++){
  for(long long j=0;j<t.size()&&j+i<s.size();j++){
    if(s[i+j]==t[j]){
      count++;
    }
  }
  ans=min(ans,t.size()-count);
  count=0;
}
cout<<ans<<endl;
return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: no matching function for call to 'min(long long int&, long long unsigned int)'
   16 |   ans=min(ans,t.size()-count);
      |       ~~~^~~~~~~~~~~~~~~~~~~~
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:16:10: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   16 |   ans=min(ans,t.size()-count);
      |       ~~~^~~~~~~~~~~~~~~~~~~~
/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:16:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   16 |   ans=min(ans,t.size()-count);
      |       ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

S = input()
T = input()

l = len(T)
for i in range (l):
    if T[:l-i] in S:
        ans = i
        break
    if T[i:] in S:
        ans = i
        break

print(ans)


Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <ctime>
#include <cmath>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

#define sz(x) (int)(x.size())

typedef long long ll;
typedef tuple<int, int, int> tri;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef __gnu_pbds::tree<
    int,
    __gnu_pbds::null_type,
    less<int>,
    __gnu_pbds::rb_tree_tag,
    __gnu_pbds::tree_order_statistics_node_update>
    ordered_set;

const ll MODULO = 1000000007;

void ftime()
{
#ifndef ONLINE_JUDGE
    cout << "\nTime: " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
#endif
}

static int speed_increase = []() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(NULL);
    return 0;
}();
string s, t;
void solve()
{
    cin>>s>>t;
    int n = sz(s), m = sz(t);
    int ms = INT_MAX;
    for(int i=0; i<=n-m; ++i) {
        int score = 0;
        for(int x=0; x<m; ++x) {
            score += (s[x+i] != t[x]);
        }
        ms = min(ms, score);
    }
    cout<<ms<<"\n";
}

int main()
{
    solve();
    // ftime();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:53:14: error: 'INT_MAX' was not declared in this scope
   53 |     int ms = INT_MAX;
      |              ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <ext/pb_ds/assoc_container.hpp>
  +++ |+#include <climits>
    8 | #include <ext/pb_ds/tree_policy.hpp>
Language: Java


#include <bits/stdc++.h>


using namespace std;
double pi=3.14159265358979323846264338;
long long sum;

int main(){
	string a,b;
	cin>>a>>b;
	int lnth,lnth2;
	int ans=1000000000;
	lnth=a.length();
	lnth2=b.length();
	for(int i=0;i<=lnth-lnth2;i++){
		int num=0;
		for(int j=0;j<lnth2;j++){
			if(a[i+j]!=b[j])num++;
		}
		ans=min(ans,num);
	}
	return 0;
}

Compiler output:
Main.java:2: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:2: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
double pi=3.14159265358979323846264338;
^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
long long sum;
^
Main.java:11: error: not a statement
	cin>>a>>b;
	      ^
5 errors
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define		int 			long long int
#define		pb				push_back
#define		fi(n)			for(int i=0;i<n;i++)
#define		fi1(n)			for(int i=1;i<n;i++)
#define		fj(n)			for(int j=0;j<n;j++)
#define		clr(x)			memset(x, 0, sizeof(x))
#define 	print(x)		for(auto a:x) cout<<a<<" ";cout<<"\n"
#define		nl 				"\n"
#define		vi				vector<int>
#define		si 				set<int>
#define		mp 				make_pair
#define		pairi			pair<int,int>
#define		vpairi			vector<pair<int,int>>
#define		ff				first
#define		ss				second
#define		inf 			1e9+10
#define 	input 			"C://Users//Piyush Aggarwal//Documents//Cpp files//input-output//input.txt"
#define 	output 			"C://Users//Piyush Aggarwal//Documents//Cpp files//input-output//output.txt"
#define 	error 			"C://Users//Piyush Aggarwal//Documents//Cpp files//input-output//error.txt"

int ctoi(char a){ int x=a-48 -49;return x;}
string itos(int a){
	string out_string;
	stringstream ss;
	ss<<a;
	out_string=ss.str();
	return out_string;
}
char itoc(int a){ return itos(a)[0];}
int pow(int e,int x){
	int ans=1;
	while(x>0){
		if(x&1) ans*=e;
		e*=e;
		x>>=1;
	}return ans;
}
string bin(int x){
	bitset<sizeof(1)*CHAR_BIT> bits(x);
	string b=bits.to_string(); return b;
}


signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	#ifndef ONLINE_JUDGE
	freopen(input, "r", stdin);
	freopen(output, "w", stdout);
	freopen(error, "w", stderr);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		int n,k,m,x,y,z;
		// cin>>n;
		string s,t;
		cin>>s>>t;
		int ans=INT_MAX;
		for(s.length() - t.length()){
			int cnt=0;
			for(int j=i;j<i+t.length();j++){
				if(s[i]!=t[j]) cnt++;
			}
			ans=min(ans,cnt);
		}
		cout<<ans<<nl;
		// vi a(n);
		// fi(n) cin>>a[i];


	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:44: error: expected ';' before ')' token
   63 |                 for(s.length() - t.length()){
      |                                            ^
      |                                            ;
a.cc:75:9: error: expected primary-expression before '}' token
   75 |         }
      |         ^
a.cc:70:31: error: expected ')' before '}' token
   70 |                 cout<<ans<<nl;
      |                               ^
      |                               )
......
   75 |         }
      |         ~                      
a.cc:63:20: note: to match this '('
   63 |                 for(s.length() - t.length()){
      |                    ^
a.cc:75:9: error: expected primary-expression before '}' token
   75 |         }
      |         ^
Language: C++

#include <stdio.h>
#include <algorithm>
#include <iostream>
using namespace std;

// sort(arr, arr+n);
// (binary_search(key, key + total element, sizeof))

int main()
{
  char str1[1002], str2[1002];
  scanf("%s %s", str1, str2);

  int pt1 = 0, max = 0;
  int length = strlen(str2);

  for (int i = 0; str1[i] != '\0'; i++)
  {
    for (int j = 0; str2[j] != '\0'; j++)
    {
      if (str1[i] == str2[j])
      {
        pt1++;
      }
      else
      {
        max = (pt1 > max) ? pt1 : max;
        pt1 = 0;
      }
    }
  }

  printf("%d\n", length - max);

  // int arr[] = {1, 5, 8, 2, 4};
  // int n = 5;
  // sort(arr, arr + n);
  // for (int i = 0; i < 5; i++)
  // {
  //   printf("%d ", arr[i]);
  // }

  // binary_search(arr, arr + n, 7) ? puts("FOUND") : puts("NOT FOUND");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'strlen' was not declared in this scope
   15 |   int length = strlen(str2);
      |                ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class ABC177 {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int ans = t.length;
        for (int i = 0; i <= s.length - t.length; i++) {
            int tmp = 0;
            for (int j = 0; j < t.length; j++) {
                if (s[i+j] != t[j])
                    tmp++;
            }
            ans = Math.min(tmp, ans);

            if (ans == 0)
                break;
        }

        System.out.println(ans);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

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

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

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

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

int main() {
	string s, t;
	cin >> s >> t;
	int n = s.size();
	int m = t.size();
	int ans = -1;
	for (int i = 0; i <= n - m; i++) {
		int ct = 0;
		for (int j = i; j < i + m; j++) {
			if (s[j] != t[j - i]) {
				ct++;
			}
		}
		if (ans == -1 || ans > ct) {
			ans = ct;
		}
	}
	cout << ans;
	return 0;
}

















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

int main() {
	string s, t;
	cin >> s >> t;
	int n = s.size();
	int m = t.size();
	int ans = -1;
	for (int i = 0; i <= n - m; i++) {
		int ct = 0;
		for (int j = i; j < i + m; j++) {
			if (s[j] != t[j - i]) {
				ct++;
			}
		}
		if (ans == -1 || ans > ct) {
			ans = ct;
		}
	}
	cout << ans;
	return 0;
}



















Compiler output:
a.cc:44:5: error: redefinition of 'int main()'
   44 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
const int maxlen=1005;
const int INF=0x3f3f3f3f;
char s[maxlen],t[maxlen];
int main()
{
    scanf("%s",s);
    scanf("%s",t);
    int slen=(int)strlen(s),tlen=(int)strlen(t);
    int ans=INF;
    for(int i=0;i+tlen<=slen;i++)
    {
        int cur=0;
        for(int j=0;j<tlen;j++)
            cur+=(s[i+j]!=t[j]);
        ans=min(ans,cur);
    }
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'strlen' was not declared in this scope
   11 |     int slen=(int)strlen(s),tlen=(int)strlen(t);
      |                   ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc:13:19: error: 'tlen' was not declared in this scope; did you mean 'slen'?
   13 |     for(int i=0;i+tlen<=slen;i++)
      |                   ^~~~
      |                   slen
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define lli long long int
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
#define umap unordered_map
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define ipair pair <int,int>
#define llipair pair <lli,lli>
#define pq priority_queue
#define displaymatrix(a,m,n) for(int i=0;i<m;i++){for(int j=0;j<n;j++)cout<<a[i][j]<<" ";cout<<endl;}
#define printarray(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}nl;
#define vinput(a,n) vlli a(n);rep(i,n,0)cin>>a[i]
#define ainput(a,n) rep(i,n,0)cin>>a[i]
#define SO(a) sort(a.begin(),a.end())
#define all(x) (x).begin(),(x).end()
#define SOP(a,comp) sort(a.begin(),a.end(),comp)
#define inf INT_MAX
#define endl '\n'
 
int main()
{
    fastio;
    string s;
    string t;
    cin>>s>>t;

    int n = s.length(),m = t.length();

    int ans = n;
    rep(i,n - m + 1,0){
        int count = 0;
        rep(j,m,0)if(s[i+j] == t[j])count++;
        ans = min(ans,m - count);
    }

    cout<<ans<<endl;
}#include <bits/stdc++.h>
using namespace std;
 
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define lli long long int
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
#define umap unordered_map
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define ipair pair <int,int>
#define llipair pair <lli,lli>
#define pq priority_queue
#define displaymatrix(a,m,n) for(int i=0;i<m;i++){for(int j=0;j<n;j++)cout<<a[i][j]<<" ";cout<<endl;}
#define printarray(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}nl;
#define vinput(a,n) vlli a(n);rep(i,n,0)cin>>a[i]
#define ainput(a,n) rep(i,n,0)cin>>a[i]
#define SO(a) sort(a.begin(),a.end())
#define all(x) (x).begin(),(x).end()
#define SOP(a,comp) sort(a.begin(),a.end(),comp)
#define inf INT_MAX
#define endl '\n'
 
int main()
{
    fastio;
    string s;
    string t;
    cin>>s>>t;

    int n = s.length(),m = t.length();

    int ans = n;
    rep(i,n - m + 1,0){
        int count = 0;
        rep(j,m,0)if(s[i+j] == t[j])count++;
        ans = min(ans,m - count);
    }

    cout<<ans<<endl;
}

Compiler output:
a.cc:46:2: error: stray '#' in program
   46 | }#include <bits/stdc++.h>
      |  ^
a.cc:46:3: error: 'include' does not name a type
   46 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:74:5: error: redefinition of 'int main()'
   74 | int main()
      |     ^~~~
a.cc:29:5: note: 'int main()' previously defined here
   29 | int main()
      |     ^~~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define ll long long
#define pb push_back
#define debug1(x) cerr << #x << " = " << x << '\n';
#define debug2(x, y) cerr << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define _ ios_base::sync_with_stdio(0);cin.tie(NULL);

void solve() {
    string s, t;
    cin >> s;
    cin >> t;
    int ans = INT_MAX;
    for(int i = 0; i<= int(s.size()) - int(t.size()); i++) {
        int curr = 0;
        for(int j = i; j<i+int(t.size()); j++) {
            if(s[j] != t[j-i]) curr ++;
        }
        ans = min(ans, curr);
    }
    cout << ans << '\n';
}

int main() {_
    int t = 1;
//    cin >> t;
    for(int i = 1; i<=t; i++) {
        solve();
    }
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:32:15: error: 'INT_MAX' was not declared in this scope
   32 |     int ans = INT_MAX;
      |               ^~~~~~~
a.cc:19:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   18 | #include <unordered_set>
  +++ |+#include <climits>
   19 |
Language: Java

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=(int)1e5;

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	string s,t;
	cin>>s>>t;
	int ans=t.length();
	for(int i=0;i+t.length()<=s.length();i++){
		int curr=0;
		for(int j=0;j<t.length();j++)
			if(s[i+j]!=t[j])
				curr++;
		ans=min(ans,curr);
	}
	cout<<ans<<"\n";

}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:4: error: class, interface, enum, or record expected
const int N=(int)1e5;
^
Main.java:7: error: not a statement
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	^
Main.java:9: error: not a statement
	cin>>s>>t;
	      ^
Main.java:18: error: not a statement
	cout<<ans<<"\n";
	         ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: ';' expected
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	                         ^
Main.java:7: error: ';' expected
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	                                        ^
10 errors
Language: C++

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

int main(){
  string S, T;
  cin >> S >> T;
  int ans = S.size();
  for(int i=0; i<=S.size-T.size(); i++){
    int count = 0;
    for(int j=0; j<T.size(); j++){
      if(S.size(i+j)!=T.size(j)) count++;
    }
    ans = min(ans, count);
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |   for(int i=0; i<=S.size-T.size(); i++){
      |                   ~~^~~~
      |                         ()
a.cc:12:16: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int)'
   12 |       if(S.size(i+j)!=T.size(j)) count++;
      |          ~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:12:29: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
   12 |       if(S.size(i+j)!=T.size(j)) count++;
      |                       ~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define db double
using namespace std;
int f(int x)
{
    int cnt=0;
    for(int i=x;i<x+t.size();i++)
        cnt+=(s[i]==t[i-x]);
    return cnt;
}
int main()
{
    string s,t;
    cin>>s>>t;
    int ans=t.size();
    for(int i=0;i<=s.size()-t.size();i++)
        ans=min(ans,f(i));
    cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int f(int)':
a.cc:8:21: error: 't' was not declared in this scope
    8 |     for(int i=x;i<x+t.size();i++)
      |                     ^
a.cc:9:15: error: 's' was not declared in this scope
    9 |         cnt+=(s[i]==t[i-x]);
      |               ^
Language: C++

#include <stdio.h>
#include <string.h>

char x[1010],y[1010];
int main()
{
	scanf("%s%s",x+1,y+1);
	int a = strlen(x+1);
	int b = strlen(y+1);
	
	int ans = 12345;
	for(int i=1;i<=a-b+1;i++)
	{
		int count = 0;
	

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected '}' at end of input
   14 |                 int count = 0;
      |                               ^
a.cc:13:9: note: to match this '{'
   13 |         {
      |         ^
a.cc:14:31: error: expected '}' at end of input
   14 |                 int count = 0;
      |                               ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  string s,t;
  cin >> s >> t;
  int ans=MAX;
  rep(i,s.size()-t.size()+1) {
    string r=s.substr(i,t.size());
    ll cnt=0;
    rep(j,r.size()) {
      if(r[j]!=t[j]) cnt++;
    }
    ans=min(ans,cnt);
  }
  pr(ans);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Compiler output:
a.cc: In function 'void Main()':
a.cc:34:12: error: no matching function for call to 'min(int&, long long int&)'
   34 |     ans=min(ans,cnt);
      |         ~~~^~~~~~~~~
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:34:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   34 |     ans=min(ans,cnt);
      |         ~~~^~~~~~~~~
/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:34:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   34 |     ans=min(ans,cnt);
      |         ~~~^~~~~~~~~
Language: Java

import java.util.*;
public class Main {
    public static long mod(long x, long y){
    return x%y<0?x%y+(y<0?-y:y):x%y;
    }
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long [] in = new long [a];
        long b = 1000000007;
        long sum = 0;
        long mul = 0;
        for(int i=0;i<a;i++){
                             in[i] = sc.nextLong();
                             sum+=in[i];
                             mul+=in[i]*in[i];
                             sum=mod(sum,b);
                             mul=mod(mul,b);
                            }       
        long ans = mod(sum-mul,mod);
        if(ans%2==1){ans=mod(ans+b,mod);}
		System.out.println(ans);
	}
}

Compiler output:
Main.java:20: error: cannot find symbol
        long ans = mod(sum-mul,mod);
                               ^
  symbol:   variable mod
  location: class Main
Main.java:21: error: cannot find symbol
        if(ans%2==1){ans=mod(ans+b,mod);}
                                   ^
  symbol:   variable mod
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <cstdlib>  
#include <algorithm>
#include <string>

using namespace std;
 
int main() {
    int n;cin>>n;
    long long sum = 0;
    int A[n];
    int C[n-1];
    long long mod = 1000000007; 
    long long ans = 0;
    for(int i = 0;i<n;ai++){
    	cin>>A[i];
        sum += A[i];
    }
    for(int i = 0;i<n-1;i++){
        sum-=A[i];
        C[i] = sum;
    }
  	for(int i = 0;i<n-1;i++){
    	ans += A[i]*C[i];
        ans%=mod;
    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'ai' was not declared in this scope; did you mean 'i'?
   16 |     for(int i = 0;i<n;ai++){
      |                       ^~
      |                       i
Language: C++

#include <bits/stdc++.h>
#define ll long long 
#define MOD 1000000007
using namespace std;
int a[200005];
int S[200005];
ll add(ll a,ll b){
	return (a%MOD+B%MOD)%MOD;
}
ll mul(ll a,ll b){
	return (a%MOD*B%MOD)%MOD;
}
int main(){
	int n ;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	S[1] = a[1];
	for(int i=2;i<=n;i++){
		S[i] = S[i-1]+a[i];
	}
	ll ans = 0;
	for(int i=1;i<=n-1;i++){
		add(ans,mul(a[i],S[n]-S[i]));
	}
	cout<<ans;
} 

Compiler output:
a.cc: In function 'long long int add(long long int, long long int)':
a.cc:8:23: error: 'B' was not declared in this scope
    8 |         return (a%MOD+B%MOD)%MOD;
      |                       ^
a.cc: In function 'long long int mul(long long int, long long int)':
a.cc:11:23: error: 'B' was not declared in this scope
   11 |         return (a%MOD*B%MOD)%MOD;
      |                       ^
Language: C++

#include <iostream>

using namespace std;
typedef long long int ll;

int main(void) {
  int n; cin >> n;
  ll a[n], sum, ans=0;
  for (size_t i = 0; i < n; i++) cin >> a[i];
  for (size_t i = 0; i < n-1; i++) {
    sum=0;
    for (size_t j = i+1; j < n; j++) sum+=a[j];
    a[j]=a[j]%1000000007;
    ans=ans+(a[i]*a[j])%1000000007;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'j' was not declared in this scope
   13 |     a[j]=a[j]%1000000007;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> B(N+1,0);
  int mod = 1e9+7;
  vector <int> A(N);
  
  for(int i = 0, i < N, i++){
    cin >> A(N);
    B[i+1] = B[i] + A[i];
  }
  long long ans = 0;
  for (int i=0, i<N, i++){
    long long sum = (B[N]-A[i])%mod;
    ans += A[i]*sum;
    ans %= mod;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '<' token
   10 |   for(int i = 0, i < N, i++){
      |                   ^~
      |                   ;
a.cc:10:20: error: expected primary-expression before '<' token
   10 |   for(int i = 0, i < N, i++){
      |                    ^
a.cc:10:28: error: expected ';' before ')' token
   10 |   for(int i = 0, i < N, i++){
      |                            ^
      |                            ;
a.cc:11:13: error: no match for call to '(std::vector<int>) (int&)'
   11 |     cin >> A(N);
      |            ~^~~
a.cc:15:18: error: expected ';' before '<' token
   15 |   for (int i=0, i<N, i++){
      |                  ^
      |                  ;
a.cc:15:18: error: expected primary-expression before '<' token
a.cc:15:25: error: expected ';' before ')' token
   15 |   for (int i=0, i<N, i++){
      |                         ^
      |                         ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> B(N+1,0);
  int mod = 1e9+7;
  vector <int> A(N);
  
  for(int i = 0, i < N, i++){
    cin >> A(N);
    B[i+1] = B[i] + A[i];
  }
  long long ans = 0;
  for (int i=0, i<N, i++){
    long long sum = (B[N]-A[i])%mod;
    ans += A[i]*sum;
    ans %= mod
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '<' token
   10 |   for(int i = 0, i < N, i++){
      |                   ^~
      |                   ;
a.cc:10:20: error: expected primary-expression before '<' token
   10 |   for(int i = 0, i < N, i++){
      |                    ^
a.cc:10:28: error: expected ';' before ')' token
   10 |   for(int i = 0, i < N, i++){
      |                            ^
      |                            ;
a.cc:11:13: error: no match for call to '(std::vector<int>) (int&)'
   11 |     cin >> A(N);
      |            ~^~~
a.cc:15:18: error: expected ';' before '<' token
   15 |   for (int i=0, i<N, i++){
      |                  ^
      |                  ;
a.cc:15:18: error: expected primary-expression before '<' token
a.cc:15:25: error: expected ';' before ')' token
   15 |   for (int i=0, i<N, i++){
      |                         ^
      |                         ;
a.cc:18:15: error: expected ';' before '}' token
   18 |     ans %= mod
      |               ^
      |               ;
   19 |   }
      |   ~
Language: Java

import java.util.Scanner;
public class Main1 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextInt();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=sc.nextInt();
		}
		long num=(int)(Math.pow(10, 9))+7;
		long sum=0;
		for(long i=0;i<n;i++)
		{
			for(long j=i+1;j<n;j++)
			{
				sum=sum+(arr[(int)i]*arr[(int)j])%num;
				
			}
		}
		System.out.println(sum%num);
	}

}


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

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    ll s = 0, r = 0;
    vector<ll> a(n);
    for (ll &i : a) {
        cin >> i; s += i;
    }
    s %= 1e9 + 7;
    for (ll i : a) {
        s -= i;
        s %= 1e9 + 7;
        r += s * i;
        r %= 1e9 + 7;
    }
    cout << (r + 1e9 + 7) % (1e9 + 7) << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   15 |     s %= 1e9 + 7;
      |     ~~^~~~~~~~~~
a.cc:15:7: note:   in evaluation of 'operator%=(ll {aka long long int}, double)'
a.cc:18:11: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   18 |         s %= 1e9 + 7;
      |         ~~^~~~~~~~~~
a.cc:18:11: note:   in evaluation of 'operator%=(ll {aka long long int}, double)'
a.cc:20:11: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   20 |         r %= 1e9 + 7;
      |         ~~^~~~~~~~~~
a.cc:20:11: note:   in evaluation of 'operator%=(ll {aka long long int}, double)'
a.cc:22:27: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   22 |     cout << (r + 1e9 + 7) % (1e9 + 7) << endl;
      |             ~~~~~~~~~~~~~ ^ ~~~~~~~~~
      |                      |           |
      |                      double      double
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    ll s = 0, r = 0;
    vector<ll> a(n);
    for (int &i : a) {
        cin >> i; s += i;
    }
    s %= 1e9 + 7;
    for (int i : a) {
        s -= i;
        s %= 1e9 + 7;
        r += s * i;
        r %= 1e9 + 7;
    }
    cout << (r + 1e9 + 7) % (1e9 + 7) << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   12 |     for (int &i : a) {
      |                   ^
a.cc:15:7: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   15 |     s %= 1e9 + 7;
      |     ~~^~~~~~~~~~
a.cc:15:7: note:   in evaluation of 'operator%=(ll {aka long long int}, double)'
a.cc:18:11: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   18 |         s %= 1e9 + 7;
      |         ~~^~~~~~~~~~
a.cc:18:11: note:   in evaluation of 'operator%=(ll {aka long long int}, double)'
a.cc:20:11: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   20 |         r %= 1e9 + 7;
      |         ~~^~~~~~~~~~
a.cc:20:11: note:   in evaluation of 'operator%=(ll {aka long long int}, double)'
a.cc:22:27: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   22 |     cout << (r + 1e9 + 7) % (1e9 + 7) << endl;
      |             ~~~~~~~~~~~~~ ^ ~~~~~~~~~
      |                      |           |
      |                      double      double
Language: C++

#include<iostream>
#include<vector>

int main(){
  	int N;
  	std::cin >> N;
	std::vector<long> A(N);
  	for(int i=0; i<N; i++){
    	std::cin >> A.at(i);
    }
  	long sum = 0;
  	for(int j = 0; j<N; j++){
    	for(int k = 0; k <= j; k++){
        	sum += A.at(k) * A.at(j);
         // 	std::cout << sum << std::endl;
        }
    }
  	const long exp9 =1000000000;
  //    	std::cout << exp << std::endl;
    }
  	std::cout << sum % (exp9 + 7) << std::endl;
	return 0;
}


Compiler output:
a.cc:21:14: error: 'cout' in namespace 'std' does not name a type
   21 |         std::cout << sum % (exp9 + 7) << std::endl;
      |              ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:9: error: expected unqualified-id before 'return'
   22 |         return 0;
      |         ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
using ll=long long;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)
using P=pair<int,int>;
const int mod=1000000007;

int main(){
int n,x;
ll a[n];
rep(i,n){
  cin>>a[i];
}
rep(i,n){
   int sum+=(a[i]*x)%mod;
  x+=(a[i]%mod);
}

}




Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: expected initializer before '+=' token
   19 |    int sum+=(a[i]*x)%mod;
      |           ^~
Language: C++

/**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                                                               *-*
*-*                  Bismillahir Rahmanir Rahim                   *-*
*-*                                                               *-*
*-*                  Author: Ahsan Habib (comrade)                *-*
*-*                    Metropolitan University                    *-*
*-*                         Language: C++                         *-*
*-*                                                               *-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**/
#include<bits/stdc++.h>
#include<istream>
#include<cstdio>
#define pii          pair<ll,ll >
#include<string>
#define In freopen("ahsan.txt","r",stdin);
#define ll long long
#define ff first
#define ss second
#define NO cout<<"NO"<<endl
#define m1 cout<<"-1"<<endl
#define No cout<<"No"<<endl
#define cinarr0(n) for(int i = 0;i<n;i++)cin>>a[i];
#define cinarr1(n) for(int i = 1;i<=n;i++)cin>>a[i];
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define pb push_back
#define sorta(a) sort(a,a+n)
#define sortv(v)  sort(v.begin,v.end())
#define bug(a) cerr << #a << " : " << a << endl
#define all(v) (v.begin(), v.end())
#define   sz(x)       x.size()
#define fill(x, y) memset(x, y, sizeof(x))
const int mx = 1e6+5;
const ll md = 1e9+7;
using namespace std;
ll a[200010],m,ans,i,t,k,ev=0,od=0,tt=0,n,cas = 1;
vector<int>vec[mx];
int ar[10000][10000];
vector<pii>v;
bool ok = true;
int main()
{
    //In;
  ///  ios::sync_with_stdio(false);
    ///cin.tie(0);
    ll   n,tot  = 0;

    cin>>n;
    vector<ll>a(n);
    ll ans = 0;
    int md = 1000000007;
    for(int i = 0 ; i <n; i++)
    {
        cin>>a[i];
        tot  = tot + a[i];
    }


    for(int i = 0 ; i <n; i++)
    {
         tot = tot - a[i];
         if(sum<0)tot+=md;
         ans = ans + a[i]*tot;
         ans = ans%md;
    }
    cout<<ans<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:13: error: 'sum' was not declared in this scope
   64 |          if(sum<0)tot+=md;
      |             ^~~
Language: C++

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

typedef unsigned long long ll;
#define mod 1000000007
#define all(x) (x).begin(),(x).end()

void solve(){
	int n;
	cin>>n;
	vector<int> v(n);	
	long long ans=0;
	for(size_t &i:v){
		cin>>i;
		ans += i;
      	ans %= mod;
	}	
	long resp = 0;
	for(size_t i:v){
		ans -= i;      
		if(ans < 0) ans += mod;          
		resp += (i * ans);
        resp %= mod;
	}
	cout<<resp<<endl;
}


int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:13:23: error: cannot bind non-const lvalue reference of type 'size_t&' {aka 'long unsigned int&'} to a value of type 'int'
   13 |         for(size_t &i:v){
      |                       ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<long long> A(n);
  vector<long long> B(n);
  long long x = 0, mod = 1000000007, b=0, t=0;
  for(int i=0; i<n; i++){
    cin >> A[i];
    b += A[i];
    b %= mod;
    B[i] = b;
  }
  for(int i=0; i<n-1; i++){
    if(b>B[i]) t = b - B[i];
    else t = b - B[i] + mod;
    x += A[i]*t
    x %= mod;
  }
  cout << x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: expected ';' before 'x'
   19 |     x += A[i]*t
      |                ^
      |                ;
   20 |     x %= mod;
      |     ~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<long long> A(n);
  vector<long long> B(n);
  long long x = 0, mod = 1000000007, b=0;
  for(int i=0; i<n; i++){
    cin >> A[i];
    b += A[i];
    b %= mod;
    B[i] = b;
  for(int i=0; i<n-1; i++){
    x += A[i]*(b-B[i]);
    x %= mod;
  }
  cout << x;
}


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

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

int main() {
  int N;
  cin >> N;
  
  vector<long long> map(N);
  
  for (int i = 0; i < N; i++)
    cin >> map.at(i);

  long long ans = 0;
  
  for (int i = 0; i < N - 1; i++) {
    for (int j = i + 1 < N; j++) {
      ans += (map.at(i) * map.at(j))
        % (1000000000 + 7);
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: expected ';' before ')' token
   16 |     for (int j = i + 1 < N; j++) {
      |                                ^
      |                                ;