ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 7):
#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef long long i64;
typedef unsigned long long u64;
typedef __int128 i128;
typedef pair<int, int> pII;
typedef tuple<int, int, int> pIII;
#define x first
#define y second
#define all(x) x.begin(), x.end()
const int N = 2e5 + 10, M = 1e6 + 10, mod = 1e9 + 7, inf = 0x3f3f3f3f3f3f3f3f, base = 131;
int t, n, m, q, k;
int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
struct PII {
  int x, y;
  bool operator< (const PII &tmp) const {
    return x < tmp.x;
  }
};

void solve() {
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i ++ ) cin >> a[i];
  vector<pII> res;
  int cnt = 0;
  for (int i = 0; i < n; i ++ )
    for (int j = i + 1; j < n; j ++ )
      if (a[i] > a[j]) {
        res.push_back({a[i], a[j]});
      }
  for (int i = n - 1; i >= 0; i -- ) {
    for (int j = i - 1; j >= 0; j -- ) {
      if (a[i] > a[j])
        res.push_back({a[i], a[j]});
    }
    for (int j = 0; j < i; j ++ )
      if (a[i] > a[j])
        res.push_back({a[j], a[i]});
  }
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); i ++ )
    cout << res[i].x << ' ' << res[i].y << '\n';
} 

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);
  // cin >> t;
  t = 1;
  while (t -- ) solve();
  return 0;
}

Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef long long i64;
typedef unsigned long long u64;
typedef __int128 i128;
typedef pair<int, int> pII;
typedef tuple<int, int, int> pIII;
#define x first
#define y second
#define all(x) x.begin(), x.end()
const int N = 2e5 + 10, M = 1e6 + 10, mod = 1e9 + 7, inf = 0x3f3f3f3f3f3f3f3f, base = 131;
int t, n, m, q, k;
int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
struct PII {
  int x, y;
  bool operator< (const PII &tmp) const {
    return x < tmp.x;
  }
};

void solve() {
  cin >> n;
  vector<int> a(n);
  map<int, int> pos;
  for (int i = 0; i < n; i ++ ) {
    cin >> a[i];
    pos[a[i]] = i;
  }
  vector<pII> res;
  set<pII> st;
  vector<int> p(n);
  for (int i = 0; i < n; i ++ ) p[i] = i + 1;
  for (int j = 0; j < n; j ++ ) {
    for (int i = 0; i < n - 1; i ++ ) {
      int x = p[i + 1], y = p[i];
      if (x > y) swap(x, y);
      if (st.count({x, y})) continue;
      st.insert({x, y});
      res.push_back({p[i + 1], p[i]});
      if (pos[p[i]] > pos[p[i + 1]]) swap(p[i], p[i + 1]);
      else res.push_back({p[i], p[i + 1]});
    }
  }
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); i ++ )
    cout << res[i].x << ' ' << res[i].y << '\n';
} 

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);
  // cin >> t;
  t = 1;
  while (t -- ) solve();
  return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef long long i64;
typedef unsigned long long u64;
typedef __int128 i128;
typedef pair<int, int> pII;
typedef tuple<int, int, int> pIII;
#define x first
#define y second
#define all(x) x.begin(), x.end()
const int N = 2e5 + 10, M = 1e6 + 10, mod = 1e9 + 7, inf = 0x3f3f3f3f3f3f3f3f, base = 131;
int t, n, m, q, k;
int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
struct PII {
  int x, y;
  bool operator< (const PII &tmp) const {
    return x < tmp.x;
  }
};

void solve() {
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i ++ ) cin >> a[i];
  vector<pII> res;
  int cnt = 0;
  for (int i = 0; i < n; i ++ )
    for (int j = i + 1; j < n; j ++ )
      if (a[i] > a[j]) {
        res.push_back({a[i], a[j]});
      }
  for (int i = 0; i < n; i += 2) {
    if (i + 1 >= n) break;
    res.push_back({a[i + 1], a[i]});
    res.push_back({a[i], a[i + 1]});
  }
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); i ++ )
    cout << res[i].x << ' ' << res[i].y << '\n';
} 

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);
  // cin >> t;
  t = 1;
  while (t -- ) solve();
  return 0;
}

