stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

using namespace std;



int main()

{

    int N, AC=0, WA=0, TLE=0, RE=0;

    cin >> N;

    string entr;

    if (N<=0 || N>100000){return 0;}

    for (int i=0; i<N ; i++){

        cin >> entr;

        if (entr == "AC") {

            AC ++;

        }

        if (entr == "WA"){

            WA++;

        }

        if (entr == "TLE"){

            TLE++;

        }

        if (entr == "RE"){

            RE++;

        }

    }

    cout << "AC x " << AC << endl;

    cout << "WA x " << WA << endl;

    cout << "TLE x " << TLE << endl;

    cout << "RE x " << RE << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.251945825061705x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<vector>

using namespace std;

int main()

{

	int n;

	cin >> n;

	string s;

	vector<pair<string, int>>v;

	v.push_back(make_pair("AC", 0));

	v.push_back(make_pair("WA", 0));

	v.push_back(make_pair("TLE", 0));

	v.push_back(make_pair("RE", 0));

	for (int i = 0;i < n;i++)

	{

		cin >> s;

		if (s == "AC")

			v[0].second++;

		else if (s == "WA")

			v[1].second++;

		else if (s == "TLE")

			v[2].second++;

		else if (s == "RE")

			v[3].second++;

	}

	for (int i = 0;i < 4;i++)

	{

		cout << v[i].first << " " << "x" << " " << v[i].second;

		if (i < 3)

		{

			cout << endl;

		}

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2636038699144585x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:


#include <bits/stdc++.h>

using namespace std;

#include<vector>

 int main()

   {

    int AC=0,WA=0,TLE=0,RE=0;

    int n;

    cin>>n;

    string s;

    while(n--)

      {

        cin>>s;

       if(s=="AC"){AC++;}

       if(s=="WA"){WA++;}

       if(s=="TLE"){TLE++;}

       if(s=="RE"){RE++;}

      }

      cout<<"AC x " <<AC<<endl ;

      cout<<"WA x " <<WA<<endl ;

      cout<<"TLE x " <<TLE<<endl ;

      cout<<"RE x " <<RE<<endl ;

   }

// Faster C++ solution for the same problem (measured speedup: 5.2516280013331205x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#define ll long long

using namespace std;

int main(){

    string s;

    ll n;

    string ac="AC";

    ll cac=0;

    string wa="WA";

    ll cwa=0;

    string tle="TLE";

    ll ctle=0;

    string re="RE";

    ll cre=0;

    cin>>n;

    for (ll i = 0; i <n ; ++i) {

        cin>>s;

        if(s==ac){

            cac++;

        }

        else if(s==wa){

            cwa++;

        }

        else if(s==tle){

            ctle++;

        }

        else if (s==re){

            cre++;

        }

    }

    cout<<ac<<" x "<<cac<<endl;

    cout<<wa<<" x "<<cwa<<endl;

    cout<<tle<<" x "<<ctle<<endl;

    cout<<re<<" x "<<cre<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.243759690484126x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>



using namespace std;



int main()

{

    int n, AC = 0, WA = 0, TLE = 0, RE = 0;

    string s;



    cin >> n;

    for (int i = 0 ; i < n ; i++)

    {

        cin >> s;

        if (s == "AC")

            AC++;

        else if (s == "WA")

            WA++;

        else if (s == "TLE")

            TLE++;

        else if (s == "RE")

            RE++;

    }

    cout << "AC x " << AC << "\nWA x " << WA << "\nTLE x " << TLE << "\nRE x " << RE << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.251616891993064x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <map>

#include <queue>

#include <vector>

#include<algorithm>

#include <set>

#include <stdlib.h>



using namespace std;



int main()

{

    map<string,int>m;

    string a[4]={"AC","WA","TLE","RE"};

    int n;

    string arr;

    cin>>n;

    for(int i=0;i<n;i++)

    {

        cin>>arr;

        m[arr]++;

    }

    for(int i=0;i<4;i++)

        {cout<<a[i]<<" x "<<m[a[i]]<<endl;}

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.30658107644675x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    int n,ac=0,wa=0,tle=0,re=0;

    cin>>n;

    string s;

    for(int i=0;i<n;i++)

    {

        cin>>s;

        if(s=="AC")

            ac++;

        else if(s=="WA")

            wa++;

        else if(s=="TLE")

            tle++;

        else if(s=="RE")

            re++;

    }

    cout<<"AC x "<<ac<<endl;

    cout<<"WA x "<<wa<<endl;

    cout<<"TLE x "<<tle<<endl;

    cout<<"RE x "<<re<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.25115368081417x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    int n;

    cin>>n;

    string s[n];

    for (int i = 0; i < n; i++)

    {

        cin>>s[i];

    }

    int AC = 0, WA = 0, TLE = 0, RE = 0;

    for (int i = 0; i < n; i++)

    {

        if (s[i] == "AC")AC++;

        else if (s[i] == "WA")WA++;

        else if (s[i] == "TLE")TLE++;

        else if (s[i] == "RE")RE++;

    }

    cout << "AC x "<<AC<<endl;

    cout << "WA x "<<WA<<endl;

    cout << "TLE x "<<TLE<<endl;

    cout << "RE x "<<RE<<endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.208142180232137x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstring>



using namespace std ;

int main ()

{

  int N ,x=0,y=0,z=0,c=0, i;

  cin >> N ;

string a[N];

for (int i =0;i<N;i++){

cin >> a[i] ;



if (a[i]=="AC")

x=x+1;

if (a[i]=="WA")

y=y+1;

if (a[i]=="TLE")

z=z+1;

if (a[i]=="RE")

c=c+1;

}

cout<<"AC x "<< x <<endl;

cout<<"WA x "<< y <<endl;

cout<<"TLE x "<< z<<endl;

cout<<"RE x "<< c <<endl;

    return 0 ;

}






// Faster C++ solution for the same problem (measured speedup: 5.252517231552458x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstring>



using namespace std;



int main()

{

    int N; cin >> N;

    int ctr = 0;

    int c0=0, c1=0, c2=0, c3=0;

    char input[6];

    do

    {

        cin >> input;

        ctr++;

        if (strcmp(input,"AC") == 0)

        {

            c0++;

        }

        else if (strcmp(input,"WA") == 0)

        {

            c1++;

        }

        else if (strcmp(input,"TLE") == 0)

        {

            c2++;

        }

        else if (strcmp(input,"RE") == 0)

        {

            c3++;

        }

    } while ( ctr < N);

    cout << "AC x "<< c0 << endl;

    cout << "WA x "<< c1 << endl;

    cout << "TLE x "<< c2 << endl;

    cout << "RE x "<< c3 << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.203517796679757x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <iostream>



 using namespace std;

main () 

{

  

int n;

cin >> n;

int c1=0,c2=0,c3=0,c4=0;

for (int i = 0; i < n; i++)

{

    string s;

    cin >>s;

    if (s=="AC")

    c1++;

    else if (s=="WA")

    c2++;

    else if (s=="RE")

    c3++;

    else if (s=="TLE")

    c4++;

}

  cout << "AC x " << c1 << "\n"<<"WA x " << c2 << "\n"<< "TLE x " << c4 << "\n"<<"RE x " << c3 << "\n";



return 0;

    

}

// Faster C++ solution for the same problem (measured speedup: 5.246625900218806x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;



// Common file

#include <ext/pb_ds/assoc_container.hpp>

// Including tree_order_statistics_node_update

#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>







#define pb push_back

#define F first

#define S second

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



using ll = long long;

using ld = long double;

using ul = unsigned long long;

using ii = pair<int, int>;

#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define ReadFile            freopen("input.in","r",stdin)

#define WriteFile           freopen("output.txt","w",stdout)

const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;

const ld EPS = 1e-7;

double Pi=acos(-1);

const ld rad=Pi/180.0;

ll power(ll x, ll y, ll p)

{

    ll res = 1;

    while (y > 0)

    {

        if (y & 1)

            res = (res*x) % p;

            y = y>>1;

            x = (x*x) % p;

    }

    return res;

}

ll nCr (ll n,ll m)

{

    return(m == 0)?1:n*nCr(n-1,m-1)/m;

}



/*****************************************************/



int main()

{

    int n;

    cin >> n;



    string s1 = "AC" , s2 = "WA" , s3 = "TLE" , s4 = "RE" , ss;

    int c0 = 0 , c1 = 0 , c2 = 0 , c3 = 0;



    while(n--) {

        cin >> ss;



        if(ss == s1)

            c0++;

        else if(ss == s2)

            c1++;

        else if(ss == s3)

            c2++;

        else

            c3++;

    }



    cout << s1 << " x " << c0 << "\n";

    cout << s2 << " x " << c1 << "\n";

    cout << s3 << " x " << c2 << "\n";

    cout << s4 << " x " << c3 << "\n";



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.247732970106215x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int main(){ int n, ac = 0, wa = 0, tle = 0, re = 0;

    cin >> n;

    for (int i=0; i<n; i++){ string code;

        cin >> code;

        if(code == "AC")

            ac++;

        else if(code == "WA")

            wa++;

        else if(code == "TLE")

            tle++;

        else if(code == "RE")

            re++;

    }

    cout << "AC x " << ac << endl;

    cout << "WA x " << wa << endl;

    cout << "TLE x " << tle << endl;

    cout << "RE x " << re << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.249766945366198x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

	map <string, int> m;

	long long n;

	string s;

	cin >> n;

	while(n--){

		cin >> s;

		m[s]++;

	}

	cout << "AC x " << m["AC"] << '\n';

	cout << "WA x " << m["WA"] << '\n';

	cout << "TLE x " << m["TLE"] << '\n';

	cout << "RE x " << m["RE"] << '\n';

}

// Faster C++ solution for the same problem (measured speedup: 5.265703535185212x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include<cmath>

using namespace std;



int main(){

int n;

string s1="AC",s2="WA",s3="TLE",s4="RE",m;

int c1=0,c2=0,c3=0,c4=0;

cin>>n;

for(int i=0;i<n;i++){

    cin>>m;

    if(m==s1)c1++;

    else if(m==s2)c2++;

    else if(m==s3)c3++;

    else if(m==s4)c4++;



}

cout<<s1<<" x "<<c1<<endl<<s2<<" x "<<c2<<endl<<s3<<" x "<<c3<<endl<<s4<<" x "<<c4;



    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.245112131882357x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:


#include <iostream>

#include <algorithm>

#include <vector>

using namespace std;



int main() {

	int n, ac{ 0 }, wa{ 0 }, tle{ 0 }, re{ 0 };

	string s;



	cin >> n;

	for (int i{ 0 }; i < n; i++) {

		cin >> s;

		if (s == "AC") {

			ac++;

		}

		else if (s == "WA") {

			wa++;

		}

		else if (s == "TLE") {

			tle++;

		}

		else {

			re++;

		}







	}



	cout << "AC" << " " << "x" << " " << ac << endl;

	cout << "WA" << " " << "x" << " " << wa << endl;

	cout << "TLE" << " " << "x" << " " << tle << endl;

	cout << "RE" << " " << "x" << " " << re<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.253231610419595x):
#include <stdio.h>

#include <string.h>



int main(){

    int cases;

    scanf("%d", &cases);



    int ac = 0, wa = 0, tle = 0, re = 0;



    for(int i = 0; i < cases ; i++){

        char chances[100];

        scanf("%s", chances);



        int length = strlen(chances);



        if(chances[0] == 'A'){

            ac++;

        }

        else if(chances[0] == 'W'){

            wa++;

        }

        else if(chances[0] == 'T'){

            tle++;

        }

        else if (chances[0] == 'R'){

            re++;

        }

    }



    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 map<string,int> mp;

int main()

{

    int n;

    string s;

    cin>>n;

    while(n--)

    {

        cin>>s;

        mp[s]++;

    }

    cout<<"AC x "<<mp["AC"]<<endl;

    cout<<"WA x "<<mp["WA"]<<endl;

    cout<<"TLE x "<<mp["TLE"]<<endl;

    cout<<"RE x "<<mp["RE"]<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.270739447334483x):
#include <stdio.h>

#include <string.h>

int main(){

    int tc;

    scanf("%d", &tc);

    int ac = 0;

    int wa = 0;

    int tle = 0;

    int re = 0;

    int i;

    for( i = 0; i < tc ; i++){

        char verdict[100];

        scanf("%s", verdict);

        int length = strlen(verdict);

        if(verdict[0] == 'A'){

            ac++;

        }

        else if(verdict[0] == 'W'){

            wa++;

        }

        else if(verdict[0] == 'T'){

            tle++;

        }

        else if (verdict[0] == 'R'){

            re++;

        }

    }

    printf("AC x %d\n", ac);

    printf("WA x %d\n", wa);

    printf("TLE x %d\n", tle);

    printf("RE x %d\n", re);

    return 0;

}