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

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <set>
#include <functional>
#include <map>
#include <queue>
#include <cmath>
#include <string>
#include <stack>
using namespace std;
int main(void){
string str;
int K,P,Kcop,i=0;
char c;
cin >> str >> K;
Kcop=K;
while(str.size()>i+1){
	P=27-(str[i]-'a');
	if(P==27){cout<<"a";
		i++;
	}
	else if(K-P>=0){cout<<"a";
		K-=P;
		i++;
	}
	else {
		cout << str[i];
		i++;
	}
	}
P=27-(str[i]-'a');
if(P<K)K=K-27;
c=str[i]+K;
cout<<c;
return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:18:1: error: 'cin' was not declared in this scope
   18 | cin >> str >> K;
      | ^~~
a.cc:13:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   12 | #include <stack>
  +++ |+#include <iostream>
   13 | using namespace std;
a.cc:22:19: error: 'cout' was not declared in this scope
   22 |         if(P==27){cout<<"a";
      |                   ^~~~
a.cc:22:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:25: error: 'cout' was not declared in this scope
   25 |         else if(K-P>=0){cout<<"a";
      |                         ^~~~
a.cc:25:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:17: error: 'cout' was not declared in this scope
   30 |                 cout << str[i];
      |                 ^~~~
a.cc:30:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:1: error: 'cout' was not declared in this scope
   37 | cout<<c;
      | ^~~~
a.cc:37:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		int K = sc.nextInt();

		System.out.println(solve(s, K));
	}

	public static String solve(String s, int K) {

		char[] chars = s.toCharArray();
		int lastIndex = -1;
		int length = chars.length;

		for(char i=0; i<length; i++) {
			char c = chars[i];
			int count = ('z' - c) + 1;
			if(K >= count) {
				chars[i] = 'a';
				K -= count;
			}
			else {
				lastIndex = i;
			}

			if(K <= 0) break;
		}

		if(K > 0 && lastIndex >= 0) {
			if(K > 26) K = K % 26;
			char c = (char)(builder.charAt(lastIndex) + K);
			chars[i] = c;
		}

		return String.valueOf(chars);
	}
}

Compiler output:
Main.java:36: error: cannot find symbol
			char c = (char)(builder.charAt(lastIndex) + K);
			                ^
  symbol:   variable builder
  location: class Main
Main.java:37: error: cannot find symbol
			chars[i] = c;
			      ^
  symbol:   variable i
  location: class Main
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Scanner;

public class Test3 {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader inReader = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter outWriter = new BufferedWriter(new OutputStreamWriter(System.out));
		String finalOutput = "";
		String line;
		char[] charSet = null;
		int count = 0;
		int times = 0;
		HashMap<Character, Integer> mMap1 = new HashMap<>();
		HashMap<Integer, Character> mMap2 = new HashMap<>();
		mMap1.put('a', 97);

		mMap1.put('b', 98);
		mMap1.put('c', 99);
		mMap1.put('d', 100);
		mMap1.put('e', 101);
		mMap1.put('f', 102);
		mMap1.put('g', 103);
		mMap1.put('h', 104);
		mMap1.put('i', 105);
		mMap1.put('j', 106);
		mMap1.put('k', 107);
		mMap1.put('l', 108);
		mMap1.put('m', 109);
		mMap1.put('n', 110);
		mMap1.put('o', 111);
		mMap1.put('p', 112);
		mMap1.put('q', 113);
		mMap1.put('r', 114);
		mMap1.put('s', 115);
		mMap1.put('t', 116);
		mMap1.put('u', 117);
		mMap1.put('v', 118);
		mMap1.put('w', 119);
		mMap1.put('x', 120);
		mMap1.put('y', 121);
		mMap1.put('z', 122);
		for (Entry<Character, Integer> e : mMap1.entrySet()) {
			mMap2.put(e.getValue(), e.getKey());
		}

		finalOutput += " ";

		while ((line = inReader.readLine()) != null) {
			if (line.trim().compareTo("") == 0 || line == null || count == 3)
				break;

			switch (count) {
			case 0:
				// noPair = Integer.parseInt(line.trim());
				charSet = line.trim().toCharArray();
				break;
			case 1:
				times = Integer.parseInt(line.trim());

				break;
			}

			if (count == 1)
				break;
			++count;
		}

		for (int i = 0; i < charSet.length - 1; i++) {
			if (mMap1.get(charSet[i]) + times > mMap1.get('z')) {

				times = times - (mMap1.get('z') - mMap1.get(charSet[i]) + 1);
				charSet[i] = 'a';
			}

		}
		if (mMap1.get(charSet[charSet.length - 1]) + times > mMap1.get('z')) {

			charSet[charSet.length - 1] = 'a';
		} else
			charSet[charSet.length - 1] = mMap2.get(mMap1.get(charSet[charSet.length - 1]) + times);

		System.out.println(new String(charSet));

		
		inReader.close();
		outWriter.close();

	}

}


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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    string s;
    int k;
    cin>>s>>k;
    for(int i=0;i!=s.size()-1 && k>0;++i){
        if(k<'z'-s[i]+1)
            continue;
        else{
            k-='z'-s[i]+1;
            s[i]='a';
        }
    }
    k%=26;
    k = k % 26;
    int last = s[s.length()-1] - 'a' + k;
    s[len-1] = 'a' + (char)(last % 26);
    /*if(k>'z'-s[s.size()-1])
        k-=26;
    s[s.size()-1]=char(s[s.size()-1]+k);*/
    cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: 'len' was not declared in this scope; did you mean 'mblen'?
   21 |     s[len-1] = 'a' + (char)(last % 26);
      |       ^~~
      |       mblen