Submission (verdict: Wrong answer on test 7):
#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef long long i64;
typedef unsigned long long u64;
typedef __int128 i128;
typedef pair<int, int> pII;
typedef tuple<int, int, int> pIII;
#define x first
#define y second
#define all(x) x.begin(), x.end()
const int N = 2e5 + 10, M = 1e6 + 10, mod = 1e9 + 7, inf = 0x3f3f3f3f3f3f3f3f, base = 131;
int t, n, m, q, k;
int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
struct PII {
  int x, y;
  bool operator< (const PII &tmp) const {
    return x < tmp.x;
  }
};

void solve() {
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i ++ ) cin >> a[i];
  vector<pII> res;
  int cnt = 0;
  for (int i = 0; i < n; i ++ )
    for (int j = i + 1; j < n; j ++ )
      if (a[i] > a[j]) {
        res.push_back({a[i], a[j]});
      }
  for (int i = n - 1; i >= 0; i -- ) {
    for (int j = i - 1; j >= 0; j -- ) {
      if (a[i] > a[j])
        res.push_back({a[i], a[j]});
    }
    for (int j = 0; j < i; j ++ )
      if (a[i] > a[j])
        res.push_back({a[j], a[i]});
  }
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); i ++ )
    cout << res[i].x << ' ' << res[i].y << '\n';
} 

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);
  // cin >> t;
  t = 1;
  while (t -- ) solve();
  return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 3):
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;

#define ll long long
#define ull unsigned long long
#define vi vector<int>

void solve()
{
    string s;
    cin >> s;

    int shuma = 0;

    for (auto &val : s)
        shuma += val - '0';

    if (shuma % 9 == 0)
    {
        cout << "YES";

        return;
    }

    bool mundet = false;

    queue<pair<string, int>> q; // pair<numri, shuma>;
    q.push({s, shuma});

    unordered_map<string, int> memo;
    while (!q.empty())
    {
        auto [nr, sh] = q.front();
        q.pop();

        if (sh % 9 == 0)
        {
            mundet = true;
            break;
        }

        int dysha = 0, tresha = 0;

        for (int i = 0; i < nr.length(); i++)
        {
            if (nr[i] == '2' && dysha < 9) 
            {
                dysha++;
                sh -= 2;
                sh += 4;
                nr[i] = '4';

                if (memo.find(nr) == memo.end())
                {
                    q.push({nr, sh});
                    memo[nr] = 1;
                }
                sh -= 4;
                sh += 2;
                nr[i] = '2';
            }

            if (nr[i] == '3' && tresha < 9)
            {
                tresha ++;
                sh -= 3;
                sh += 9;
                nr[i] = '9';

                if (memo.find(nr) == memo.end())
                {
                    q.push({nr, sh});
                    memo[nr] = 1;
                }

                sh -= 9;
                sh += 3;
                nr[i] = '3';
            }
        }
    }

    if (mundet)
        cout << "YES";
    else
        cout << "NO";
}

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

    int t;
    cin >> t;

    while (t--)
    {

        solve();
        cout << '\n';
    }

    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;

#define ll long long
#define ull unsigned long long
#define vi vector<int>

void solve()
{
    string s;
    cin >> s;

    int shuma = 0, dysha = 0, tresha = 0;

    for (auto &val : s)
    {
        shuma += val - '0';

        if (val == '2')
            dysha++;
        if (val == '3')
            tresha++;
    }
    bool mundet = false;

    for (int i = 0; i <= min(8, dysha); i++)
    {
        if (mundet)
            break;

        for (int j = 0; j <= min(8, tresha); j++)
        {
            if ((shuma + i * 2 + j * 3) % 9 == 0)
            {
                mundet = true;
                break;
            }
        }
    }

    if (mundet)
        cout << "YES";
    else
        cout << "NO";
}

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

    int t;
    cin >> t;

    while (t--)
    {

        solve();
        cout << '\n';
    }

    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


Submission (verdict: Time limit exceeded on test 3):
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;

#define ll long long
#define ull unsigned long long
#define vi vector<int>

