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

#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (isupper(s)) {
    cout << "A" << endl;
  } else {
    cout << "a" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: no matching function for call to 'isupper(std::string&)'
   12 |   if (isupper(s)) {
      |       ~~~~~~~^~~
In file included from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/locale_facets.h:2631:5: note: candidate: 'template<class _CharT> bool std::isupper(_CharT, const locale&)'
 2631 |     isupper(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2631:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/ios:43:
/usr/include/ctype.h:117:1: note: candidate: 'int isupper(int)'
  117 | __exctype (isupper);
      | ^~~~~~~~~
/usr/include/ctype.h:117:1: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  117 | __exctype (isupper);
      | ^~~~~~~~~
Language: C++

///In the name of GOD
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MXN = 4e5 + 10;
ll n, a, b, c, d;
int main(){
    ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
    char ch;
    cin >> ch;
    cout << (ch <= 'Z' : 'A' : 'a');
    return 0;
}
/*!
    I CHOOSE TO HAVE FAITH,
    BECAUSE WITHOUT THAT,
    I HAVE NOTHING....
    ITS THE ONLY THING THAT'S KEEPING ME GOING.
*/
//! N.N


Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ')' before ':' token
   12 |     cout << (ch <= 'Z' : 'A' : 'a');
      |             ~         ^~
      |                       )
Language: C++

#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i+=1)
#define reps(i,a,b) for(int i=a;i>=b;i-=1)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pb push_back
#define pi pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define in1(x) int x; cin>>x;
#define in2(x, y) int x, y; cin>>x>>y;
#define in3(x, y, z) int x, y, z; cin>>x>>y>>z;
#define in4(x, y, z, w) int x, y, z, w; cin>>x>>y>>z>>w;
#define mi unordered_map<int,int>
#define mem(x) memset(x, 0, sizeof(x))
#define IOS ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define mod 1000000007
using namespace std;

//bool primes[1000001];vi prime;
//void seive(){memset(primes, true, sizeof(primes));primes[0] = primes[1] = false;for(int i = 2; i*i<=1000000;i += 1){
//if(primes[i]){for(int j = i*i; j <= 1000000;j += i) primes[j] = false;}}rep(i, 2, 1000001){if(primes[i]) prime.pb(i);}}
//int gcd(int a, int b){return b==0 ? a : gcd(b, a%b);}
//int power(int x, int y){ int res = 1;x = x % mod; if (x == 0) return 0;
//while (y > 0){ if(y & 1) res = (res*x) % mod; y = y>>1; x = (x*x) % mod;} return res;}

int32_t main(void){
	IOS;
	char c;
	cin>>c;
	if(is_upper(c)) cout<<"A";
	else cout<<"a";
	
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:33:12: error: 'is_upper' was not declared in this scope; did you mean 'iswupper'?
   33 |         if(is_upper(c)) cout<<"A";
      |            ^~~~~~~~
      |            iswupper
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n,k,ans=0;
    char c;
    cin>>c;
    if(c>='a' && c<='z')
    {
        cout<"a"<<endl;
    }
    else
    {
        cout<<"A"<<endl;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'
   11 |         cout<"a"<<endl;
      |              ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll t , n,c,x , y , a, b,c , d ,sum;
string s;
char ch;
int main()
{
    
    cin >> ch;
    if(ch<='Z'&&ch>='A')
    {
        cout << 'A';
    }
    else cout <<'a';
    return 0;
}


Compiler output:
a.cc:5:25: error: redefinition of 'll c'
    5 | ll t , n,c,x , y , a, b,c , d ,sum;
      |                         ^
a.cc:5:10: note: 'll c' previously declared here
    5 | ll t , n,c,x , y , a, b,c , d ,sum;
      |          ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vvll vector<vll>
#define all(v) v.begin(),v.end()
#define itr(r,v) for(auto r=v.begin();r!=v.end();r++)
#define W while
#define FOR(i,n) for(ll i=0;i<n;i++)
#define ffor(i,a,b) for(ll i=a;i<=b;i++)
#define rfor(i,a,b) for(ll i=a;i>=b;i--)
#define space cout<<"\n\n";
#define endl "\n"
#define pqmx priority_queue<ll>
#define pqmn priority_queue<ll,vll,greater<ll>>
#define fps(x,y) fixed<<setprecision(y)<<x
#define merg(a,b,c) set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.begin()))
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define ctime auto start = high_resolution_clock::now()
#define etime auto stop = high_resolution_clock::now()
#define ptime auto z1z = duration_cast<microseconds>(stop-start); cout<<"Time elapsed : "<<z1z.count()<<" microseconds\n"
#define go_t ll testcases; cin>>testcases; while(testcases--)
#define dbg1(x)             cout <<#x<<": "<<x<<'\n';
#define dbg2(x, y)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<'\n';
#define dbg3(x, y, z)       cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<'\n';
#define dbg4(a, b, c, d)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<'\n';
#define dbg5(a, b, c, d, e) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<'\n';
using namespace std;
using namespace std::chrono;

const ll MOD = 1e9 + 7;
const ll N = 2005;
const ll maxN = 1e5 + 5;
const ll MAX_SIZE = 1e8 + 8;

ll power(ll x, ll y, ll M = MOD) // default argument
{ll v = 1; x = x % M; while (y > 0) {if (y & 1)v = (v * x) % M; y = y >> 1; x = (x * x) % M;} return v;}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	// WHILE(!(SUCCEED == TRY()));
	// BEFORE WRITING MAKE SURE YOU HAVE ANALYSED THE CONSTRAINTS
	// AND THINK THROUGH THE LOGIC ONCE MORE
	FIO
	char ch; cin>>ch;
	if(ch<=Z && ch>=A) cout<<'A'<<endl;
	else cout<<'a'<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:16: error: 'Z' was not declared in this scope
   60 |         if(ch<=Z && ch>=A) cout<<'A'<<endl;
      |                ^
a.cc:60:25: error: 'A' was not declared in this scope
   60 |         if(ch<=Z && ch>=A) cout<<'A'<<endl;
      |                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define getMat(x, n, m, val) vector<vector<ll>> x(n, vector<ll> (m, val))
#define setp fixed<<setprecision
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll M=1000000000+7;
 
ll power(ll x,ll n)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
    return result;
}

int main(){
    ll t=1;
    // cin>>t;
    while(t--){
        char c;
        cin>>c;
        if(c>='A' && c<='Z')cout<<'A';
        else cout<<'a'
        cout<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: expected ';' before 'cout'
   30 |         else cout<<'a'
      |                       ^
      |                       ;
   31 |         cout<<endl;
      |         ~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define ill long long
#define fcout cout << fixed << setprecision(10)
using namespace std;

int main() {
  char a;
  cin >> a;
  if(a =< 'z' && a >= 'a') {
    cout << 'a';
  } else {
    cout << 'A';
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected primary-expression before '<' token
   15 |   if(a =< 'z' && a >= 'a') {
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll t,i,j,n,a,b,c,d,k;
	char a;
	cin>>a;
	if('a'<=a and a<='z') cout<<'a\n';
	else cout<<'A\n';
	return 0;
}

Compiler output:
a.cc:11:37: warning: multi-character character constant [-Wmultichar]
   11 |         if('a'<=a and a<='z') cout<<'a\n';
      |                                     ^~~~~
a.cc:12:20: warning: multi-character character constant [-Wmultichar]
   12 |         else cout<<'A\n';
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:9:14: error: conflicting declaration 'char a'
    9 |         char a;
      |              ^
a.cc:8:20: note: previous declaration as 'll a'
    8 |         ll t,i,j,n,a,b,c,d,k;
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const double pi=3.14159265358979323846;
int ctoi(const char c) {
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
void output(vector<int> vec) {
    for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    return;
}
vector<vector<int>> input(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void output(vector<vector<int>> table) {
    for (int i = 0; i < table.size(); i++) {
        for (int j = 0; j < table.at(0).size(); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long homo(int n, int r) {
    return comb(n + r - 1, n - 1);
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b){
    if (a % b == 0){
        return(b);
    }else{
        return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
bool isprime(int n){
    if (n < 2) return false;
    else if (n == 2) return true;
    else if (n % 2 == 0) return false;

    for (int i = 3; i <= sqrt(n); i += 2){
        if (n % i == 0){
            return false;
        }
    }
    return true;
}
void sayYes(bool f) {
    if (f) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
void sayYES(bool f) {
    if (f) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}

int main() {
  char c;
  cin >> c;
  if('a'<=c&&c<=''z){
    cout << 'a' << endl;
  }else{
    cout << 'A' << endl;
  }
}

Compiler output:
a.cc:114:17: error: empty character constant
  114 |   if('a'<=c&&c<=''z){
      |                 ^~~
a.cc: In function 'int main()':
a.cc:114:17: error: unable to find character literal operator 'operator""z' with 'char' argument
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acosl(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define EPS 1e-4
#define arg ARG
#define cpdd const pdd
#define rank Rank
#define MAXN 205
//#define N 262144
#define ULL unsigned long long
#define ll long long
int main(){
    char c[1000005];
    scanf("%s",c);
    for(int i=  0;c[i]!=0;i++){
        if(c[i]>='a')printf("a");
        else printf("A");
    }
    rprintf("\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'rprintf' was not declared in this scope; did you mean 'wprintf'?
   31 |     rprintf("\n");
      |     ^~~~~~~
      |     wprintf
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Main {
	public static void main(String[] args)throws IOException {
		FastReader sc = new FastReader();
		PrintWriter pw = new PrintWriter(System.out);
		String s = sc.next();
		if (s.isLower()) {
			System.out.println("a");
		} else
			System.out.println("A");

	}

}





class FastReader {
	BufferedReader br;
	StringTokenizer st;

	public FastReader() {
		br = new BufferedReader(new
		                        InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException  e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

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

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

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

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return str;
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
		if (s.isLower()) {
		     ^
  symbol:   method isLower()
  location: variable s of type String
1 error
Language: C++

#include <bits/stdc++.h>
#include <stdio.h>
#define ll long long
#define fr(i,p,n) for(int i=p;i<n;i++)
#define fr1(i,p,n) for(int i=p;i>=n;i--)
#define FAST ios::sync_with_stdio(0);
#define sz(v) (int)v.size()
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define PI 3.14159265358979323846
#define MOD 1000000007
#define MOD1 998244353
#define precise cout << std::setprecision(12) << std::fixed;
#define endl "\n"
using namespace std;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    FAST
    int t=1;
    //cin>>t;
    while(t--)
    {
        char ch;
        cin>>ch;
        if(ch>='A' && ch<='Z') cout<<A<<endl;
        else cout<<a<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:38: error: 'A' was not declared in this scope
   30 |         if(ch>='A' && ch<='Z') cout<<A<<endl;
      |                                      ^
a.cc:31:20: error: 'a' was not declared in this scope
   31 |         else cout<<a<<endl;
      |                    ^
Language: C++

/* HARDWORK IS THE KEY TO SUCCESS.
   RATING IS TEMPORARY , KNOWLEDGE IS PERMANENT.!!!*/

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define T int t = 1; cin>>t; while(t--)
#define ain int n,k,i; cin>>n; int a[n]; for(i=0;i<n;i++) cin>>a[i]
#define matin ll m,n; cin >> n >> m; ll a[n + 1][m + 1]; for(ll i=1;i<=n;i++) for(ll j=1;j<=m;j++) cin>>a[i][j];
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define I insert
#define pb push_back

const ll maxs = 1e5+3;
const ll maxs1 = 1e3+4;
const ll mod = 1e9 + 7;
inline ll add(ll a, ll b) { return (mod + a + b) % mod;}
inline ll sub(ll a, ll b) {return (a - b + mod) % mod;}
inline ll mul(ll a, ll b) {return (1ll * a * b) % mod;}
ll fastpow(ll x, ll y) {
    ll res = 1; x = x % mod; while (y > 0) { if(y & 1) res = (res * x) % mod; y = y >> 1;x = (x * x) % mod;}return res;}
ll inv(ll x) {
    return fastpow(x, mod - 2);
}



int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    
    char c;
    cin >> c;
    if(c >= 'a' && c <= 'z')
        cout << a;
    else
        cout << A;
    
    
    
    
    
    
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: 'a' was not declared in this scope
   41 |         cout << a;
      |                 ^
a.cc:43:17: error: 'A' was not declared in this scope
   43 |         cout << A;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
const int mod=1e9+7;
 
int dx[]={-1, 0, 1, 0};
int dy[]={0, -1, 0, 1};



int32_t main()
{

ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);



chr c;
cin>>c;
if(c>='A'&&c<='Z')
{
    cout<<"A";
}
else cout<<"a";


}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:21:1: error: 'chr' was not declared in this scope; did you mean 'char'?
   21 | chr c;
      | ^~~
      | char
a.cc:22:6: error: 'c' was not declared in this scope
   22 | cin>>c;
      |      ^
Language: C++

#include <bits/stdc++.h>
#define optimize ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0) ;
#define ll long long
#define ld long double
#define vi vector<int>
#define si set<int>
#define vc vector<char>
#define vll vector<ll>
#define vd vector<double>
#define pb push_back
#define lp(i,a,b) for(int i = a ; i <= b ; i ++)
#define rlp(i,a,b) for(int i = b ; i >= a ; i --)
#define a_sort(v) sort(v.begin(), v.end())
#define d_sort(v) sort(v.rbegin(), v.rend())
#define pii pair<int,int>
#define pi 3.14159265358979323846264338327950
using namespace std ;
// #define debug

const int MOD = 1E9 + 7 ;
const int N = 1E5 ;

int main() {
    #ifdef debug
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif // debug
    optimize

    char a ; cin >> a ;
    puts(isupper(a) ? 'A' : 'a') ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   31 |     puts(isupper(a) ? 'A' : 'a') ;
      |          ~~~~~~~~~~~^~~~~~~~~~~
      |                     |
      |                     char
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:714:30: note:   initializing argument 1 of 'int puts(const char*)'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	char a; cin>>a;
	if(isupper(a))
	{
		cout<<'A';
	}
	else
{
	cout<<'a''
}


}

Compiler output:
a.cc:13:18: warning: missing terminating ' character
   13 |         cout<<'a''
      |                  ^
a.cc:13:18: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:13:18: error: expected ';' before '}' token
   13 |         cout<<'a''
      |                  ^
      |                  ;
   14 | }
      | ~
Language: C++

#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int INF=1e10;
int MOD=1e9+7;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int kurai(int a,int b){
  int m=pow(10,b),n=pow(10,b-1);
  return (a%m)/n;
}
int ketawa(int a){
  int k=0;
  rep(i,keta(a)){
  k+=kurai(a,i+1);
  }
  return k;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
int mid(int a,int b,int c){
  vector<int> k(3);
  k[0]=a;k[1]=b;k[2]=c;
  sort(all(k));
  return k[1];
}
bool sosuu(int a){
  bool b=1;
  if(a<=1)
    return 0;
  else{
  rep1(i,sqrt(a)-1){
  if(a%(i+1)==0)
  b=0;
  }
  return b;
  }
}
int modpow(int a,int b,int m=MOD){
 if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m;
 int memo = modpow(a,b>>1,m);
 return memo*memo%m;
}
int fact_mod(int n) {
    int f=1; 
for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD;
    return f;
}
int mod_pow(int x,int n) {
    int res=1;
    while(n>0){
        if(n&1) res=(res*x)%MOD; 
        x=(x*x)%MOD;        
n>>=1; 
    }
    return res;
}
int c_mod(int n, int r) {
    if(r>n-r) r=n-r;
    if(r==0) return 1;
    int a=1;
    rep(i,r) 
a=a*((n-i)%MOD)%MOD;
    int b=mod_pow(fact_mod(r), MOD-2);
    return (a%MOD)*(b%MOD)%MOD;
}
signed main(){
  char a;
  cin>>a;
  if(a<="Z")
    out("A");
  else
    out("a");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:99:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   99 |   if(a<="Z")
      |      ~^~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "tst"
using namespace std;
const ll N = 3e5 + 9;
const ll inf = 1e9 + 7;
typedef pair<ll,ll> LL;

char x;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    cin>>x;
    if (x >= 'A'&&x <= 'Z') cout<<'A';
    else cout<<'a';
}
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "tst"
using namespace std;
const ll N = 3e5 + 9;
const ll inf = 1e9 + 7;
typedef pair<ll,ll> LL;

char x;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    cin>>x;
    if (x >= 'A'&&x <= 'Z') cout<<'A';
    else cout<<'a';
}


Compiler output:
a.cc:32:10: error: redefinition of 'const long long int N'
   32 | const ll N = 3e5 + 9;
      |          ^
a.cc:8:10: note: 'const long long int N' previously defined here
    8 | const ll N = 3e5 + 9;
      |          ^
a.cc:33:10: error: redefinition of 'const long long int inf'
   33 | const ll inf = 1e9 + 7;
      |          ^~~
a.cc:9:10: note: 'const long long int inf' previously defined here
    9 | const ll inf = 1e9 + 7;
      |          ^~~
a.cc:36:6: error: redefinition of 'char x'
   36 | char x;
      |      ^
a.cc:12:6: note: 'char x' previously declared here
   12 | char x;
      |      ^
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main(){
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;

int main()
{
  char l; scanf("%c", &l);
  if (l >= 'A' && l <= 'Z') printf("A\n");
  else prinf("a\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'prinf' was not declared in this scope; did you mean 'printf'?
   11 |   else prinf("a\n");
      |        ^~~~~
      |        printf
Language: C++

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	char c;
	cin >> c;
	cout << tolowr(c) << '\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'tolowr' was not declared in this scope; did you mean 'tolower'?
    9 |         cout << tolowr(c) << '\n';
      |                 ^~~~~~
      |                 tolower
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    char a; cin >> a;
    if(islower(c)) return 'a';
    else return 'A';
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<char>() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'Type solve(Type)':
a.cc:29:16: error: 'c' was not declared in this scope
   29 |     if(islower(c)) return 'a';
      |                ^
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 K = sc.nextInt();
        int[] A = new int[N];
        for(int i=0; i<N; i++){
            A[i]=sc.nextInt();
        }
        int res;
        Arrays.sort(A);
        for(int i=0; i<K; i++){
            res += A[i];
        }
        System.out.println(res);
        }
    }

Compiler output:
Main.java:14: error: variable res might not have been initialized
            res += A[i];
            ^
Main.java:16: error: variable res might not have been initialized
        System.out.println(res);
                           ^
2 errors
Language: C

#include<stdio.h>

int main(void){
  int n,k;
  scanf("%d %d",&n,&k);
  int p[n];
  for(int i=0;i<n;i++){
  scanf("%d",&p[i]);
  }
  int tmp;
  for (i=0; i<n; ++i) {
    for (j=i+1; j<n; ++j) {
      if (p[i] > p[j]) {
        tmp =  p[i];
        p[i] = p[j];
        p[j] = tmp;
      }
    }
  }
  int c=0;
  
  for(int i=0;i<k;i++){
    c+=p[i];
  }
  printf("%d\n",c);
return 0;
}
    

               

Compiler output:
main.c: In function 'main':
main.c:11:8: error: 'i' undeclared (first use in this function)
   11 |   for (i=0; i<n; ++i) {
      |        ^
main.c:11:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:10: error: 'j' undeclared (first use in this function)
   12 |     for (j=i+1; j<n; ++j) {
      |          ^
Language: C++

#include<bits/stdc++.h>
#define endl "\n" 
using namespace std;
#define debug(x) cout<<"The value of "<<#x<<" is "<<x<<endl;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    cin.sync_with_stdio(0); cin.tie(0); 
    int n,k;
    cin>>n>>k;
    vector<int>arr(n);
    for(auto i:arr)
    cin>>i;
    ll ans=0;
    sort(arr.begin(),arr.end());
    for(int i=0;i<k;i++)
    ans+=arr[i]
    cout<<ans<<endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: expected ';' before 'cout'
   19 |     ans+=arr[i]
      |                ^
      |                ;
   20 |     cout<<ans<<endl;
      |     ~~~~
Language: C++

import numpy as np
import sys

if __name__ == "__main__":
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines

    n, k = map(int, readline().split())
    p = np.array(readline().split(), np.int64)

    p = np.sort(p)
    print(p[:k].sum())


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  vector<int> arr(n);
  map<int,int> mp;
  for(i=0;i<n;i++){
    cin>>arr[i];
    mp[arr[i]]++;
  }
  int ans=0;
  for(auto x:mp)
     ans+=x->first;
  cout<<ans<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<n;i++){
      |       ^
a.cc:13:12: error: base operand of '->' has non-pointer type 'std::pair<const int, int>'
   13 |      ans+=x->first;
      |            ^~
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;
  	vector<int> p(n);
  	for (int &i : p) {
      	cin >> i;
    }
  	sort(p.begin(), p.end());
  	cout << accumulate(p.begin(), p.begin() + k, 0) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:51: error: 'k' was not declared in this scope
   15 |         cout << accumulate(p.begin(), p.begin() + k, 0) << endl;
      |                                                   ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N,K;
  cin >> N >> K;
  int p[N];
  for(int i=0; i<N ; i++){
    cin >> p[i];
  }
  sort(p,p+N);
  int ans =0;
  for(int i=0; i<K; i++){
    ans += p[i];
  }
  cout << ans << endl;
}

    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(p,p+N);
      |   ^~~~
      |   short
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N,K;
  cin >> N >> K;
  int p[N];
  for(i=0; i<N ; i++){
    cin >> p[i];
  }
  sort(p,p+N);
  int ans =0;
  for(i=0; i<K; i++){
    ans += p[i];
  }
  cout << ans << endl;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0; i<N ; i++){
      |       ^
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(p,p+N);
      |   ^~~~
      |   short
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=0; i<K; i++){
      |       ^
Language: C++

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

int main(){
  int N,K,p[];
cin>>N>>K;
for(int i=0;i<N;i++){
  cin>>p[i];
}
int sum=0;
sort(p.begin(),p.end());
for(int i=0;i<K;i++){
  sum+=p[i];
}
cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: storage size of 'p' isn't known
    6 |   int N,K,p[];
      |           ^
Language: C++

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

int main() {
  int n;
  int k;
  cin >> n >> k;
  vector<int> v(n);
  int tmp;
  for (int i = 0; i < n; i++){
    cin >> v.at(i);
  }
  sort(v.begin(),v.end());
  int b=0
  for (int i = 0; i < b; i++){
    b=b+v.at(i);
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: expected ',' or ';' before 'for'
   15 |   for (int i = 0; i < b; i++){
      |   ^~~
a.cc:15:19: error: 'i' was not declared in this scope
   15 |   for (int i = 0; i < b; i++){
      |                   ^
Language: C++

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

int main() {
  int n;
  int k;
  cin >> n >> k;
  vector<int> v(n);
  int tmp;
  for (int i = 0; i < n; i++){
    cin >> v.at(i);
  }
  sort(v.begin()
       v.end);
  int b=0
  for (int i = 0; i < b; i++){
    b=b+v.at(i);
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected ')' before 'v'
   13 |   sort(v.begin()
      |       ~         ^
      |                 )
   14 |        v.end);
      |        ~         
a.cc:13:7: error: no matching function for call to 'sort(std::vector<int>::iterator)'
   13 |   sort(v.begin()
      |   ~~~~^~~~~~~~~~
   14 |        v.end);
      |        ~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for (int i = 0; i < b; i++){
      |   ^~~
a.cc:16:19: error: 'i' was not declared in this scope
   16 |   for (int i = 0; i < b; i++){
      |                   ^
Language: C++

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

int main() {
  int n;
  int k;
  cin >> n >> k;
  vector<int> v(a+1);
  int tmp;
  for (int i = 0; i < n; i++){
    cin >> v.at(i);
  }
  sort(v.begin()
       v.end);
  int b=0
  for (int i = 0; i < b; i++){
    b=b+v.at(i);
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'a' was not declared in this scope
    8 |   vector<int> v(a+1);
      |                 ^
a.cc:13:17: error: expected ')' before 'v'
   13 |   sort(v.begin()
      |       ~         ^
      |                 )
   14 |        v.end);
      |        ~         
a.cc:13:7: error: no matching function for call to 'sort(std::vector<int>::iterator)'
   13 |   sort(v.begin()
      |   ~~~~^~~~~~~~~~
   14 |        v.end);
      |        ~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for (int i = 0; i < b; i++){
      |   ^~~
a.cc:16:19: error: 'i' was not declared in this scope
   16 |   for (int i = 0; i < b; i++){
      |                   ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n,k;
  cin>>n>>k;
  int a[n];
  
  for(int i=0;i<n;i++)
    cin>>a[i];
  
  sort(a,a+n);
  int min_sum=0;
  for(int i=0;i<k;i++)
  {
    min_sum+=a[i];
  }
  
  cout<<min_sum<<"\n;
    return 0;
}

Compiler output:
a.cc:19:18: warning: missing terminating " character
   19 |   cout<<min_sum<<"\n;
      |                  ^
a.cc:19:18: error: missing terminating " character
   19 |   cout<<min_sum<<"\n;
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(a,a+n);
      |   ^~~~
      |   short
a.cc:20:5: error: expected primary-expression before 'return'
   20 |     return 0;
      |     ^~~~~~
Language: C++

#include<bits/stdc+.h>
using namespace std;
void solve()
{
  int n,k;
  cin>>n>>k;
  int arr[n];
  
  for(int i=0;i<n;i++)
    cin>>arr[i];
  
  sort(arr,arr+n);
  long long ans=0;
  for(int i=0;i<k;i++)
    ans+=arr[i];
  
  cout<<ans<<endl;
}

int main()
{
solve();
}

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

#include <iostream>
#include <vector>
using namespace std;
int main() {
    int n, k; cin >> n >> k;
    vector<int> P(n);
    int res = 0;
    for (int &a : nums) {
        cin >> a;
    }
    sort(P.begin(), P.end());
	for (int i = 0; i < k;i++) {
		res += a[i]
	}
	cout << res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'nums' was not declared in this scope
    8 |     for (int &a : nums) {
      |                   ^~~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(P.begin(), P.end());
      |     ^~~~
      |     short
a.cc:13:24: error: 'a' was not declared in this scope
   13 |                 res += a[i]
      |                        ^
Language: C++

#include <iostream>
#include <vector>
​
using namespace std;
​
int main() {
    int n, k; cin >> n >> k;
    vector<int> nums;
    int a;
    for (int i = 0 ; i < n; ++i) {
        cin >> a;
        nums.push_back(a);
    }
    sort(nums.begin(), nums.end());
​
    int res = 0;
    for (int i = 0; i < k; ++i) {
        res += nums[i];
    }    
	cout << res << endl;


Compiler output:
a.cc:3:1: error: '\U0000200b' does not name a type
    3 | ​
      |  
a.cc:5:1: error: '\U0000200b' does not name a type
    5 | ​
      |
Language: C++

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

int main() {
    int N, K; cin >> N >> K;
    vector<int> nums;
    int p;
    for (int i = 0 ; i < N; ++i) {
        cin >> p;
        nums.push_back(p);
    }

    sort(nums.begin(), nums.end());
    int res = 0;
    for (int i = 0; i < K; ++i) {
        res += nums[i];
    }    
	cout << res << endl;
}

Compiler output:
a.cc:3:1: error: '\U0000200b' does not name a type
    3 | ​
      |  
a.cc: In function 'int main()':
a.cc:7:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     int N, K; cin >> N >> K;
      |               ^~~
      |               std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> nums;
      |     ^~~~~~
a.cc:8:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> nums;
      |            ^~~
a.cc:12:9: error: 'nums' was not declared in this scope
   12 |         nums.push_back(p);
      |         ^~~~
a.cc:15:10: error: 'nums' was not declared in this scope
   15 |     sort(nums.begin(), nums.end());
      |          ^~~~
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(nums.begin(), nums.end());
      |     ^~~~
      |     short
a.cc:20:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         cout << res << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |         cout << res << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N, K; cin >> N >> K;
    vector<int> nums;
    int p;
    for (int i = 0 ; i < N; ++i) {
        cin >> p;
        nums.push_back(p);
    }
    sort(nums.begin(), nums.end());
    int res = 0;
    for (int i = 0; i < K; ++i) {
        res += nums[i];
    }    
	cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(nums.begin(), nums.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <vector>
​
using namespace std;
​
int main() {
    int N, K; cin >> N >> K;
    vector<int> nums;
    int p;
    for (int i = 0 ; i < N; ++i) {
        cin >> p;
        nums.push_back(p);
    }
    qsort(nums.begin(), nums.end());
    int res = 0;
    for (int i = 0; i < K; ++i) {
        res += nums[i];
    }    
	cout << res << endl;
}

Compiler output:
a.cc:3:1: error: '\U0000200b' does not name a type
    3 | ​
      |  
a.cc:5:1: error: '\U0000200b' does not name a type
    5 | ​
      |
Language: C++

#include <iostream>
#include <vector>
​
using namespace std;
​
int main() {
    int N, K; cin >> N >> K;
    vector<int> nums;
    int p;
    for (int i = 0 ; i < N; ++i) {
        cin >> p;
        nums.push_back(p);
    }
    sort(nums.begin(), nums.end());
    int res = 0;
    for (int i = 0; i < K; ++i) {
        res += nums[i];
    }    
	cout << res << endl;
}

Compiler output:
a.cc:3:1: error: '\U0000200b' does not name a type
    3 | ​
      |  
a.cc:5:1: error: '\U0000200b' does not name a type
    5 | ​
      |
Language: C++

#include <iostream>
#include <vector>
​
using namespace std;
​
int main() {
    int N, K; cin >> N >> K;
    vector<int> nums;
    int p;
    for (int i = 0 ; i < n; ++i) {
        cin >> p;
        nums.push_back(p);
    }
    sort(nums.begin(), nums.end());
    int res = 0;
    for (int i = 0; i < k; ++i) {
        res += nums[i];
    }    
	cout << res << endl;


Compiler output:
a.cc:3:1: error: '\U0000200b' does not name a type
    3 | ​
      |  
a.cc:5:1: error: '\U0000200b' does not name a type
    5 | ​
      |
Language: C++

#include <iostream>

using namespace std;

int solve() {
    int n, k; cin >> n >> k;
    vector<int> nums;
    int a;
    for (int i = 0 ; i < n; ++i) {
        cin >> a;
        nums.push_back(a);
    }
    sort(nums.begin(), nums.end());

    int res = 0;
    for (int i = 0; i < k; ++i) {
        res += nums[i];
    }

    return res;
}

int main() {
	cout << solve() << endl;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> nums;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> nums;
      |            ^~~
a.cc:11:9: error: 'nums' was not declared in this scope
   11 |         nums.push_back(a);
      |         ^~~~
a.cc:13:10: error: 'nums' was not declared in this scope
   13 |     sort(nums.begin(), nums.end());
      |          ^~~~
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(nums.begin(), nums.end());
      |     ^~~~
      |     short
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k,ans;
  cin >> n >> k;
  vector<int> p(n);
  for(int i=0;i<n;i++){
    int a;
    p[i]=a:
  }
  sort(p.begin(),p.end());
  for(int i=0;i<k;i++){
    ans += p[i];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before ':' token
    9 |     p[i]=a:
      |           ^
      |           ;
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 k = sc.nextInt();
    ArrayList<Integer> fruit = new ArrayList<Integer>();
    for(int i = 0;i < n;i++){
      fruit.add(sc.nextInt());
    }
    int sum = 0;
    for(int i = 0;i < k;i++){
      int min = 1001;
      for(int j = 0;j < fruit.size();j++){
        if(fruit.get(j) <= min){
          min = fruit.get(j);
          fruit.set(j,1001);
        }
      }
      sum += fruit;
    }
    System.out.println(sum);
  }
}
    

Compiler output:
Main.java:21: error: bad operand types for binary operator '+'
      sum += fruit;
          ^
  first type:  int
  second type: ArrayList<Integer>
1 error