Language: C++

#include<stdio.h>
	int a,i;
	char b[100010];
int main(){
	scanf("%s",b);
	scanf("%d",&a);
	for(i=0;b[i]!='\0';i++){
		if(a>'z'-b[i]){
			a=a-('z'-b[i])-1;
			b[i]='a';
		}
	}
	b[i-1]=(b[i-1]-'a'+k)%26+'a';
	
		printf("%s",b);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: 'k' was not declared in this scope
   13 |         b[i-1]=(b[i-1]-'a'+k)%26+'a';
      |                            ^
Language: C++

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

using namespace std;

int main() {
	long long k;
	string s;

	cin >> s >> k;
	int len = s.length();

	for(int i = 0; i < len; i++){
		int dif = 26 - (s[i] - 'a'); 
		if(dif <= k){
			k -= dif;
			s[i] = 'a';
		}
	}
	k = k % 26;
	int last = s[len-1].compare("a");
	s[len-1] = 'a' + (char)(last % 26)

	cout << s << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: request for member 'compare' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(len - 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   24 |         int last = s[len-1].compare("a");
      |                             ^~~~~~~
a.cc:25:43: error: expected ';' before 'cout'
   25 |         s[len-1] = 'a' + (char)(last % 26)
      |                                           ^
      |                                           ;
   26 | 
   27 |         cout << s << endl;
      |         ~~~~
Language: C++

#include <iostream>
#include <stdio.h>       // printf,scanf
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>  //sort,binarySearch
#include <functional> 
#include <iomanip> // setprecision
#include <utility>    // c+11 Array
#include <set>
#include <sstream>
#include <bits/stdc++.h>
#define PI 3.141592653589793238462643383279
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define pb(x) push_back(x)
#define debug(x) cout << #x << " = " << x << endl;
#define debret(x) debug(x) ; return 0;

using namespace std;

 
int main(void){
    
    string str;
    int cnt;
    
    cin >> str;
    cin >> cnt;
 
    REP(i,str.size()){

        int t = 'z' - str[i] + 1

 
        if(str[i] != 'a' && t <= cnt){
            str[i] = 'a';
            cnt -= t;
        }
    }
 
    if(cnt != 0){
        char c = (str[str.size()-1] + cnt % 26);
        str[str.size()-1] = c;
    }
    
    cout << str << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: expected ',' or ';' before 'if'
   37 |         if(str[i] != 'a' && t <= cnt){
      |         ^~
Language: C++

#include <algorithm>
#include <vector>
#include <cstring>
#include <set>
#include <functional>
#include <map>
#include <queue>
#include <cmath>
#include <string>
#include <stack>
using namespace std;
int main(void){
string str;
int K,P,Kcop,i=0;
char c;
cin >> str >> K;
Kcop=K;
while(str.size()>i){
	P=27-(str[i]-'a');
	if(P==27){cout<<"a";
		i++;
	}
	else if(K-P>=0){cout<<"a";
		K=-P;
		i++;
	}
	else {
		cout << str[i];
		i++;
	}
	}
P=27-(str[i]-'a');
if(P>K)K-27;
c=str[i]+K;
cout<<c;
return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:16:1: error: 'cin' was not declared in this scope
   16 | cin >> str >> K;
      | ^~~
a.cc:11:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   10 | #include <stack>
  +++ |+#include <iostream>
   11 | using namespace std;
a.cc:20:19: error: 'cout' was not declared in this scope
   20 |         if(P==27){cout<<"a";
      |                   ^~~~
a.cc:20:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:25: error: 'cout' was not declared in this scope
   23 |         else if(K-P>=0){cout<<"a";
      |                         ^~~~
a.cc:23:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:17: error: 'cout' was not declared in this scope
   28 |                 cout << str[i];
      |                 ^~~~
a.cc:28:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:1: error: 'cout' was not declared in this scope
   35 | cout<<c;
      | ^~~~
a.cc:35:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

// #include <bits/stdc++.h>

#include<iostream>
#include<string>
#include<vector>
#include<algorithm> 
#include<functional> 
#include<cassert>
#include<numeric>
// std::accumulate(vec.begin(),vec.end(),0) sum of element
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<queue>


using namespace std;

typedef long long ll;
typedef std::pair<int, int> pii;
typedef vector<int> vi;

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(c) c.begin(),c.end()
#define show(x) cout << #x << " = " << x << endl

#define fi first
#define se second
#define pb push_back
#define mk make_pair


template <class X>
void unique_vector(std::vector<X> &t);
template <class X>
void print_vector(const std::vector<X> &t);

int main(){
  string s;
  int k;
  cin >> s;
  cin >> k;

  rep(i, s.size()){
    if(k == 0) break;
    int n = abs(s.at(i) - 'z') + 1;
    int t = k - n;
    // cout << abs(s.at(i)-'z')-1 << endl;
    // cout << t << endl;
    if(t < 0){
      continue;
    }else if(t >= 0){
      k -= n;
      s.at(i) = 'a';
    }
  }
  rep2(i,s.size()){
    if(s.at(i) != 'a')
      s.at(s.size()-1) += k%26;
  }

  cout << s << endl;
}


template <class X>
void unique_vector(std::vector<X> &t)
{
  std::sort(t.begin(), t.end());
  t.erase( std::unique(t.begin(), t.end()), t.end() );
}

template <class X>
void print_vector(const std::vector<X> &t){
  for(auto itr=t.begin(); itr != t.end(); itr++){
    std::cout << *itr;
    if(itr != t.end()-1) std::cout << ' ';
  }
  std::cout << std::endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:59:8: error: 'i' was not declared in this scope
   59 |   rep2(i,s.size()){
      |        ^
a.cc:59:3: error: 'rep2' was not declared in this scope; did you mean 'rep'?
   59 |   rep2(i,s.size()){
      |   ^~~~
      |   rep
Language: C++

//CODE FESTIVAL 2016 qual A C
#include <bits/stdc++.h>
using namespace std;

int main(){
	char s[100005];
	for(int i=0; i<100005; i++){
		s[i] = 0;
	}
	scanf("%s", s);
	long long k;
	scanf("%lld", &k);
	for(int i=0; i<100005; i++){
		if(s[i] != 0){
			if(123-s[i] <= k){
				k -= (123-s[i]);
				s[i] = 'a';
			}
		}
	}
	for(int i=0; i<100005; i++){
			s[i] += k;
			k = 0;
			//printf( "%d\n", int((k+s[i])%123+97)); 
			break;
		}
	}
	string str = s;
	printf( "%s\n", str.c_str() ); 
	//printf( "%d\n", s[0]); 
}

Compiler output:
a.cc:28:22: error: 's' was not declared in this scope
   28 |         string str = s;
      |                      ^
a.cc:29:15: error: expected constructor, destructor, or type conversion before '(' token
   29 |         printf( "%s\n", str.c_str() );
      |               ^
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C

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

int main(void){
    int i, j;
    int k;
    char s[100000];
    int len;

    scanf("%100000s",s);
    scanf("%d", &k);
	len = strlen(s);
    
    for(i=0; i<len; i++){
        if(k>= 124 - s[i])    
            s[i] = 'a';
            k -= 124 - s[i];
        }

    }
    printf("%s", s);
    putchar('\n');
	return 0;
}

Compiler output:
main.c:21:12: error: expected declaration specifiers or '...' before string constant
   21 |     printf("%s", s);
      |            ^~~~
main.c:21:18: error: unknown type name 's'
   21 |     printf("%s", s);
      |                  ^
main.c:22:13: error: expected declaration specifiers or '...' before '\xa'
   22 |     putchar('\n');
      |             ^~~~
main.c:23:9: error: expected identifier or '(' before 'return'
   23 |         return 0;
      |         ^~~~~~
main.c:24:1: error: expected identifier or '(' before '}' token
   24 | }
      | ^
Language: C

#include<iostream>
#include<string>
#include<math.h>
using namespace std;

int main(){
	string s;
	int a[100000];
	long long int k;
	cin >> s;
	cin >> k;
	for (int i = 0; i < s.length(); i++){
		if (s[i] == 'a'){
			a[i] = 1;
		}
		else if (s[i] == 'b'){
			a[i] = 2;
		}
		else if (s[i] == 'c'){
			a[i] = 3;
		}
		else if (s[i] == 'd'){
			a[i] = 4;
		}
		else if (s[i] == 'e'){
			a[i] = 5;
		}
		else if (s[i] == 'f'){
			a[i] = 6;
		}
		else if (s[i] == 'g'){
			a[i] = 7;
		}
		else if (s[i] == 'h'){
			a[i] = 8;
		}
		else if (s[i] == 'i'){
			a[i] = 9;
		}
		else if (s[i] == 'j'){
			a[i] = 10;
		}
		else if (s[i] == 'k'){
			a[i] = 11;
		}
		else if (s[i] == 'l'){
			a[i] = 12;
		}
		else if (s[i] == 'm'){
			a[i] = 13;
		}
		else if (s[i] == 'n'){
			a[i] = 14;
		}
		else if (s[i] == 'o'){
			a[i] = 15;
		}
		else if (s[i] == 'p'){
			a[i] = 16;
		}
		else if (s[i] == 'q'){
			a[i] = 17;
		}
		else if (s[i] == 'r'){
			a[i] = 18;
		}
		else if (s[i] == 's'){
			a[i] = 19;
		}
		else if (s[i] == 't'){
			a[i] = 20;
		}
		else if (s[i] == 'u'){
			a[i] = 21;
		}
		else if (s[i] == 'v'){
			a[i] = 22;
		}
		else if (s[i] == 'w'){
			a[i] = 23;
		}
		else if (s[i] == 'x'){
			a[i] = 24;
		}
		else if (s[i] == 'y'){
			a[i] = 25;
		}
		else if (s[i] == 'z'){
			a[i] = 26;
		}

	}
	int c = 0;
	int n = s.length();
	while (c < n){
		if (27 - a[c] <= k){
			
			
			k -= (27 - a[c]);
			a[c] = 1;
		}
		 if (k>0 && c == (n - 1)){
			 a[c] += k;
			 if (a[c]>26){
				a[c] %= 26;
				if (a[c] == 0){
					a[c] = 26;
				}
			}
		 } else if(k == 0){
			 break;
		 }
		
		c++;
	}
	//cout << a[0] << endl;
	for (int i = 0; i < s.length(); i++){
		if (a[i] == 1){
			s[i] = 'a';
		}
		else if (a[i] == 2){
			s[i] = 'b';
		}
		else if (a[i] == 3){
			s[i] = 'c';
		}
		else if (a[i] == 4){
			s[i] = 'd';
		}
		else if (a[i] == 5){
			s[i] = 'e';
		}
		else if (a[i] == 6){
			s[i] = 'f';
		}
		else if (a[i] == 7){
			s[i] = 'g';
		}
		else if (a[i] == 8){
			s[i] = 'h';
		}
		else if (a[i] == 9){
			s[i] = 'i';
		}
		else if (a[i] == 10){
			s[i] = 'j';
		}
		else if (a[i] == 11){
			s[i] = 'k';
		}
		else if (a[i] == 12){
			s[i] = 'l';
		}
		else if (a[i] == 13){
			s[i] = 'm';
		}
		else if (a[i] == 14){
			s[i] = 'n';
		}
		else if (a[i] == 15){
			s[i] = 'o';
		}
		else if (a[i] == 16){
			s[i] = 'p';
		}
		else if (a[i] == 17){
			s[i] = 'q';
		}
		else if (a[i] == 18){
			s[i] = 'r';
		}
		else if (a[i] == 19){
			s[i] = 's';
		}
		else if (a[i] == 20){
			s[i] = 't';
		}
		else if (a[i] == 21){
			s[i] = 'u';
		}
		else if (a[i] == 22){
			s[i] = 'v';
		}
		else if (a[i] == 23){
			s[i] = 'w';
		}
		else if (a[i] == 24){
			s[i] = 'x';
		}
		else if (a[i] == 25){
			s[i] = 'y';
		}
		else if (a[i] == 26){
			s[i] = 'z';
		}
	}

		cout << s << endl;
		return 0;
}

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

//C++14 (Clang 3.8.0)

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <cstdlib>
#define rp(i,a,b) for(int (i)=(int)(a);i<(int)(b);++i)

typedef long long ll;

using namespace std;

int main(){
    ll K;
    int c[100001];
    string s;
    cin>>s;
    cin>>K;
    int p=0;
    rp(i,0,s.size()){
        int tmp=int('z')-int(s[i])+1;
        if(tmp<=K) {c[i]=int('a');K-=ll(tmp);}
        else {c[i]=int(s[i]);p=i;}
    }
    K=K%26;
    c[i]+=K;
    //if(c[s.size()-1]>122) c[s.size()-1]=c[s.size()-1]-122+97;
    rp(i,0,s.size()) cout<<char(c[i]);
    cout<<endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:43:7: error: 'i' was not declared in this scope
   43 |     c[i]+=K;
      |       ^
Language: C++

#include<stdio.h>
	long long int i,a,c;
	char b[1000100];
int main(){
	gets(b);
	scanf("%lld",&a);
	for(i=0;b[i]!=NULL;i++){
		if(b[i]!='\0'){
			if(a>'z'-b[i]){
				a=a-('z'-b[i])-1;
				b[i]='a';
			}
		}
	}
	if(a>0){
		a=(b[i-1]-'a'+a)%26;
		b[i-1]=a+'a';
	}
	for(i=0;b[i]!=NULL;i++){
		printf("%c",b[i]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |         gets(b);
      |         ^~~~
      |         getw
a.cc:7:23: warning: NULL used in arithmetic [-Wpointer-arith]
    7 |         for(i=0;b[i]!=NULL;i++){
      |                       ^~~~
a.cc:19:23: warning: NULL used in arithmetic [-Wpointer-arith]
   19 |         for(i=0;b[i]!=NULL;i++){
      |                       ^~~~
Language: C

#include <stdio.h>

void approach_a( char* c, int* remain ) {
	// a...z = 97...122

	int distance = 'z' + 1 - *c;

	if( *remain >= distance ) {
		*c      =  'a';
		*remain -= distance;
	}
}

void nextalphabet( char* c, int* remain ) {
	while( *remain > 0 ){
		if( *c == 'z' ) {*c = 'a';}
		else            {*c++;    }
		remain--
	}
}

main() {
	char s[100000]; scanf( "%s", &s );
	int  K;         scanf( "%d", &K );
	
	int i;
	int r = K;

	for( i=0; s[i]!='\0'; i++ ) approach_a( &s[i], &r );

	
	int j;
	for( j=i-1; j>=0 && r>0; j-- ) if( s[j]!='a' ) {s[j] += r; break;}
	if( r==0 ) {puts( s ); return 0;}

	nextalphabet( &s[i-1], &r );
	puts( s ); return 0;
}



Compiler output:
main.c: In function 'nextalphabet':
main.c:18:25: error: expected ';' before '}' token
   18 |                 remain--
      |                         ^
      |                         ;
   19 |         }
      |         ~                
main.c: At top level:
main.c:22:1: error: return type defaults to 'int' [-Wimplicit-int]
   22 | main() {
      | ^~~~
Language: C++

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

string minimamset(string s1,string s2){
    if(strcmp(s1.c_str(),s2.c_str())<0) return s1;
    else return s2;
}

string changestring(string s,int K,int nota){
    //cout << "s: " << s << " K: " << K << " nota: " << nota << endl;
    if(nota==s.length()-1){
        s[nota]+=K;
        if(s[nota]>122){
            int a=s[nota]-122;
            s[nota]=96+a;
        }
        return s;
    }else if(s[nota]+K>122){
        if(s[nota]=='a'){
            return minimamset(changestring(s,K,nota+1),changestring(s,K-123+s[nota],nota+1));
        }else{
            K-=123-s[nota];
            s[nota]='a';
            return changestring(s,K,nota+1);
        }
    }else{
        return changestring(s,K,nota+1);
    }
}

int main() {
    string s;
    int K;
    cin >> s;
    cin >> K;
    s = changestring(s,K,0);
    cout << s << endl;
    return 0;
}


Compiler output:
a.cc: In function 'std::string minimamset(std::string, std::string)':
a.cc:7:8: error: 'strcmp' was not declared in this scope
    7 |     if(strcmp(s1.c_str(),s2.c_str())<0) return s1;
      |        ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #include <string>
a.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type]
    9 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define MOD 1000000007
#define pb push_back
#define mp make_pair
typedef int Int;
typedef pair<Int,Int> pii;
typedef vector<Int> vi;
typedef vector<pii> vii;

int main()
{
	string S;
	Int K,l,lt=l-1;
	cin>>S;
	cin>>K;
	l=S.length();
	for(Int i=0;i<l;i++)
	{
		if((26-(S[i]-'a'))<=K)
		{
				K-=26-(S[i]-'a');
				S[i]='a';
		}
		else
		{
			if(K>0)
			(lt=i;)
		}
	}
	if(K!=0)
	{
		Int temp=((S[lt]-'a'+K)%26);
		S[lt]=temp+'a';
	}


	cout<<S;



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:30: error: expected ')' before ';' token
   30 |                         (lt=i;)
      |                         ~    ^
      |                              )
a.cc:30:31: error: expected primary-expression before ')' token
   30 |                         (lt=i;)
      |                               ^
Language: Java


public class Main {
	// aにできるまで最初からステップ，あとは最後のものを最後まで回す
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder str = new StringBuilder(br.readLine());
		int num = Integer.valueOf(br.readLine());
		br.close();
		int index = 0;
		int length = str.length();

		while (index < length - 1) {
//			if(num>26*length){
//				str = str.replaceAll("[a-z]", "a");
//				break;
//			}
			if (num > counttoa(str.charAt(index))) {
				num = num - counttoa(str.charAt(index));
//				str = str.substring(0, index) + "a" + str.substring(index + 1);
				str.setCharAt(index, 'a');
			}
			index++;
		}

		// 最後の文字を変換
//		str = str.substring(0, length - 1) + stepChr(str.charAt(length - 1), num);
		str.setCharAt(length-1, stepChr(str.charAt(length-1),num));
		System.out.println(str);

	}

	private static char stepChr(char input, int num) {
		int realNum = num % 26;
		char result = input;
		for (int i = 0; i < realNum; i++) {
			result = nextChr(result);
		}
		return result;
	}

	private static char nextChr(char input) {
		if (input == 'z') {
			return 'a';
		} else
			return (char) ((int) input + 1);

	}

	private static int counttoa(char input) {
		if (input == 'a') {
			return 0;
		}
		return 26 - ((int) input - (int) 'a');
	}

}


Compiler output:
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: C++

#include <iostream>
#include <string>

using namespace std;

int ps(string &s, int &k, int i) {
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') continue;
    if (('z' + 1) - s[i] <= k) {
      int diff = 'z' + 1 - s[i];
      s[i] = 'a';
      k -= diff;
      return i + 1;
    }
  }
  s[s.size() - 1] += k;
  k = 0;
  return -1;
}

int main() {
  string s;
  long long K;
  cin >> s;
  cin >> K;
  long long i = 0;
  while (K) {
    i = ps(s, K, i);
  }
  cout << s << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   28 |     i = ps(s, K, i);
      |               ^
a.cc:6:24: note:   initializing argument 2 of 'int ps(std::string&, int&, int)'
    6 | int ps(string &s, int &k, int i) {
      |                   ~~~~~^
Language: Java


import java.io.*;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {


    public static void main(String[] args) {
	
	Scanner sc=new Scanner(System.in);
	
	String str=sc.next();
	
	char ar[]=str.toCharArray();
	int L=ar.length;
	
	int left=sc.nextInt();
	for (int i = 0; i < L-1; i++) {
	    int aaa=va((int) ar[i]);
	    
	    if(aaa!=26&&aaa<left){
		isa=true;
		ar[i]='a';
		left-=aaa;
	    }
	}
	while(left>0){
	    if(left>=26){
		left%=26;
	    }else{
		ar[L-1]+=left;
		left=0;
		if(ar[L-1]>122)
		    ar[L-1]+=97-123;
		    
	    }
	
	}
	
	System.out.println(String.valueOf(ar));
	
    }

static int va(int aa){
    return -aa+97+26;
        
}
 
    
    
}


Compiler output:
Main.java:23: error: cannot find symbol
		isa=true;
		^
  symbol:   variable isa
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

int main() {
	string str;
	int k;
	
	cin >> str >> k;
	
	REP(i, str.size()) {
		if (str[i] == 'a') continue;
		
		int cnt = 'z' - str[i] + 1;
		
		if (cnt <= k) {
			str[i] = 'a';
			k -= cnt;
		}
	}
	str[str.size() - 1] = (char)((str[str.size() - 1] - 'a') + (k % 26)) % 26 + 'a');
	
	cout << str << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:88: error: expected ';' before ')' token
   24 |         str[str.size() - 1] = (char)((str[str.size() - 1] - 'a') + (k % 26)) % 26 + 'a');
      |                                                                                        ^
      |                                                                                        ;
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)

int main(void){
	string s;
	ll k; cin >> s >> k;
	ll p = 0;
	ll nokori = k;
	while(nokori > 0){
		// cout << s << endl;
		// printf("%d %d\n", nokori, p);
		while('z' - s[p] + 1 => nokori && p < s.size() - 1){
			p++;
		}

		// printf("%d\n", p);
		if(p == s.size() - 1){
			nokori %= 26;
			ll d = s[p] - 'a' + nokori;
			// printf("d %d\n", d);
			d %= 26;
			s[p] = 'a' + d;
			// s[p] = 'a' + nokori;
			break;
		}
		
		if('z' - s[p] + 1 <= nokori){
			// printf("n %d\n", nokori);
			nokori -= 'z' - s[p] + 1;
			// printf("n %d\n", nokori);
			s[p] = 'a';
			p++;
		}
	}
	cout << s << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:39: error: expected primary-expression before '>' token
   35 |                 while('z' - s[p] + 1 => nokori && p < s.size() - 1){
      |                                       ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#define int long long
using namespace std;

signed main() 
{
	string a; int b;
	getline(cin, a);
	cin >> b;
	for (long long c = 0; c < a.length(); c++) {
		int d;
		if (a[c] == 'a')continue;
		int d = 26 - (a[c] - 'a');
		if (d > b)continue;
		a[c] = 'a';
		b -= d;
	}
	a[a.length() - 1] +=b;
	cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: redeclaration of 'long long int d'
   15 |                 int d = 26 - (a[c] - 'a');
      |                     ^
a.cc:13:21: note: 'long long int d' previously declared here
   13 |                 int d;
      |                     ^
Language: C++

#include <iostream>
using namespace std;
const int maxx = 100001;

int main() 
{
	string s;
	cin>>s;
	long k;
	cin>>k;
	int ptr = 0;
	while(k>0 && ptr<s.length())
	{
		if( s[ptr] == 'a')
		{
			++ptr;
			continue;
		}
		int need = 123 - s[ptr];
		if( need =< k)
		{
			k-=need;
			s[ptr++]='a';
			continue;
		}
		++ptr;
	}
	if( k>0 )
	{
		k %= 26;
		int v = (s[s.length()-1]-97+k) %26;
		s[s.length()-1] = (char)(v+97);
	}
	cout<<s<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: expected primary-expression before '<' token
   20 |                 if( need =< k)
      |                           ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <cstdio>
using namespace std;

int min(int a,int b){return a<b?a:b;}

int main(void){
    char c;
    char str[100008];
    int arr[100008];
    int N = 0;
    int K;
    
    scanf("%s",str);
    N = strlen(str);
    for(int i = 0 ; i < N ; i++ ){
        c = str[i];
        arr[i] = ((int)(c)) - ((int)('a'));
    }
    
    scanf("%d",&K);
    
    for(int i = 0 ; i < N ; i++ ){
        int move = arr[i] != 0 ? 26-arr[i] : 0;
        if( move <= K ){
            arr[i] = 0;
            //printf("1 %d ,%d,%d\n",i,K,move);
            K -= move;
        }
    }
    
    if( K > 0 ){
        arr[N-1] = (arr[N-1]+K)%26;
    }
    
    for(int i = 0 ; i < N ; i++ )
        printf("%c",((char)(arr[i]+((int)'a'))));
    printf("\n");
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'strlen' was not declared in this scope
   19 |     N = strlen(str);
      |         ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <cstdio>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

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

int n;
char s[1000011];
int k;
int main()
{
    int i,j;
    
    scanf("%s",s);
    n=strlen(s);
    cin>>k;
    
    for(i=0;i<n;i++)
    {
        if((int)'z'-s[i]+1<=k)
        {
            k-=(int)'z'-s[i]+1;
            s[i]='a';
        }
    }
    
    //cout<<s<<"   "<<k<<endl;
    
    k%=26;
    for(i=n-1;i>=0;i--)
    {
        if((int)'z'-s[i]<k)
        {
            assert(0);
            s[i]='z';
            k-=(int)'z'-s[i];
        }
        else
        {
            s[i]+=k;
            break;
        }
    }
    
    
    printf("%s\n",s);
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'assert' was not declared in this scope
   35 |             assert(0);
      |             ^~~~~~
a.cc:6:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    5 | #include<algorithm>
  +++ |+#include <cassert>
    6 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cstdlib>
using namespace std;

int min(int a,int b){return a<b?a:b;}

int main(void){
    char c;
    char str[100008];
    int arr[100008];
    int N = 0;
    int K;
    
    scanf("%s",str);
    N = strlen(str);
    for(int i = 0 ; i < N ; i++ ){
        c = str[i];
        arr[i] = ((int)(c)) - ((int)('a'));
    }
    
    scanf("%d",&K);
    
    for(int i = 0 ; i < N ; i++ ){
        int move = min(arr[i],26-arr[i]);
        if( move <= K ){
            arr[i] = 0;
            //printf("1 %d ,%d,%d\n",i,K,move);
            K -= move;
        }else{
            int to = min(arr[i],(arr[i]+K)%26);
            move = (26 + to - arr[i]) % 26;
            arr[i] = to;
            K -= move;
            //printf("2 %d ,%d,%d\n",i,K,move);
        }
    }
    
    if( K > 0 ){
        arr[N-1] = (arr[N-1]+K)%26;
    }
    
    for(int i = 0 ; i < N ; i++ )
        printf("%c",((char)(arr[i]+((int)'a'))));
    printf("\n");
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'strlen' was not declared in this scope
   18 |     N = strlen(str);
      |         ^~~~~~
a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <cstdlib>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;
#define USINT_MAX 4294967295

int main(){
	int k;
	char a[1000000];
	cin >> a;
	cin >> k;
	for (int i=0;k>0;i++) {
		if ('z' + 1 - a[i] <= k) { k -= ('z' + 1 - a[i]); a[i] = 'a'; }
		if (a[i] == 0) {
			for (int j = 1;; j++) {
				if (a[i - j] + k <= 'z') {
					a[i - j] += k; break;
				}
				else { k -= ('z' - a[i - j]); a[i] = 'z'; }
			}
		}
	cout << a << endl;
	return 0;
}

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

#include "bits/stdc++.h"
#define _CRT_SECURE_NO_WARNINGS
#define rep(i,n) for(int i = 0;i < n;i++)
#define REP(i,n,k) for(int i = n;i < k;i++)
#define P(p) cout << (p) << endl;
#define sP(p) cout << setprecision(15) << fixed << p << endl;
#define Pi pair<int,int>
#define IINF 1e9
#define LINF 1e18
#define vi vector<int>
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 0, 1,0,-1 };
int dy[] = { 1, 0,-1,0 };
int dx8[] = { -1,-1,-1,0,0,1,1,1 };
int dy8[] = { -1,0,1,-1,1,-1,0,1 };

unsigned long long sttoi(std::string str) {
	unsigned long long ret;
	std::stringstream ss; ss << str;
	ss >> ret;
	return ret;
}

ull gcd(ull a, ull b) {
	if (b > a)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a%b);
}

int comb(int n, int k) {
	int ans = 1;
	for (int i = 0; i < min(k, n - k); i++) {
		ans *= n - i;
		ans /= i + 1;
	}
	return ans;
}

ll mod_pow(ll n, ll p, ll mod) {
	if (p == 0) return 1 % mod;
	if (p < 2) {
		return n % mod;
	}
	else {
		ll d = 2, value = (n%mod)*(n%mod) % mod;
		while (d * 2 < p) { d *= 2;	value *= value;	value %= mod; }
		value %= mod;
		return ((value%mod) * (mod_pow(n, p - d, mod) % mod)) % mod;
	}
}

bool isPrime(int n) {
	if (n <= 1)return false;
	if (n == 2)return true;
	if (n % 2 == 0)return false;
	for (int i = 3; i*i <= n; i += 2) {
		if (n%i == 0)return false;
	}
	return true;
}

void solve() {
	string s;
	cin >> s;A
	ll k;
	cin >> k;
	ll sum = 0;
	rep(i, s.length()) {
		sum += ('z' - s[i] + 1)%26;
	}
	if (k < sum) {
		rep(i, s.length()) {
			if (('z' - s[i] + 1) % 26 <= k) {
				k -= ('z' - s[i] + 1) % 26;
				s[i] = 'a';
			}
		}		
		vector<string> vs;
		rep(i, s.length()) {
			string tmp = s;
			tmp[i] = 'a' + ((tmp[i] - 'a' + k) % 26);
			vs.push_back(tmp);
		}
		sort(vs.begin(), vs.end());
		P(vs[0])
	}
	else if (k == sum) {
		string ans = "";
		rep(i, s.length()) {
			ans = ans + "a";
		}
		P(ans);
	}
	else {
		string ans = "";
		rep(i, s.length() - 1) {
			ans = ans + "a";
		}
		P(ans + (char)('a' + ((s[s.length() - 1] - 'a' + k - sum) % 26)));
	}
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:69:18: error: 'A' was not declared in this scope
   69 |         cin >> s;A
      |                  ^
a.cc:71:16: error: 'k' was not declared in this scope
   71 |         cin >> k;
      |                ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#define int long long
using namespace std;

int main() 
{
	string a; int b;
	cin >> a >> b;
	for (int c = 0;c<a.length(); c++) {
		int d = 26 - (a[c] - 'a');
		if (d > b)continue;
		a[c] = 'a';
		b -= d;
	}
	a[a.length() - 1] += b;
	cout << a << endl;
}

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

char addK(char c, int k){
    int i;
    char newC;
    for(i=0;i<k;i++){
            if(c=='z'){
                    newC = 'a';
            }
            newC = char(int(c)+1);
    }
}

int main(){

    int i=0;
	char s[100000];
	char newS[100000];
	int k=0;
	scanf("%s",s);
	scanf("%d",&k);
	int array[num];
	c = s[i];
	while(c!='\0')
		newS[i]=addK(s[i],k);
		i++;
		c = s[i];
	}
	return 0;
}

Compiler output:
main.c: In function 'addK':
main.c:8:20: error: expected expression before 'char'
    8 |             newC = char(int(c)+1);
      |                    ^~~~
main.c: In function 'main':
main.c:18:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   18 |         scanf("%s",s);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | char addK(char c, int k){
main.c:18:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   18 |         scanf("%s",s);
      |         ^~~~~
main.c:18:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:19: error: 'num' undeclared (first use in this function)
   20 |         int array[num];
      |                   ^~~
main.c:20:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:9: error: 'c' undeclared (first use in this function)
   21 |         c = s[i];
      |         ^
main.c: At top level:
main.c:27:9: error: expected identifier or '(' before 'return'
   27 |         return 0;
      |         ^~~~~~
main.c:28:1: error: expected identifier or '(' before '}' token
   28 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int INF = 1e9;
string s;
int n;

void solve(){
    int target = 0;
    while(n>0){
        while(s[target]=='a'){
            if(target==s.size()-1)break;
            target++;
        }
        if(('z'+1)-s[target]<=n) {
            n -= ('z'+1)-s[target];
            s[target] = 'a';
        }
        target = min((target+1),(s.size()-1));
        if(target==s.size()-1){
            n = n%26;
            if(s[target]+n<='z')s[target]+=n;
            else s[target] = 'a'+ s[target] + n - 'z' - 1;
        }
    }
    cout << s << endl;
}

int main() {
    cin >> s;
    cin >> n;
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:21: error: no matching function for call to 'min(int, std::__cxx11::basic_string<char>::size_type)'
   20 |         target = min((target+1),(s.size()-1));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:20:21: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   20 |         target = min((target+1),(s.size()-1));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/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:20:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |         target = min((target+1),(s.size()-1));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <fstream>
#include <queue>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <time.h>
#include <list>

#define For(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  For(i,0,n)

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
#define chk(a) rep(i, a.size()) cout << a[i] << " "
#define SORT(c) sort((c).begin(),(c).end())
#define ll long long
#define vi(m,a) vector<int> m(a)
#define vti(m,a,i) vector<vector<int>> m(a,vector<int>(i))
#define ALL(it,a) for(auto it = a.begin(); it!=a.end(); it++)
#define Fe(it,a) for(auto &it : a)
#define all(a) begin(a),end(a)


using namespace std;
typedef pair<int, int> pii;
#define WARU 1000000007;

int main(void) {

	string str;
	cin >> str;
	long long k;
	cin >> k;

	long long n = str.length();
	ll nokori = k;
	rep(i, n) {
		if (str[i] == 'a') {
			continue;i
		}
		int tmp = 'z' - str[i];
		if (nokori > tmp) {
			str[i] = 'a';
			nokori -= (tmp + 1);
		}
	}
	if (nokori > 0) {
		str[n - 1] = 'a' + (str[n - 1] - 'a' + (nokori % 26)) % 26;
	}
	cout << str << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:35: error: expected ';' before '}' token
   47 |                         continue;i
      |                                   ^
      |                                   ;
   48 |                 }
      |                 ~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int INF = 1e9;
string s;
int n;

void solve(){
    int target = 0;
    while(n>0){
        while(s[target]=='a'){
            if(target==s.size()-1)break;
            target++;
        }
        if(('z'+1)-s[target]<=n) {
            n -= ('z'+1)-s[target];
            s[target] = 'a';
        }
        target = min((target+1),(s.size()-1));
        if(target==s.size()-1){
            n = n%26;
            if(s[target]+n<='z')s[target]+=n;
            else s[target] = 'a'+ s[target] + n - 'z' - 1;
        }
    }
}

int main() {
    cin >> s;
    cin >> n;
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:21: error: no matching function for call to 'min(int, std::__cxx11::basic_string<char>::size_type)'
   20 |         target = min((target+1),(s.size()-1));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:20:21: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   20 |         target = min((target+1),(s.size()-1));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/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:20:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |         target = min((target+1),(s.size()-1));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#define len(val) static_cast<long long>(val.size())
#define rep(i, n) for(int i=0; i<(n); i++)
typedef long long ll;
typedef pair<int, int> P;


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

    string s;
    cin >> s;
    int K;
    cin >> K;
    for(int i=0; i<len(s); i++){
      int n = s[i]-'a';
      if(K == 0) continue;
      if(n!=0 && 26-n <= K){
        K -= (26-n);
        s[i] = 'a';
        continue;
      }
      if(i == len(s)-1){
        s[i] = (n+K)%26+'a';
      }
    }
    cout << s << endl;
}


Compiler output:
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<int, int> P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin.tie(0);
      |     ^~~
a.cc:10:5: error: 'ios' has not been declared
   10 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:12:5: error: 'string' was not declared in this scope
   12 |     string s;
      |     ^~~~~~
a.cc:13:12: error: 's' was not declared in this scope
   13 |     cin >> s;
      |            ^
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout << s << endl;
      |     ^~~~
a.cc:28:18: error: 'endl' was not declared in this scope
   28 |     cout << s << endl;
      |                  ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

char s[100010];
int K;

char n(char c) {
  int i = (int)c-(int)'a';
  return (char)((i+1)%26 + (int)'a');
}

void rotate(int i) {
  s[i] = n(s[i]);
}

int main() {
  cin >> s;
  cin >> K;
  int l = strlen(s);
  int x = K;
  int i = 0;
  while (x > 0 && i < l) {
    int d = ((int)'a' - (int)s[i] + 26) % 26;
    if (d > x) {
      i++;
      continue;
    }
    s[i] = 'a';
    x -= d;
    i++;
  }
  for (int j=0; j<x; j++) rotate(l-1);
  cout << s << "\n";
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: 'strlen' was not declared in this scope
   24 |   int l = strlen(s);
      |           ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <cmath>
  +++ |+#include <cstring>
    7 | using namespace std;