void solve()
{
    string s;
    cin >> s;

    int shuma = 0;

    for (auto &val : s)
        shuma += val - '0';

    if (shuma % 9 == 0)
    {
        cout << "YES";

        return;
    }

    bool mundet = false;

    queue<pair<string, int>> q; // pair<numri, shuma>;
    q.push({s, shuma});

    unordered_map<string, int> memo;
    while (!q.empty())
    {
        auto [nr, sh] = q.front();
        q.pop();

        if (sh % 9 == 0)
        {
            mundet = true;
            break;
        }

        for (int i = 0; i < nr.length(); i++)
        {
            if (nr[i] == '2')
            {
                sh -= 2;
                sh += 4;
                nr[i] = '4';

                if (memo.find(nr) == memo.end())
                {
                    q.push({nr, sh});
                    memo[nr] = 1;
                }
                sh -= 4;
                sh += 2;
                nr[i] = '2';
            }

            if (nr[i] == '3')
            {
                sh -= 3;
                sh += 9;
                nr[i] = '9';

                if (memo.find(nr) == memo.end())
                {
                    q.push({nr, sh});
                    memo[nr] = 1;
                }

                sh -= 9;
                sh += 3;
                nr[i] = '3';
            }
        }
    }

    if (mundet)
        cout << "YES";
    else
        cout << "NO";
}

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

    int t;
    cin >> t;

    while (t--)
    {

        solve();
        cout << '\n';
    }

    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;

#define ll long long
#define ull unsigned long long
#define vi vector<int>

void solve()
{
    string s;
    cin >> s;

    int shuma = 0, dysha = 0, tresha = 0;

    for (auto &val : s)
    {
        shuma += val - '0';

        if (val == '2')
            dysha++;
        if (val == '3')
            tresha++;
    }
    bool mundet = false;

    for (int i = 0; i <= min(8, dysha); i++)
    {
        if (mundet)
            break;

        for (int j = 0; j <= min(8, tresha); j++)
        {
            if ((shuma + i * 2 + j * 3) % 9 == 0)
            {
                mundet = true;
                break;
            }
        }
    }

    if (mundet)
        cout << "YES";
    else
        cout << "NO";
}

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

    int t;
    cin >> t;

    while (t--)
    {

        solve();
        cout << '\n';
    }

    return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;

#define ll long long
#define ull unsigned long long
#define vi vector<int>

void solve()
{
    string s;
    cin >> s;

    int shuma = 0, dysha = 0, tresha = 0;

    for (auto &val : s)
    {
        shuma += val - '0';

        if (val == '2')
            dysha++;
        else if (val == '3')
            tresha++;
        else
        {
            
        }
    }
    bool mundet = false;

    for (int i = 0; i <= min(8, dysha); i++)
    {
        if (mundet)
            break;

        for (int j = 0; j <= min(8, tresha); j++)
        {
            if ((shuma + i * 2 + j * 6) % 9 == 0)
            {
                mundet = true;
                break;
            }
        }
    }

    if (mundet)
        cout << "YES";
    else
        cout << "NO";
}

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

    int t;
    cin >> t;

    while (t--)
    {

        solve();
        cout << '\n';
    }

    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define int long long
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define all(x) x.begin(),x.end()
#define test(x) for(auto i:x){cout << i << ' ';}cout<< endl;
using namespace std;

const int MOD = 998244353;

// Function to compute (2^exp) % MOD using binary exponentiation
int pow2(int exp) {
    int result = 1, base = 2;
    while (exp > 0) {
        if (exp % 2 == 1) result = (result * base) % MOD;
        base = (base * base) % MOD;
        exp /= 2;
    }
    return result;
}
bool done(ll n)
{
    while (n)
    {
        if (n % 10 == 7)
        {
            return true;
        }
        n /= 10;
    }
    return false;
}
void solve()
{
    ll n;
    cin >> n;
    vector<int>a(n);
    int sum = 0;
    for(int i = 0;i<n;i++){
        cin >> a[i];
        sum += a[i];
    }
    if(n == 1){
        cout << a[0] << endl;
        return;
    }
    
    for(int k = 1;k<=n-1;k++){
        vector<int>temp;
        for(int i = 0;i<a.size()-1;i++){
            temp.push_back(a[i+1]-a[i]);
        }
        a = temp;
    }
    cout << max(abs(a[0]),sum) << endl;
}


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}


Submission (verdict: Wrong answer on test 6):
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define int long long
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define all(x) x.begin(),x.end()
#define test(x) for(auto i:x){cout << i << ' ';}cout<< endl;
using namespace std;

