Language: C++

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
pair<int,int> d[40];
int cnt,sparecnt,throwcnt,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:9:21: error: reference to 'plus' is ambiguous
    9 |         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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:10:22: error: reference to 'plus' is ambiguous
   10 |         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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:11:25: error: reference to 'plus' is ambiguous
   11 |         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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:12:9: error: reference to 'plus' is ambiguous
   12 |         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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:12:17: error: reference to 'plus' is ambiguous
   12 |         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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:13:9: error: reference to 'plus' is ambiguous
   13 |         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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:18:25: error: reference to 'plus' is ambiguous
   18 |                         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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:25:17: error: reference to 'plus' is ambiguous
   25 |                 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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:26:17: error: reference to 'plus' is ambiguous
   26 |                 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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc: In function 'int main()':
a.cc:44:46: error: reference to 'plus' is ambiguous
   44 |                 cnt=0,sparecnt=0,throwcnt=-1,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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~
a.cc:44:56: error: reference to 'plus' is ambiguous
   44 |                 cnt=0,sparecnt=0,throwcnt=-1,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:6:27: note:                 'int plus [2]'
    6 | int cnt,sparecnt,throwcnt,plus[2];
      |                           ^~~~