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

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

int main()
{
while{
 char stra[10], strb[10];
 int hit,bro;
 cin>>stra>>strb;

 for(int i=0;i<4;i++){
  if(stra[i]==strb[i]){
	hit++;}
  for(int j=0;j<4;j++){
	if(stra[i]==strb[j])
	 bro++;}
 }
if(stra==0&&strb==0){break;}
bro=bro-hit;
cout<<hit<<' '<<bro<<'\n';

}
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected '(' before '{' token
    7 | while{
      |      ^
      |      (
a.cc:7:6: error: expected primary-expression before '{' token
a.cc:7:6: error: expected ')' before '{' token
    7 | while{
      |      ^
      |      )
Language: C++

#include<string>
using namespace std;

int main(){
 while(1){
	string stra,strb;
	cin>>stra>>strb;
	int h=0,b=0;

	if((stra=="0")&&(strb=="0")){
	 break;}

	for(int i=0;i<4;i++){
	 if(stra[i]==strb[i]){
		h++;
	 }
	 for(int j=0;j<4;j++){
		if(stra[i]==strb[j]){
			b++;
		}
	 }
	}

  b=b-h;
  cout<<h<<' '<<b<<'\n';
 }
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>stra>>strb;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout<<h<<' '<<b<<'\n';
      |   ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

char buf[10];
int main() {
	int a[4], b[4];
	while (gets(buf), strcmp(buf, "0 0")) {
		char*s = buf;
		rep(i, 4) { sscanf(s, "%1d", &a[i]); s += 1; }s += 1;
		rep(i, 4) { sscanf(s, "%1d", &b[i]); s += 1; }
		int hit = 0, blow = 0;
		rep(i, 4)if (a[i] == b[i])hit++;
		rep(i, 4) if (find(a, a + 4, b[i]) != a + 4)blow++;
		cout << hit << ' ' << blow - hit << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |         while (gets(buf), strcmp(buf, "0 0")) {
      |                ^~~~
      |                getw
Language: C++

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

char buf[10];
int main() {
	int a[4], b[4];
	while (gets_s(buf), strcmp(buf, "0 0")) {
		char*s = buf;
		rep(i, 4) { sscanf(s, "%1d", &a[i]); s += 1; }s += 1;
		rep(i, 4) { sscanf(s, "%1d", &b[i]); s += 1; }
		int hit = 0, blow = 0;
		rep(i, 4)if (a[i] == b[i])hit++;
		rep(i, 4) if (find(a, a + 4, b[i]) != a + 4)blow++;
		cout << hit << ' ' << blow - hit << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'gets_s' was not declared in this scope; did you mean 'getsid'?
    8 |         while (gets_s(buf), strcmp(buf, "0 0")) {
      |                ^~~~~~
      |                getsid
Language: C++

<?php
	for( $loop_cnt = 0;12000 > $loop_cnt; $loop_cnt++ )
	{
		$input = explode(" ", trim(fgets(STDIN)));
		if( 0 == $input[0] &&
			0 == $input[1]
		)
		{
			break;
		}
		
		$r = str_split($input[0]);
		$a = str_split($input[1]);
		
		$hit = 0;
		$brow = 0;
		$loop_r = 0;
		foreach( $r as $r_char )
		{
			$loop_a = 0;
			foreach($a as $a_char)
			{
				if($r_char == $a_char)
				{
					if($loop_r == $loop_a)
					{
						$hit++;
					}
					else
					{
						$brow++;
					}
					break;
				}
				$loop_a++;
			}
			$loop_r++;
		}
		echo $hit . " " . $brow . "\n";
	}
?>



Compiler output:
a.cc:1:1: error: expected unqualified-id before '<' token
    1 | <?php
      | ^
a.cc:2:28: error: expected unqualified-id before numeric constant
    2 |         for( $loop_cnt = 0;12000 > $loop_cnt; $loop_cnt++ )
      |                            ^~~~~
a.cc:2:47: error: '$loop_cnt' does not name a type
    2 |         for( $loop_cnt = 0;12000 > $loop_cnt; $loop_cnt++ )
      |                                               ^~~~~~~~~
a.cc:41:1: error: expected unqualified-id before '?' token
   41 | ?>
      | ^
Language: C++

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

int main() {
	string r, a;
	while(cin >> r >> a , r || a){
		int hit = 0, blow = 0;
		for(int i=0; i < 4; i++){
            for(int j=0; j<4; j++){
                if(r[i] == a[j]){
                    if(i == j){
                        hit++;
                    }else{
                        blow++;
                	}
                }
            }
        }
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: no match for 'operator||' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    7 |         while(cin >> r >> a , r || a){
      |                               ~ ^~ ~
      |                               |    |
      |                               |    basic_string<[...]>
      |                               basic_string<[...]>
a.cc:7:33: note: candidate: 'operator||(bool, bool)' (built-in)
    7 |         while(cin >> r >> a , r || a){
      |                               ~~^~~~
a.cc:7:33: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
Language: C++

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

int main() {
	string r, a;
	while(cin >> r >> a, ans=="0" && forecast=="0"){
		int hit = 0, blow = 0;
		for(int i=0; i < 4; i++){
            for(int j=0; j<4; j++){
                if(r[i] == a[j]){
                    if(i == j){
                        hit++;
                    }else{
                        blow++;
                	}
                }
            }
        }
        cout << hit << " " << blow << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |         while(cin >> r >> a, ans=="0" && forecast=="0"){
      |                              ^~~
      |                              abs
a.cc:7:42: error: 'forecast' was not declared in this scope
    7 |         while(cin >> r >> a, ans=="0" && forecast=="0"){
      |                                          ^~~~~~~~
Language: C++

char a[17]="0 0";main(i,j){for(;a[2]=*a=48,scanf("%[^\n]\n",a+5),a[8];puts(a)){for(i=4;++i<9;)for(j=4;++j<9;)a[j+5]-a[i]||a[(i!=j)*2]++;}i=0;}

Compiler output:
a.cc:1:22: error: expected constructor, destructor, or type conversion before '(' token
    1 | char a[17]="0 0";main(i,j){for(;a[2]=*a=48,scanf("%[^\n]\n",a+5),a[8];puts(a)){for(i=4;++i<9;)for(j=4;++j<9;)a[j+5]-a[i]||a[(i!=j)*2]++;}i=0;}
      |                      ^
Language: C++

#include<iostream>
int main(){
	while(1){
		int a,b;
		std::cin>>a>>b;
		if(a==0&&b==0)break;
		std::vector<int> vec(4);
		std::vector<int> vec2(4);
		int n=1000;
		for(int i=0;i<4;i++){
			int x=a/n;
			int y=b/n;
			vec[i]=x;
			vec2[i]=y;
			x*=n;
			y*=n;
			a-=x;
			b-=y;
			n/=10;
		}
			int c=0,d=0;
		for(int i=0;i<4;i++){
			for(int j=0;j<4;j++){
				if(vec[i]==vec2[j]){
					if(i==j)c++;
					else d++;
				}
			}
		}

		std::cout<<c<<" "<<d<<std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: 'vector' is not a member of 'std'
    7 |                 std::vector<int> vec(4);
      |                      ^~~~~~
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 | int main(){
a.cc:7:29: error: expected primary-expression before 'int'
    7 |                 std::vector<int> vec(4);
      |                             ^~~
a.cc:8:22: error: 'vector' is not a member of 'std'
    8 |                 std::vector<int> vec2(4);
      |                      ^~~~~~
a.cc:8:22: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:8:29: error: expected primary-expression before 'int'
    8 |                 std::vector<int> vec2(4);
      |                             ^~~
a.cc:13:25: error: 'vec' was not declared in this scope
   13 |                         vec[i]=x;
      |                         ^~~
a.cc:14:25: error: 'vec2' was not declared in this scope
   14 |                         vec2[i]=y;
      |                         ^~~~
a.cc:24:36: error: 'vec' was not declared in this scope
   24 |                                 if(vec[i]==vec2[j]){
      |                                    ^~~
a.cc:24:44: error: 'vec2' was not declared in this scope
   24 |                                 if(vec[i]==vec2[j]){
      |                                            ^~~~
Language: C++

#include<stdio.h>
void main(){
	int i,j,hit,blow;
	int a,b,d;
	int aa[4],bb[4];

	while(1){
		d=1000;
		hit=0;
		blow=0;
		scanf("%d %d",&a,&b);
		if(a==0 && b==0) break;
		for(i=0;i<4;i++){
			aa[i]=a/d;
			a=a%d;
			bb[i]=b/d;
			b=b%d;
			d=d/10;
		}
		for(i=0;i<4;i++){
			if(aa[i]==bb[i]) hit++;
			for(j=0;j<4;j++){
				if(aa[i]==bb[j]) blow++;
			}
		}
		printf("%d %d\n",hit,blow-hit);
	}
}

Compiler output:
a.cc:2:1: error: '::main' must return 'int'
    2 | void main(){
      | ^~~~
Language: Java

import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;


public class Thanksgiving {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(s.hasNextLine()) {
			int purchaceCnt = s.nextInt();
			int canPackCnt = s.nextInt();
			s.nextLine();
			String[] values = s.nextLine().split(" ");
			Integer[] value = new Integer[values.length];
			for(int i=0 ; i<values.length ; i++){
				value[i] = new Integer(values[i]);
			}
//			System.out.println(" ");
			System.out.println(solve(purchaceCnt, canPackCnt, value));
		}
	}

	public static int solve(int purchaceCnt, int canPackCnt, Integer[] values) {
		Arrays.sort(values, Collections.reverseOrder());
		int cnt=0;
		int value = 0;
		for(int i=0 ; i<purchaceCnt ; i++) {
			cnt++;
			if(cnt==canPackCnt) {
				//無料
				cnt = 0;
			}else {
				value += values[i].intValue();
			}
		}
		return value;
	}
}

Compiler output:
Main.java:6: error: class Thanksgiving is public, should be declared in a file named Thanksgiving.java
public class Thanksgiving {
       ^
Main.java:17: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
				value[i] = new Integer(values[i]);
				           ^
1 error
1 warning
Language: Java

import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;


public class Thanksgiving {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(s.hasNextLine()) {
			int purchaceCnt = s.nextInt();
			int canPackCnt = s.nextInt();
			s.nextLine();
			String[] values = s.nextLine().split(" ");
			Integer[] value = new Integer[values.length];
			for(int i=0 ; i<values.length ; i++){
				value[i] = new Integer(values[i]);
			}
			System.out.println(solve(purchaceCnt, canPackCnt, value));
		}
	}

	public static int solve(int purchaceCnt, int canPackCnt, Integer[] values) {
		Arrays.sort(values, Collections.reverseOrder());
		int cnt=0;
		int value = 0;
		for(int i=0 ; i<purchaceCnt ; i++) {
			cnt++;
			if(cnt==canPackCnt) {
				cnt = 0;
			}else {
				value += values[i].intValue();
			}
		}
		return value;
	}
}

Compiler output:
Main.java:6: error: class Thanksgiving is public, should be declared in a file named Thanksgiving.java
public class Thanksgiving {
       ^
Main.java:17: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
				value[i] = new Integer(values[i]);
				           ^
1 error
1 warning
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Mani {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			if (n == 0) {
				break;
			}
			int[] p = new int[n];
			for(int i=0;i<n;i++) {
				p[i] = sc.nextInt();
			}
			Arrays.sort(p);
			int ans = 0;
			for(int i=0;i<n%m;i++) {
				ans += p[i];
			}
			for(int i=0;i<n/m;i++) {
				for(int j=1;j<m;j++) {
					ans += p[n%m+m*i+j];
				}
			}
			System.out.println(ans);
		}
	}

}

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

#include <cstdio>
#include <algorithm>

using namespace std;

int main(void)
{
	int i, n, m, p;
	int sum, array[1000];
	
	while (1){		
		scanf("%d %d", &n, &m);
		
		if (!n && !m){
			break;
		}
		
		for (i = 0; i < n; i++){
			scanf("%d", &array[i]);
		}
		
		sort(array, array + n);
		reverse(array, array + n);
		
		for (i = 0, sum = 0; i < n; i++){
			if ((i + 1) % m != 0 || n - i + 1 < m){
				sum += array[i];
			}
		}
		
		printf("%d\n", sum);
	}
	
	return (0);
}

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

#include<stdio.h>

int main(void)
{
	int a, b, c[1000], d, e, f, g = 1, i, j;
	while (scanf_s("%d %d", &a, &b))
	{
		if (a == 0 && b == 0)break;
		j = 0, g = 1;
		for (i = 1;i <= a;i++)
		{
			scanf_s("%d", &d);
			c[i] = d;
		}
		f = a;

		while (g)
		{
			for (i = 1;i <= a;i++)
			{
				if (c[i] < c[i + 1])
				{
					e = c[i];
					c[i] = c[i + 1];
					c[i + 1] = e;
				}
			}

			a--;
			if (a == 0)
			{
				g = a;
			}
		}
		for (i = 1;i <= f;i++)
		{
					if(i % b != 0)
					{
						j += c[i];
					}
				}

				printf("%d\n", j);
			}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         while (scanf_s("%d %d", &a, &b))
      |                ^~~~~~~
      |                scanf
Language: C

#include<stdio.h>

int main(void)
{
	int a, b, c[1000], d, e, g, i, j;
	while (scanf_s("%d %d", &a, &b))
	{
		if (a == 0 && b == 0)break;
		j = 0, g = 1, e = 0;
		for (i = 1;i <= a;i++)
		{
			scanf_s("%d", &c[i]);
		}

		for (i = 1;i <= a;i++)
		{
			for (g = 1;g <= a-1;g++)
			{
				if (c[i] < c[j])
				{
					e = c[i];
					c[i] = c[g];
					c[g] = e;
				}
			}
		}
		for (i = 1;i <= a;i++)
		{
			if(i % b != 0)
			{
				j += c[i];
			}
		}

		printf("%d\n", j);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         while (scanf_s("%d %d", &a, &b))
      |                ^~~~~~~
      |                scanf
Language: C

#include <cstdio>
#include <algorithm>
#include <functional>

#define N 1000

using namespace std;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int i;

  for ( ; ; )
  {
    int d[ N ];
    int res = 0;
    int n, m;

    scanf ( "%d%d", &n, &m );
    if ( !( n | m ) ) break ;

    for ( i = 0; i < n; ++i )
    {
      scanf ( "%d", d + i );
    }
    sort ( d, d + n, greater< int > ( ) );

    for ( i = 0; i < n; ++i )
    {
      res += ( i + 1 ) % m
           ? d[ i ] : 0;
    }

    printf ( "%d\n", res );
  }

  return ( 0 );
}

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

#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[1000];
main()
{
	while(cin>>n>>m,n)
	{
		int ans=0;
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
			ans+=a[i];
		}
		sort(a,a+n);
		for(int i=n-m;i>=0i-=m)
		{
			ans-=a[i];
		}
		cout<<ans<<endl;
	}
}



Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:32: error: invalid operands of types 'int' and '__complex__ int' to binary 'operator>='
   16 |                 for(int i=n-m;i>=0i-=m)
a.cc:16:39: error: expected ';' before ')' token
   16 |                 for(int i=n-m;i>=0i-=m)
      |                                       ^
      |                                       ;
Language: C++

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

int main() {
	int n, m;
	
	while(1){
		cin >> n >> m;
		if(n == 0 && m == 0)
			break;
			
		array<int, 1000> p;
		p.fill(0);
		for(int i = 0; i < n; ++i)
			cin >> p[i];
		sort(p.begin(), p.end(), greater<int>());
		int ans = 0;
		for(int i = 0; i < n; i += m){
			for(int j = i; j < i + m - 1; ++j)
				ans += p[j];
		}
		
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:34: error: aggregate 'std::array<int, 1000> p' has incomplete type and cannot be defined
   13 |                 array<int, 1000> p;
      |                                  ^
a.cc:3:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
    2 | #include <algorithm>
  +++ |+#include <array>
    3 | using namespace std;
Language: C++

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

main(){
  int m,n;
  int b[1001];
  while(cin >> n >> m,m || n){
    int total=0;
    int k=n/m;
    for(int i=0;i<n;i++) cin >> b[i];
    sort(b,b+n);

    for(int i=1;i<=n;i++){
      if(i%m) total+=b[n-i];
    }
    cout << total << endl;
  }
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(b,b+n);
      |     ^~~~
      |     short
Language: C++

#include<iostream>
using namespace std;

main(){
  int m,n;
  int b[1001];
  while(cin >> n >> m,m || n){
    int total=0;
    int k=n/m;
    for(int i=0;i<n;i++) cin >> b[i];
    sort(b,b+n);

    for(int i=1;i<=n;i++){
      if(i%m) total+=b[n-i];
    }
    cout << total << endl;
  }
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(b,b+n);
      |     ^~~~
      |     short
Language: C++

#include<iostream>
#include<cmath>
#include<slgorithm>
using namespace std;

main(){
  int m,n;
  int b[1001];
  while(cin >> n >> m,m || n){
    int total=0;
    int k=n/m;
    for(int i=0;i<n;i++) cin >> b[i];
    sort(b,b+n);

    for(int i=1;i<=n;i++){
      if(i%m) total+=b[n-i];
    }
    cout << total << endl;
  }
}

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

#include<iostream>
#include<algorithm>
using namespace std;
main(){
int ans=0;
int be[10002];
int x=-1,n,m;
while(1){
x=-1;
ans=0;
cin>>n>>m;
if(n==m==0)break;
for(int i=0;i<n;i++){
cin>>be[i];
ans+=be[i];
}
sort(be,be+n,greater<int > );
while(n>=m){
x+=m;
ans-=be[x];
n-=m;
}
cout<<ans<<endl;
}
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:17:28: error: expected primary-expression before ')' token
   17 | sort(be,be+n,greater<int > );
      |                            ^
Language: C++

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

vector<int> l;
int n,m;

bool input(){
  cin>>n>>m;
  if(n==m&&n==0)return false;
  l.clear(),l.resize(n);
  for(int i=0;i<n;i++){
    cin>>l[i];
  }
  return true;
}

int solve(){
  sort(l.rbegin(),l.rend());
  int ans = 0;
  for(int i=0;i<n;i++){
    if( (i+1) %m == 0){
      continue;
    }
    ans += l[i];
  }
  return ans;
}

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

Compiler output:
a.cc: In function 'int solve()':
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |   sort(l.rbegin(),l.rend());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

int main(){
	int n, m; // n:konyu m:hukuro
	std::cin >> n >> m;
	while(n != 0 || m != 0){
		std::vector<int> price;
		price.resize(n);
		for(int i = 0; i < n; ++i){
			cin >> price[i]; // input
		}
		
		std::sort(price.begin(), price.end(), std::greater<int>());

		int sum = 0;
		for(int i = 0; i < n; ++i){
			if((i+1) % m != 0){ i += price[i];}
		}

		std::cout << sum << endl;
		std::cin >> n >> m; 
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |                         cin >> price[i]; // input
      |                         ^~~
      |                         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:22:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |                 std::cout << sum << 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>
#include <iterator>

int main(){

	int num, limit;

	while(std::cin >> num >> limit){
		std::vector<int> price;
		int sum_price = 0;
		//input
		for(int i = 0; i < num; ++i){
			int buf;
			sum_price += buf;
			std::sin >> buf;
			price.push_back(buf);
		}
		//sort
		std::sort(price.begin(),price.end(),std::greater<int>());
		//discount
		int discount = 0;
		int in_bag = 0;
		for(auto itr = price.begin; itr != price.end(); ++itr){
			++in_bag;
			if(in_bag == limit){
				discount += itr;
				in_bag = 0;
			}
		}

		std::cout << sum_price - dicount << std::endl;
	}
	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: 'sin' is not a member of 'std'; did you mean 'min'?
   16 |                         std::sin >> buf;
      |                              ^~~
      |                              min
a.cc:20:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   20 |                 std::sort(price.begin(),price.end(),std::greater<int>());
      |                      ^~~~
      |                      qsort
a.cc:24:38: error: unable to deduce 'auto' from 'price.std::vector<int>::begin'
   24 |                 for(auto itr = price.begin; itr != price.end(); ++itr){
      |                                ~~~~~~^~~~~
a.cc:24:38: note:   couldn't deduce template parameter 'auto'
   24 |                 for(auto itr = price.begin; itr != price.end(); ++itr){
      |                                      ^~~~~
a.cc:32:42: error: 'dicount' was not declared in this scope; did you mean 'discount'?
   32 |                 std::cout << sum_price - dicount << std::endl;
      |                                          ^~~~~~~
      |                                          discount
Language: C++

#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>

int main(){

	int num, limit;

	while(std::cin >> num >> limit){
		std::vector<int> price;
		int sum_price = 0;
		//input
		for(int i = 0; i < num; ++i){
			int buf;
			sum_price += buf;
			std::cin >> buf;
			price.push_back(buf);
		}
		//sort
		std::sort(price.begin(),price.end(),std::greater<int>());
		//discount
		int discount = 0;
		int in_bag = 0;
		for(auto itr = price.begin; itr != price.end(); ++itr){
			++in_bag;
			if(in_bag == limit){
				discount += itr;
				in_bag = 0;
			}
		}

		std::cout << sum_price - discount << std::endl;
	}
	return 0;
}
	
	

Compiler output:
a.cc: In function 'int main()':
a.cc:25:38: error: unable to deduce 'auto' from 'price.std::vector<int>::begin'
   25 |                 for(auto itr = price.begin; itr != price.end(); ++itr){
      |                                ~~~~~~^~~~~
a.cc:25:38: note:   couldn't deduce template parameter 'auto'
   25 |                 for(auto itr = price.begin; itr != price.end(); ++itr){
      |                                      ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>

int main(){

	int num, limit;

	while(std::cin >> num >> limit){
		std::vector<int> price;
		int sum_price = 0;
		//input
		for(int i = 0; i < num; ++i){
			int buf;
			sum_price += buf;
			std::cin >> buf;
			price.push_back(buf);
		}
		//sort
		std::sort(price.begin(),price.end(),std::greater<int>());
		//discount
		int discount = 0;
		int in_bag = 0;
		for(auto itr = price.begin(); itr != price.end(); ++itr){
			++in_bag;
			if(in_bag == limit){
				discount += itr;
				in_bag = 0;
			}
		}

		std::cout << sum_price - discount << std::endl;
	}
	return 0;
}
	
	

Compiler output:
a.cc: In function 'int main()':
a.cc:28:42: error: no match for 'operator+=' (operand types are 'int' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
   28 |                                 discount += itr;
      |                                 ~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>

int main(){

	int num, limit;

	while(std::cin >> num >> limit){
		std::vector<int> price;
		int sum_price = 0;
		//input
		for(int i = 0; i < num; ++i){
			int buf;
			sum_price += buf;
			std::cin >> buf;
			price.push_back(buf);
		}
		//sort
		std::sort(price.begin(),price.end(),std::greater<int>());
		//discount
		int discount = 0;
		int in_bag = 0;
		for(auto itr = price.begin(); itr != price.end(); ++itr){
			++in_bag;
			if(in_bag == limit){
                                int buf = itr;
				discount += buf;
				in_bag = 0;
			}
		}

		std::cout << sum_price - discount << std::endl;
	}
	return 0;
}
	
	

Compiler output:
a.cc: In function 'int main()':
a.cc:28:43: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   28 |                                 int buf = itr;
      |                                           ^~~
      |                                           |
      |                                           __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include <iostream>

#define MAX_NM 1000

int n, m, all;
int p[MAX_NM];

void solve();

int main(){
    while(true){
        all = 0;
        std::cin >> n >> m;
        for(int i = 0; i < n; ++i){
            std::cin >> p[i];
            all += p[i];
        }
        solve();
        std::cout << all << std::endl;
    }
    return 0;
}

void solve(){
    std::sort(p, p + n, std::greater<int>());
    for(int i = n - 1; i > 0; i -= m)
        all -= p[i];
    return;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:25:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   25 |     std::sort(p, p + n, std::greater<int>());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>

#define MAX_NM 1000

int n, m, all;
int p[MAX_NM];

void solve();

int main(){
    while(true){
        all = 0;
        std::cin >> n >> m;
        for(int i = 0; i < n; ++i){
            std::cin >> p[i];
            all += p[i];
        }
        solve();
        std::cout << all << std::endl;
    }
    return 0;
}

void solve(){
    std::sort(p, p + n, std::greater<int>());
    for(int i = 1; i <= n; ++i)
        all -= p[i * m - 1];
    return;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:25:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   25 |     std::sort(p, p + n, std::greater<int>());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
#include <vector>

int main(){
	int n,m;
	int p;
	
	while(true){
		std::cin >> n >> m;
		if(n == 0 && m == 0){
			break;
		}
		
		std::vector<int> price;
		for(int i=0; i<n ;++i){
			std::cin >> p;
			price.push_back(p);
		}
		//sort in descending order
		std::sort(price.begin(), price.end(), std::greater<int>());
		
		int i=1; //counter
		int sum=0;
		for(int x : price){
			if(i%m != 0){
				sum += x;
			}
			++i;
		}
		//output
		std::cout << sum << std::endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   20 |                 std::sort(price.begin(), price.end(), std::greater<int>());
      |                      ^~~~
      |                      qsort
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <boost/tokenizer.hpp>
#include <boost/lexical_cast.hpp>
#include <vector>
#include <list>

using namespace std;
using namespace boost;


int main(int argc, char* argv[])
{
	using sprtr = char_separator<char>;
	using tknzr = tokenizer<sprtr>;
	sprtr sep(" ", "", keep_empty_tokens);

	int f, mf, mo;

	string line;
	while(1) {

		int n, m;
		{
			getline(cin, line);
			tknzr tkns(line, sep);
			auto it = tkns.begin();
			n = lexical_cast<int>(*it++);
			m = lexical_cast<int>(*it);
		}

		if( n == 0 && m == 0 ) {
			break;
		}
		
		list<int> ps;		
		{
			getline(cin, line);
			tknzr tkns(line, sep);
			for( auto p : tkns ) {
				//cout << p << endl;
				ps.push_back(lexical_cast<int>(p));
			}
		}

		ps.sort(greater<int>());

		int div = n / m;
		int mod = n % m;

		int sum = 0;
		auto it = ps.begin();
		for( int i = 0; i < div; i++ ) {
			for( int j = 0; j < m; j++ ) {
				auto p = *it++;
				if( j == m-1 ) continue;
				sum += p;
			}
		}

		if( mod ) {
			for( int i = 0; i < mod; i++ ) {
				auto p = *it++;
				sum += p;			   
			}
		}

		cout << sum << endl;

		ps.clear();
		
	}

    return 0;
}

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

#include <bits/stdc++.h>
#define r(i,n) for(i=0;i<n;i++)
using namespace std;
int main(){
  int a,b,i;
  while(cin>>a>>b,a){
    int c[a],s=0,k=0.p=0;
    r(i,a){cin>>c[i];p+=c[i];}
    sort(c,c+a);
    for(i=a-1;i>=0;i--){
      k++;
      if(k==b){
        s+=c[i];
        k=0;
      }
    }
    cout<<p-s<<endl;;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: unable to find numeric literal operator 'operator""p'
    7 |     int c[a],s=0,k=0.p=0;
      |                    ^~~
a.cc:8:22: error: 'p' was not declared in this scope
    8 |     r(i,a){cin>>c[i];p+=c[i];}
      |                      ^
a.cc:17:11: error: 'p' was not declared in this scope
   17 |     cout<<p-s<<endl;;
      |           ^
Language: C++

#include "stdafx.h"
#include"iostream"
using namespace std;
int main() {
	while (1) {
		int n, m,p[10000],sum=0;
		cin >> n >> m;
		
		if (n == 0 && m == 0)break;

		for (int i = 1; i < n+1; i++) {
			cin >> p[i];
	}

		for (int j = 0; j < n - 1; j++) {
			for (int i = 1; i < n + 1; i++) {
				if (p[i] < p[i + 1]) {
					swap(p[i], p[i + 1]);

				}
			}
		}
				for (int i = 1; i < n + 1; i++) {
					if (i%m != 0) {
						sum += p[i];
					}

			}
		
		cout << sum << endl;
	}
		
	return 0;
}




Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include "stdafx.h"
#include"iostream"
using namespace std;
int main() {
	while (1) {
		int n, m,p[10000],sum=0;
		cin >> n >> m;
		
		if (n == 0 && m == 0)break;

		for (int i = 1; i < n+1; i++) {
			cin >> p[i];
	}

		for (int j = 0; j < n + 1; j++) {
			for (int i = 1; i <= n ; i++) {
				if (p[i] < p[i + 1]) {
					swap(p[i], p[i + 1]);

				}
			}
		}
				for (int i = 1; i < n + 1; i++) {
					if (i%m != 0) {
						sum += p[i];
					}

			}
		
		cout << sum << endl;
	}
		
	return 0;
}




Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <sstream>

int main(){
    int n,m,x;
    int flag = 0;
    int num = 0;
    std::vector<int> v;
    
    std::cin >> n >> m;
    
    while(std::cin >> x){
        v.emplace_back(x);
    }
    
    std::sort(v.begin(), v.end(), std::greater<int>());
    
    for(int y = 0;y < n;y++){
        flag++;
        if(flag != m){
            num += v[y];
        }
        else
             flag = 0;
    }
    
    std::cout << num << std::endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   18 |     std::sort(v.begin(), v.end(), std::greater<int>());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
#include <vector>
#include <string>

int main(){
    int n,m,x;
    int flag = 0;
    int num = 0;
    std::vector<int> v;
    
    std::cin >> n >> m;
    
    while(std::cin >> x){
        v.emplace_back(x);
    }
    
    std::sort(v.rbegin(),v.rend());
    
    for(int y = 0;y < n;y++){
        flag++;
        if(flag != m){
            num += v[y];
        }
        else
             flag = 0;
    }
    
    std::cout << num << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   17 |     std::sort(v.rbegin(),v.rend());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
#include <vector>
#include <string>

int main(){
    int n,m,x;
    int flag = 0;
    int num = 0;
    std::vector<int> v;
    
    std::cin >> n >> m;
    
    while(std::cin >> x){
        v.push_back(x);
    }
    
    std::sort(v.rbegin(),v.rend());
    
    for(int y = 0;y < n;++y){
        flag++;
        if(flag != m){
            num += v[y];
        }
        else
             flag = 0;
    }
    std::cout << num << std::endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   17 |     std::sort(v.rbegin(),v.rend());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
#include <vector>
#include <string>

int main(){
    int n,m,x;
    int flag = 0;
    int num = 0;
    std::vector<int> v;
    
    std::cin >> n >> m;
    
    while(std::cin >> x){
        v.push_back(x);
    }
    
    sort(v.rbegin(),v.rend());
    
    for(int y = 0;y < n;++y){
        flag++;
        if(flag != m){
            num += v[y];
        }
        else
             flag = 0;
    }
    std::cout << num << std::endl;
}


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

#include <iostream>
#include <array>

int main(){

	int n,m; //問題文のn,m

	while(std::cin >> n >> m){
		if(n==0&&m==0) break;
		std::array<u_int, n> p; //野菜価格一覧
		for(int i=0;i<n;i++){
			std::cin >> p[i];
		}
		std::sort(p.begin(), p.end());
		
		int price=0; //最終出力

		while(n>=m){
			for(int i=0;i<m;i++){
				price += p[n-1-i];
			}
			n -= m;
		}
		for(int i=0;i<n;i++){
			price += p[i];
		}

		std::cout << price << std::endl;
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: the value of 'n' is not usable in a constant expression
   10 |                 std::array<u_int, n> p; //野菜価格一覧
      |                                    ^
a.cc:6:13: note: 'int n' is not const
    6 |         int n,m; //問題文のn,m
      |             ^
a.cc:10:36: note: in template argument for type 'long unsigned int'
   10 |                 std::array<u_int, n> p; //野菜価格一覧
      |                                    ^
a.cc:12:38: error: invalid types 'int[int]' for array subscript
   12 |                         std::cin >> p[i];
      |                                      ^
a.cc:14:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   14 |                 std::sort(p.begin(), p.end());
      |                      ^~~~
      |                      qsort
a.cc:14:29: error: request for member 'begin' in 'p', which is of non-class type 'int'
   14 |                 std::sort(p.begin(), p.end());
      |                             ^~~~~
a.cc:14:40: error: request for member 'end' in 'p', which is of non-class type 'int'
   14 |                 std::sort(p.begin(), p.end());
      |                                        ^~~
a.cc:20:43: error: invalid types 'int[int]' for array subscript
   20 |                                 price += p[n-1-i];
      |                                           ^
a.cc:25:35: error: invalid types 'int[int]' for array subscript
   25 |                         price += p[i];
      |                                   ^
Language: C++

#include <iostream>
#include <array>

int main(){

	int n=0,m=0; //問題文のn,m

	while(std::cin >> n >> m){
		if(n==0&&m==0) break;
		std::array<u_int, n> p; //野菜価格一覧
		for(int i=0;i<n;i++){
			std::cin >> p[i];
		}
		std::sort(p.begin(), p.end());
		
		int price=0; //最終出力

		while(n>=m){
			for(int i=0;i<m;i++){
				price += p[n-1-i];
			}
			n -= m;
		}
		for(int i=0;i<n;i++){
			price += p[i];
		}

		std::cout << price << std::endl;
	}

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: the value of 'n' is not usable in a constant expression
   10 |                 std::array<u_int, n> p; //野菜価格一覧
      |                                    ^
a.cc:6:13: note: 'int n' is not const
    6 |         int n=0,m=0; //問題文のn,m
      |             ^
a.cc:10:36: note: in template argument for type 'long unsigned int'
   10 |                 std::array<u_int, n> p; //野菜価格一覧
      |                                    ^
a.cc:12:38: error: invalid types 'int[int]' for array subscript
   12 |                         std::cin >> p[i];
      |                                      ^
a.cc:14:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   14 |                 std::sort(p.begin(), p.end());
      |                      ^~~~
      |                      qsort
a.cc:14:29: error: request for member 'begin' in 'p', which is of non-class type 'int'
   14 |                 std::sort(p.begin(), p.end());
      |                             ^~~~~
a.cc:14:40: error: request for member 'end' in 'p', which is of non-class type 'int'
   14 |                 std::sort(p.begin(), p.end());
      |                                        ^~~
a.cc:20:43: error: invalid types 'int[int]' for array subscript
   20 |                                 price += p[n-1-i];
      |                                           ^
a.cc:25:35: error: invalid types 'int[int]' for array subscript
   25 |                         price += p[i];
      |                                   ^
Language: C++

#include <iostream>
#include <array>

int main(){

	int n=0,m=0; //問題文のn,m

	while(std::cin >> n >> m){
		if(n==0&&m==0) break;
		std::array<int, n> p; //野菜価格一覧
		for(int i=0;i<n;i++){
			std::cin >> p[i];
		}
		std::sort(p.begin(), p.end());
		
		int price=0; //最終出力

		while(n>=m){
			for(int i=0;i<m;i++){
				price += p[n-1-i];
			}
			n -= m;
		}
		for(int i=0;i<n;i++){
			price += p[i];
		}

		std::cout << price << std::endl;
	}

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:10:34: error: the value of 'n' is not usable in a constant expression
   10 |                 std::array<int, n> p; //野菜価格一覧
      |                                  ^
a.cc:6:13: note: 'int n' is not const
    6 |         int n=0,m=0; //問題文のn,m
      |             ^
a.cc:10:34: note: in template argument for type 'long unsigned int'
   10 |                 std::array<int, n> p; //野菜価格一覧
      |                                  ^
a.cc:12:38: error: invalid types 'int[int]' for array subscript
   12 |                         std::cin >> p[i];
      |                                      ^
a.cc:14:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   14 |                 std::sort(p.begin(), p.end());
      |                      ^~~~
      |                      qsort
a.cc:14:29: error: request for member 'begin' in 'p', which is of non-class type 'int'
   14 |                 std::sort(p.begin(), p.end());
      |                             ^~~~~
a.cc:14:40: error: request for member 'end' in 'p', which is of non-class type 'int'
   14 |                 std::sort(p.begin(), p.end());
      |                                        ^~~
a.cc:20:43: error: invalid types 'int[int]' for array subscript
   20 |                                 price += p[n-1-i];
      |                                           ^
a.cc:25:35: error: invalid types 'int[int]' for array subscript
   25 |                         price += p[i];
      |                                   ^
Language: C++

#include <iostream>
#include <vector>

int main(){

	int n,m; //問題文のn,m

	while(std::cin >> n >> m){
		if(n==0&&m==0) break;
		std::vector<int> p; //野菜価格一覧
		for(int i=0;i<n;i++){
			std::cin >> p[i];
		}
		std::sort(p.begin(), p.end());
		std::reverse(p.begin(), p.end()); //降順ソート
		
		for(int i=m-1;i<n;i+=m){
			std::p.erase(std::v.bigin() +i);
		}

		std::cout << std::accumulate(p.begin(), p.end(), 0) << std::endl;
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   14 |                 std::sort(p.begin(), p.end());
      |                      ^~~~
      |                      qsort
a.cc:15:22: error: 'reverse' is not a member of 'std'
   15 |                 std::reverse(p.begin(), p.end()); //降順ソート
      |                      ^~~~~~~
a.cc:18:30: error: 'p' is not a member of 'std'
   18 |                         std::p.erase(std::v.bigin() +i);
      |                              ^
a.cc:18:43: error: 'v' is not a member of 'std'
   18 |                         std::p.erase(std::v.bigin() +i);
      |                                           ^
a.cc:21:35: error: 'accumulate' is not a member of 'std'
   21 |                 std::cout << std::accumulate(p.begin(), p.end(), 0) << std::endl;
      |                                   ^~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

int main(){

	int n,m; //問題文のn,m

	while(std::cin >> n >> m){
		if(n==0&&m==0) break;
		std::vector<int> p; //野菜価格一覧
		for(int i=0;i<n;i++){
			std::cin >> p[i];
		}
		std::sort(p.begin(), p.end());
		std::reverse(p.begin(), p.end()); //降順ソート
		
		for(int i=m-1;i<n;i+=m){
			p.erase(std::v.bigin() +i);
		}

		std::cout << std::accumulate(p.begin(), p.end(), 0) << std::endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   14 |                 std::sort(p.begin(), p.end());
      |                      ^~~~
      |                      qsort
a.cc:15:22: error: 'reverse' is not a member of 'std'
   15 |                 std::reverse(p.begin(), p.end()); //降順ソート
      |                      ^~~~~~~
a.cc:18:38: error: 'v' is not a member of 'std'
   18 |                         p.erase(std::v.bigin() +i);
      |                                      ^
a.cc:21:35: error: 'accumulate' is not a member of 'std'
   21 |                 std::cout << std::accumulate(p.begin(), p.end(), 0) << std::endl;
      |                                   ^~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

int main(){

	int n,m; //問題文のn,m

	while(std::cin >> n >> m){
		if(n==0&&m==0) break;
		std::vector<int> p; //野菜価格一覧
		for(int i=0;i<n;i++){
			std::cin >> p[i];
		}
		sort(p.begin(), p.end());
		reverse(p.begin(), p.end()); //降順ソート
		
		for(int i=m-1;i<n;i+=m){
			p.erase(std::v.bigin() +i);
		}

		std::cout << accumulate(p.begin(), p.end(), 0) << std::endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |                 sort(p.begin(), p.end());
      |                 ^~~~
      |                 short
a.cc:15:17: error: 'reverse' was not declared in this scope
   15 |                 reverse(p.begin(), p.end()); //降順ソート
      |                 ^~~~~~~
a.cc:18:38: error: 'v' is not a member of 'std'
   18 |                         p.erase(std::v.bigin() +i);
      |                                      ^
a.cc:21:30: error: 'accumulate' was not declared in this scope
   21 |                 std::cout << accumulate(p.begin(), p.end(), 0) << std::endl;
      |                              ^~~~~~~~~~
Language: C++

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

int main(){

	int n,m; //問題文のn,m

	while(std::cin >> n >> m){
		if(n==0&&m==0) break;
		std::vector<int> p; //野菜価格一覧
		for(int i=0;i<n;i++){
			std::cin >> p[i];
		}
		sort(p.begin(), p.end());
		reverse(p.begin(), p.end()); //降順ソート
		
		for(int i=m-1;i<n;i+=m){
			p.erase(p.bigin() +i);
		}

		std::cout << accumulate(p.begin(), p.end(), 0) << std::endl;
	}

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:20:35: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   20 |                         p.erase(p.bigin() +i);
      |                                   ^~~~~
      |                                   begin
Language: C++

#include <iostream>
#include <queue>

int main(){
	int n,m;
	while(std::cin >> n >> m){
		if(n == 0 && m == 0){
			break;
		}
		std::priority_queue<int> que;
		int vegetable;
		for(int i = 0; i < n; ++i){
			std::cin >> vagetable;
			que.push();
		}
		int price = 0;
		for(int i = 0; i < n; ++i){
		    if((i % m) != (m - 1)){
	  	        price += que.top();
		        que.pop();
		    }
		}
		std::cout << price << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:37: error: 'vagetable' was not declared in this scope; did you mean 'vegetable'?
   13 |                         std::cin >> vagetable;
      |                                     ^~~~~~~~~
      |                                     vegetable
a.cc:14:33: error: no matching function for call to 'std::priority_queue<int>::push()'
   14 |                         que.push();
      |                         ~~~~~~~~^~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = int; _Sequence = std::vector<int, std::allocator<int> >; _Compare = std::less<int>; value_type = int]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = int; _Sequence = std::vector<int, std::allocator<int> >; _Compare = std::less<int>; value_type = int]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note:   candidate expects 1 argument, 0 provided