const int MOD = 998244353;

// Function to compute (2^exp) % MOD using binary exponentiation
int pow2(int exp) {
    int result = 1, base = 2;
    while (exp > 0) {
        if (exp % 2 == 1) result = (result * base) % MOD;
        base = (base * base) % MOD;
        exp /= 2;
    }
    return result;
}
bool done(ll n)
{
    while (n)
    {
        if (n % 10 == 7)
        {
            return true;
        }
        n /= 10;
    }
    return false;
}
void solve()
{
    ll n;
    cin >> n;
    vector<int>a(n);
    int sum = 0;
    for(int i = 0;i<n;i++){
        cin >> a[i];
        sum += a[i];
    }
    if(n == 1){
        cout << a[0] << endl;
        return;
    }
    int maxi = -1e18;
    for(int k = 1;k<=n-1;k++){
        vector<int>temp;
        for(int i = 0;i<a.size()-1;i++){
            temp.push_back(a[i+1]-a[i]);
        }
        maxi = max(maxi,(temp.size()!=1?(abs(temp[temp.size()-1]-temp[0])):abs(temp[0])));
        a = temp;
    }
    cout << max(maxi,sum) << endl;
}


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 6):
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define int long long
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define all(x) x.begin(),x.end()
#define test(x) for(auto i:x){cout << i << ' ';}cout<< endl;
using namespace std;

const int MOD = 998244353;

// Function to compute (2^exp) % MOD using binary exponentiation
int pow2(int exp) {
    int result = 1, base = 2;
    while (exp > 0) {
        if (exp % 2 == 1) result = (result * base) % MOD;
        base = (base * base) % MOD;
        exp /= 2;
    }
    return result;
}
bool done(ll n)
{
    while (n)
    {
        if (n % 10 == 7)
        {
            return true;
        }
        n /= 10;
    }
    return false;
}
void solve()
{
    ll n;
    cin >> n;
    vector<int>a(n);
    int sum = 0;
    for(int i = 0;i<n;i++){
        cin >> a[i];
        sum += a[i];
    }
    if(n == 1){
        cout << a[0] << endl;
        return;
    }
    int maxi = -1e18;
    for(int k = 1;k<=n-1;k++){
        vector<int>temp;
        for(int i = 0;i<a.size()-1;i++){
            temp.push_back(a[i+1]-a[i]);
        }
        maxi = max(maxi,(temp.size()!=1?(abs(temp[temp.size()-1]-temp[0])):abs(temp[0])));
        a = temp;
    }
    cout << max(maxi,sum) << endl;
}


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define int long long
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define all(x) x.begin(),x.end()
#define test(x) for(auto i:x){cout << i << ' ';}cout<< endl;
using namespace std;

const int MOD = 998244353;

// Function to compute (2^exp) % MOD using binary exponentiation
int pow2(int exp) {
    int result = 1, base = 2;
    while (exp > 0) {
        if (exp % 2 == 1) result = (result * base) % MOD;
        base = (base * base) % MOD;
        exp /= 2;
    }
    return result;
}
bool done(ll n)
{
    while (n)
    {
        if (n % 10 == 7)
        {
            return true;
        }
        n /= 10;
    }
    return false;
}
void solve()
{
    ll n;
    cin >> n;
    vector<int>a(n);
    int sum = 0;
    for(int i = 0;i<n;i++){
        cin >> a[i];
        sum += a[i];
    }
    if(n == 1){
        cout << a[0] << endl;
        return;
    }
    int maxi = -1e18;
    for(int k = 1;k<=n-1;k++){
        vector<int>temp;
        maxi = max(maxi,(a.size()!=1?(abs(a[a.size()-1]-a[0])):abs(a[0])));
        for(int i = 0;i<a.size()-1;i++){
            temp.push_back(a[i+1]-a[i]);
        }
        a = temp;
    }
    cout << max(maxi,sum) << endl;
}


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define int long long
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define all(x) x.begin(),x.end()
#define test(x) for(auto i:x){cout << i << ' ';}cout<< endl;
using namespace std;

const int MOD = 998244353;

