Language: C++

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
pair<int,int> d[40];
int cnt,sparecnt,throwcnt;
int plus[2];
int numcnt;
void Sc(int u){
	if(numcnt>9)plus[0]--;
	if(numcnt>10)plus[0]--;
	d[u].first+=cnt*plus[0];
	plus[0]=plus[1];
	plus[1]=1;
	throwcnt++;
	sparecnt+=cnt;
	if(throwcnt==2){
		if(sparecnt==10){
			plus[0]++;
		}
		throwcnt=0;
		sparecnt=0;
		numcnt++;
	}
	if(cnt==10){
		plus[0]++;
		plus[1]++;
		throwcnt=0;
		sparecnt=0;
		numcnt++;
	}
	cnt=0;
}
int main(){
	int m;
	while(true){
	cin>>m;
	if(!m)break;
	string s;
	for(int u=0;u<m;u++){
		cin>>d[u].second;
		getline(cin,s);
		d[u].second=10000-d[u].second;
		d[u].first=0;
		cnt=0,sparecnt=0,throwcnt=-1;
		plus[0]=1,plus[1]=1;
		numcnt=0;
		for(int i=0;i<s.size();i++){
			if(s[i]==' '){
				Sc(u);
			}
			else{
				cnt*=10;
				cnt+=s[i]-'0';
			}
		}
		Sc(u);
	}
	sort(d,d+m);
	for(int i=m-1;i>=0;i--){
		cout<<10000-d[i].second<<" "<<d[i].first<<endl;
	}
	}
	return 0;
}

Compiler output:
a.cc: In function 'void Sc(int)':
a.cc:10:21: error: reference to 'plus' is ambiguous
   10 |         if(numcnt>9)plus[0]--;
      |                     ^~~~
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:11:22: error: reference to 'plus' is ambiguous
   11 |         if(numcnt>10)plus[0]--;
      |                      ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:12:25: error: reference to 'plus' is ambiguous
   12 |         d[u].first+=cnt*plus[0];
      |                         ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:13:9: error: reference to 'plus' is ambiguous
   13 |         plus[0]=plus[1];
      |         ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:13:17: error: reference to 'plus' is ambiguous
   13 |         plus[0]=plus[1];
      |                 ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:14:9: error: reference to 'plus' is ambiguous
   14 |         plus[1]=1;
      |         ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:19:25: error: reference to 'plus' is ambiguous
   19 |                         plus[0]++;
      |                         ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:26:17: error: reference to 'plus' is ambiguous
   26 |                 plus[0]++;
      |                 ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:27:17: error: reference to 'plus' is ambiguous
   27 |                 plus[1]++;
      |                 ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:46:17: error: reference to 'plus' is ambiguous
   46 |                 plus[0]=1,plus[1]=1;
      |                 ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~
a.cc:46:27: error: reference to 'plus' is ambiguous
   46 |                 plus[0]=1,plus[1]=1;
      |                           ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:7:5: note:                 'int plus [2]'
    7 | int plus[2];
      |     ^~~~