// Function to compute (2^exp) % MOD using binary exponentiation
int pow2(int exp) {
    int result = 1, base = 2;
    while (exp > 0) {
        if (exp % 2 == 1) result = (result * base) % MOD;
        base = (base * base) % MOD;
        exp /= 2;
    }
    return result;
}
bool done(ll n)
{
    while (n)
    {
        if (n % 10 == 7)
        {
            return true;
        }
        n /= 10;
    }
    return false;
}
void solve()
{
    ll n;
    cin >> n;
    vector<int>a(n);
    int sum = 0;
    for(int i = 0;i<n;i++){
        cin >> a[i];
        sum += a[i];
    }
    if(n == 1){
        cout << a[0] << endl;
        return;
    }
    
    for(int k = 1;k<=n-1;k++){
        vector<int>temp;
        for(int i = 0;i<a.size()-1;i++){
            temp.push_back(a[i+1]-a[i]);
        }
        a = temp;
    }
    cout << max(abs(a[0]),sum) << endl;
}


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2061D - Kevin and Numbers
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Time limit exceeded on test 5):
#include <bits/stdc++.h>
#define ll long long
#define yes cout << "YES" << '\n'
#define no cout << "NO" << '\n'
#define K ios_base::sync_with_stdio(NULL),cin.tie(0),cout.tie(0);
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
using namespace std;
ll const mod = 1e9+7,N=200005;
ll f[N],ff[N],dp[N],dp1[N],fff[N],r,k,n,m,q,ans,ans1,sum,sum1,ind1,ind2,ind3,l,l1,r1,x,y,z,mx,mn,cnt,a,b,c,d,t=1,xy[1][1];
char xy1[1][1],fc[N],ch;
bool bv2[N],bv1[N],bb,bbb;
string s,s1,s2;
vector<ll> v,v1,v2,v3,v4,aa1[N];
vector<pair<ll,ll>> vp,vp1,aa[N];
multiset <ll> st,st1;
map<ll,ll> mp,mp2,mp3;

void s0()
{
    cin>>n>>m;
    st.clear(),st1.clear();
    sum=0;
    for(int i=1 ; i<=n ; i++) 
    {
        cin>>x;
        st.insert(x);
        sum+=x;
    }
    for(int i=1 ; i<=m ; i++) 
    {
        cin>>x;
        st1.insert(x);
        sum-=x;
    }
    if(sum) return void (no);
    while((int)st1.size())
    {
        v.clear();
        v1.clear();
        for(auto ss:st1)
        {
            if(st.count(ss)) st.erase(st.find(ss));
            else if(ss/2) v1.push_back(ss/2),v1.push_back(ss/2+(ss&1));
            else {return void (no);}
            v.push_back(ss);
        }
        for(auto vv:v) st1.erase(st1.find(vv));
        for(auto vv:v1) st1.insert(vv);
    }
    (st==st1)? yes : no ;
}

int main()
{
    // freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout);
    K;
    cin>>t;
    while(t--) s0();
}
Problem: 2057B - Gorilla and the Exam
Language: Python 3

Previous submission (verdict: Wrong answer on test 1):
n = int(input())
for _ in range(n):
    l, k = map(int, input().split())
    input_str = input()
    arr = list(map(int, input_str.split()))

    # 先排序
    arr.sort()

    # 存储不同的数字有几组
    count = []
    curnum = 1

    for i in range(1, l):
        if arr[i] == arr[i - 1]:
            curnum += 1
        else:
            count.append(curnum)
            curnum = 1
    count.append(curnum)

    count.sort()
    sum = 0
    ans = len(count)
    for c in count:
        sum += c
        if k >= sum:
            ans -= 1
        else:
            break
    print(ans)


Submission (verdict: Accepted):
n = int(input())
for _ in range(n):
    l, k = map(int, input().split())
    input_str = input()
    arr = list(map(int, input_str.split()))

    # 先排序
    arr.sort()

    # 存储不同的数字有几组
    count = []
    curnum = 1

    for i in range(1, l):
        if arr[i] == arr[i - 1]:
            curnum += 1
        else:
            count.append(curnum)
            curnum = 1
    count.append(curnum)

    count.sort()
    sum = 0
    ans = len(count)
    for c in count:
        if ans == 1:
            break
        sum += c
        if k >= sum:
            ans -= 1
        else:
            break
    print(ans)