alexjercan/bugnet huggingface dataset:
Problem p02675 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  int out = n % 10;
  string output;
  if (out == 2 || out == 4 || out == 5 || out == 7 || out == 9)
    output = "hon";
  else if (out == 0 || out == 1 || out == 6 || out == 8)
    output = "pon";
  else
    output = "bon";
  cout << output;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  int out;
  while (n > 0) {
    if (n / 10 == 0)
      out = n;
    else
      n = n % 10;
  }
  string output;
  if (out == 2 || out == 4 || out == 5 || out == 7 || out == 9)
    output = "hon";
  else if (out == 0 || out == 1 || out == 6 || out == 8)
    output = "pon";
  else
    output = "bon";
  cout << output;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int n, i, m, j, k, s, a;
int main() {
  scanf("%d", &n);
  n = n % 10;
  if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9) {
    printf("hon");
  } else if (n == 0 || n == 1 || n == 6 || n == 8) {
    printf("pon");
  } else if (n == 3) {
    printf("bon");
  }
}

Error: -11

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int n, i, m, j, k, s, a;
int main() {
  scanf("%d", n);
  n = n % 10;
  if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9) {
    printf("hon");
  } else if (n == 0 || n == 1 || n == 6 || n == 8) {
    printf("pon");
  } else if (n == 3) {
    printf("bon");
  }
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
// 12 10
// --------------------------------------------------------------------------------
#define fast_IO ios_base::sync_with_stio(false), cin.tie(NULL), cout.tie(NULL);
#define ll long long
#define mset(arr, val) memset(arr, val, sizeof(arr))
#define deb(name, value) cout << "->>  " << name << "= " << value << " "
#define frepi(a, b, k) for (int i = a; i <= b; i += k)
#define frepj(a, b, k) for (int j = a; j <= b; j += k)
// --------------------------------------------------------------------------------

void solve() {
  int n;
  cin >> n;
  vector<string> s(3);
  s[0] = "hon";
  s[1] = "pon";
  s[2] = "bon";
  int r = n % 10;
  if (r == 2 || r == 4 || r == 5 || r == 7 || r == 9) {
    cout << s[0] << "\\n";
    return;
  }
  if (r == 3) {
    cout << s[2];
    return;
  }
  cout << s[1];
}

int main() {
  // #ifndef ONLINE_JUDGE
  //    	freopen("/home/suryakant/input.txt","r",stdin);
  //        freopen("/home/suryakant/output.txt","w",stdout);
  //    #endif
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
}


Error: -11

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
// 12 10
// --------------------------------------------------------------------------------
#define fast_IO ios_base::sync_with_stio(false), cin.tie(NULL), cout.tie(NULL);
#define ll long long
#define mset(arr, val) memset(arr, val, sizeof(arr))
#define deb(name, value) cout << "->>  " << name << "= " << value << " "
#define frepi(a, b, k) for (int i = a; i <= b; i += k)
#define frepj(a, b, k) for (int j = a; j <= b; j += k)
// --------------------------------------------------------------------------------

void solve() {
  int n;
  cin >> n;
  vector<string> s;
  s[0] = "hon";
  s[1] = "pon";
  s[2] = "bon";
  int r = n % 10;
  if (r == 2 || r == 4 || r == 5 || r == 7 || r == 9) {
    cout << s[0] << "\\n";
    return;
  }
  if (r == 3) {
    cout << s[2];
    return;
  }
  cout << s[1];
}

int main() {
  // #ifndef ONLINE_JUDGE
  //    	freopen("/home/suryakant/input.txt","r",stdin);
  //        freopen("/home/suryakant/output.txt","w",stdout);
  //    #endif
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int s = n % 10;

  if (s == 2 || s == 4 || s == 5 || s == 7 || s == 9) {
    cout << "hon" << endl;
  } else if (s == 0 || s == 1 || s == 6 || s == 8) {
    cout << "pon" << endl;
  } else if (s == 3) {
    cout << "bon" << endl;
  }
}

Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 2) >= this->size() (which is 2)


Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  string n;
  cin >> n;
  int a = n.size();

  if (n.at(a) = 2, 4, 5, 7, 9) {
    cout << "hon" << endl;
  } else if (n.at(a) = 0, 1, 6, 8) {
    cout << "pon" << endl;
  } else if (n.at(a) = 3) {
    cout << "bon" << endl;
  }
}
Problem p02675 (C++) — buggy submission, verdict: Time Limit Exceeded


#include <iostream>

using namespace std;

int main() {
  int a;
  cin >> a;
  int ans = a % 10;
  if (ans == 3) {
    cout << "bon" << endl;
  } else if (ans == 0 || ans == 1 || ans == 6 || ans == 8) {
    cout << "pon" << endl;
  } else {
    cout << "hon" << endl;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stdlib.h>
using namespace std;

int main() {
  int a;
  while (1) {
    cin >> a;
    int ans = a % 10;
    if (ans == 3) {
      cout << "bon" << endl;
    } else if (ans == 0 || ans == 1 || ans == 6 || ans == 8) {
      cout << "pon" << endl;
    } else {
      cout << "hon" << endl;
    }
  }
  return 0;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main(void) {
  int n;
  scanf("%d", &n);
  n %= 10;
  if (n == 3)
    puts("bon");
  else if (n == 0 || n == 1 || n == 6 || n == 8)
    puts("pon");
  else
    puts("hon");
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {
  (void)argc;
  int m = atoi(argv[1]) % 10;

  // if (!(0 <= n && n <= 999) || argc != 2)
  // {
  // 	return 0;
  // }
  // int m = n % 10;

  if (m == 3) {
    printf("bon\\n");
    return 0;
  }

  if (m == 0 || m == 1 || m == 6 || m == 8) {
    printf("pon\\n");
    return 0;
  }

  printf("hon\\n");
  return 0;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  string n;
  cin >> n;
  int a = n.size() - 1;
  if ((n.at(a) == '0') || (n.at(a) == '1') || (n.at(a) == '6') ||
      (n.at(a) == '8'))
    cout << "pon" << endl;
  else if (n.at(a) == '3')
    cout << "bon" << endl;
  else if ((n.at(a) == '2') || (n.at(a) == '4') || (n.at(a) == '5') ||
           (n.at(a) == '7') || (n.at(a) == '9'))
    cout << "hon" << endl;
}

Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 2) >= this->size() (which is 2)


Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  string n;
  cin >> n;
  int a = n.size();
  if ((n.at(a) == '0') || (n.at(a) == '1') || (n.at(a) == '6') ||
      (n.at(a) == '8'))
    cout << "pon" << endl;
  if (n.at(a) == '3')
    cout << "bon" << endl;
  else
    cout << "hon" << endl;
}
Problem p02675 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
//{{{ read()
inline int read() {
  register int x = 0, f = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = x * 10 + (ch ^ 48), ch = getchar();
  return x * f;
}
//}}}
int main() {
  // freopen(".in","r",stdin);
  // freopen(".out","w",stdout);
  int n = read(), f1 = 0, f2 = 0, f3 = 0;
  int y = n % 10;
  if (y == 0 || y == 1 || y == 6 || y == 8)
    f2 = 1;
  if (y == 2 || y == 4 || y == 5 || y == 7 || y == 9)
    f1 = 1;
  if (y == 3)
    f3 = 1;
  if (f3)
    puts("bon");
  else if (f2)
    puts("pon");
  else
    puts("hon");
  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
//{{{ read()
inline int read() {
  register int x = 0, f = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = x * 10 + (ch ^ 48), ch = getchar();
  return x * f;
}
//}}}
int main() {
  // freopen(".in","r",stdin);
  // freopen(".out","w",stdout);
  int n = read(), f1 = 0, f2 = 0, f3 = 0;
  while (n) {
    int y = n % 10;
    if (y == 0 || y == 1 || y == 6 || y == 8)
      f2 = 1;
    if (y == 2 || y == 4 || y == 5 || y == 7 || y == 9)
      f1 = 1;
    if (y == 3)
      f3 = 1;
  }
  if (f3)
    puts("bon");
  else if (f2)
    puts("pon");
  else
    puts("hon");
  return 0;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  if (n % 10 == 3)
    cout << "bon";
  else if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8)
    cout << "pon";
  else
    cout << "hon";
}

Error: -8

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  if (n % 10 == 3)
    cout << "bon";
  else if (n % 0 == 0 || n % 0 == 1 || n % 0 == 6 || n % 0 == 8)
    cout << "pon";
  else
    cout << "hon";
}
Problem p02675 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int sum = 0, num, num1;
  cin >>　num;
  num1 = num;
  if (num < 10) {
  } else {
    num = num % 10;
  }
  switch (num) {
  case 3:
    std ::cout << "bon" << endl;
    break;
  case 0:
  case 1:
  case 6:
  case 8:
    std ::cout << "pon" << endl;
    break;
  default:
    std ::cout << "hon" << endl;
    break;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int sum = 0, num, num1;
  cin >>　num;
  num1 = num;
  while (0 < num1) {
    num1 = (num1 / 10);
    sum++;
  }
  sum = sum - 1;
  while (sum > 0) {
    num = num / 10;
  }
  switch (num) {
  case 3:
    std ::cout << "bon" << endl;
    break;
  case 0:
  case 1:
  case 6:
  case 8:
    std ::cout << "pon" << endl;
    break;
  default:
    std ::cout << "hon" << endl;
    break;
  }
  return 0;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  if (n % 10 == 2 || n % 10 == 4 || n % 10 == 5 || n % 10 == 7 || n % 10 == 9)
    cout << "hon" << endl;
  if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8)
    cout << "pon" << endl;
  if (n % 10 == 3)
    cout << "bon" << endl;
}


Error: -8

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  if (n / 10 % 2 || n / 10 % 4 || n / 10 % 5 || n / 10 % 7 || n / 10 % 9)
    cout << "hon" << endl;
  if (n / 10 % 0 || n / 10 % 8 || n / 10 % 6 || n / 10 % 8)
    cout << "pon" << endl;
  if (n / 10 % 3)
    cout << "bon" << endl;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  N = N - N / 100 * 100;
  N = N - N / 10 * 10;
  if (N == 3) {
    cout << "bon" << endl;
  } else if (N == 0 || N == 1 || N == 6 || N == 8) {
    cout << "pon" << endl;
  } else
    cout << "hon" << endl;
}

Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)


Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  string N;
  cin >> N;
  vector<string> wtf(N.size());
  for (int i = 0; i < 10; i++) {
    if (i == 3) {
      wtf.at(i) == "bon";
    } else if (i == 0 || i == 1 || i == 6 || i == 8) {
      wtf.at(i) == "pon";
    } else
      wtf.at(i) == "hon";
  }
  if (N.size() == 3) {
    string h = wtf.at(2);
    cout << h << endl;
  } else if (N.size() == 1) {
    string j = wtf.at(1);
    cout << j << endl;
  } else {
    string k = wtf.at(0);
    cout << k << endl;
  }
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {

  int num = 0;

  cin >> num;

  if (num < 10) {

    if (num == 2 || num == 4 || num == 5 || num == 7 || num == 9) {

      cout << "hon" << endl;

    } else if (num == 0 || num == 1 || num == 6 || num == 8) {

      cout << "pon" << endl;

    } else if (num == 3) {

      cout << "bon" << endl;
    }

  } else if (10 <= num) {

    if (num % 10 == 2 || num % 10 == 4 || num % 10 == 5 || num % 10 == 7 ||
        num % 10 == 9) {

      cout << "hon" << endl;

    } else if (num % 10 == 0 || num % 10 == 1 || num % 10 == 6 ||
               num % 10 == 8) {

      cout << "pon" << endl;

    } else if (num % 10 == 3) {

      cout << "bon" << endl;
    }
  }

  return 0;
}

Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 2) >= this->size() (which is 2)


Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {

  string N;

  cin >> N;

  if (N.at(2) == '2' || N.at(2) == '4' || N.at(2) == '5' || N.at(2) == '7' ||
      N.at(2) == '9') {

    cout << "hon" << endl;

  } else if (N.at(2) == '0' || N.at(2) == '1' || N.at(2) == '6' ||
             N.at(2) == '8') {

    cout << "pon" << endl;

  } else if (N.at(2) == '3') {

    cout << "bon" << endl;
  }

  return 0;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
  vector<string> X(10);
  X[0] = "pon";
  X[1] = "pon";
  X[2] = "hon";
  X[3] = "bon";
  X[4] = "hon";
  X[5] = "hon";
  X[6] = "pon";
  X[7] = "hon";
  X[8] = "pon";
  X[9] = "hon";
  int Y;
  cin >> Y;
  int S = Y % 10;
  cout << X[S] << endl;
}

Error: -11

Fixed submission:

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
  vector<string> X;
  X[0] = "pon";
  X[1] = "pon";
  X[2] = "hon";
  X[3] = "bon";
  X[4] = "hon";
  X[5] = "hon";
  X[6] = "pon";
  X[7] = "hon";
  X[8] = "pon";
  X[9] = "hon";
  int Y;
  cin >> Y;
  int S = Y % 10;
  cout << X[S] << endl;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>

using namespace std;

int main() {
  int N;
  int num1[5] = {2, 4, 5, 7, 9};
  int num2[4] = {0, 1, 6, 8};
  cin >> N;
  for (int i = 0; i < 5; i++) {
    if (N % 10 == num1[i]) {
      cout << "hon";
      exit(0);
    }
  }
  for (int i = 0; i < 4; i++) {
    if (N % 10 == num2[i]) {
      cout << "pon";
      exit(0);
    }
  }
  cout << "bon";
}

Error: 1

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int N;
  int num1[5] = {2, 4, 5, 7, 9};
  int num2[4] = {0, 1, 6, 8};
  cin >> N;
  for (int i = 0; i < 5; i++) {
    if (N % 10 == num1[i]) {
      cout << "hon";
      exit(1);
    }
  }
  for (int i = 0; i < 4; i++) {
    if (N % 10 == num2[i]) {
      cout << "pon";
      exit(1);
    }
  }
  cout << "bon";
}
Problem p02675 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, j;
  cin >> a;
  j = a - (a / 10) * 10;

  if (j == 0) {

    cout << "pon" << endl;

  }

  else if (j == 1) {

    cout << "pon" << endl;

  }

  else if (j == 3) {

    cout << "bon" << endl;

  }

  else if (j == 6) {

    cout << "pon" << endl;

  }

  else if (j == 6) {

    cout << "pon" << endl;

  }

  else if (j == 8) {

    cout << "pon" << endl;

  }

  else {

    cout << "hon" << endl;
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a;
  cin >> a;

  for (int j = a - (a / 10) * 10; 0 <= j < 10; j++)

    if (j == ((2 && 4) && (5 && 7)) && 9) {

      cout << "hon" << endl;

    }

    else if (j == ((0 && 1) && (6 && 8))) {

      cout << "pon" << endl;

    }

    else if (j == 3) {

      cout << "bon" << endl;
    }
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int n;
  cin >> n;
  vector<string> s(10);
  s[0] = "pon";
  s[1] = "pon";
  s[2] = "hon";
  s[3] = "bon";
  s[4] = "hon";
  s[5] = "hon";
  s[6] = "pon";
  s[7] = "hon";
  s[8] = "pon";
  s[9] = "hon";
  cout << s[n % 10] << "\\n";
  return 0;
}

Error: -11

Fixed submission:

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

int main() {
  int n;
  cin >> n;
  vector<string> s;
  s[0] = "pon";
  s[1] = "pon";
  s[2] = "hon";
  s[3] = "bon";
  s[4] = "hon";
  s[5] = "hon";
  s[6] = "pon";
  s[7] = "hon";
  s[8] = "pon";
  s[9] = "hon";
  cout << s[n % 10] << "\\n";
  return 0;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {

  string N;
  char n;
  cin >> N;
  n = N.at(N.size() - 1);
  if (n == '3') {
    cout << "bon" << endl;
  } else if (n == '0' or n == '1' or n == '6' or n == '8') {
    cout << "pon" << endl;
  } else {
    cout << "hon" << endl;
  }
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 18446744073709551615) >= this->size() (which is 0)


Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {

  string N;
  char n;
  n = N.at(N.size() - 1);
  if (n == '3') {
    cout << "bon" << endl;
  } else if (n == '0' or n == '1' or n == '6' or n == '8') {
    cout << "pon" << endl;
  } else {
    cout << "hon" << endl;
  }
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  if (N % 10 == 3) {
    cout << "bon" << endl;
  } else {
    if (N % 10 == 0 || N % 10 == 1 || N % 10 == 6 || N % 10 == 8) {
      cout << "pon" << endl;
    } else {
      cout << "hon" << endl;
    }
  }
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 2) >= this->size() (which is 2)


Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int size;
  string N;
  cin >> N;
  size = N.size();
  if (N.at(size) == 3) {
    cout << "bon" << endl;
  } else {
    if (N.at(size) == 0 || N.at(size) == 1 || N.at(size) == 6 ||
        N.at(size) == 8) {
      cout << "pon" << endl;
    } else {
      cout << "hon" << endl;
    }
  }
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n = 0;
  cin >> n;
  if (n % 10 == 2 || n % 10 == 4 || n % 10 == 5 || n % 10 == 7 || n % 10 == 9)
    cout << "hon";
  if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8)
    cout << "pon";
  if (n % 10 == 3)
    cout << "bon";
  return 0;
}


Error: 1

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  if (n % 10 == 2 || n % 10 == 4 || n % 10 == 5 || n % 10 == 7 || n % 10 == 9)
    cout << "hon";
  if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8)
    cout << "pon";
  if (n % 10 == 3)
    cout << "bon";
  return 1;
}
Problem p02675 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  for (int i = 3; i > 0; i--) {
    N = N % (10 * i);
  }
  if (N == 3) {
    cout << "bon" << endl;
  }
  if (N == 0 || N == 1 || N == 6 || N == 8) {
    cout << "pon" << endl;
  }
  if (N == 2 || N == 4 || N == 5 || N == 7 || N == 9) {
    cout << "hon" << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  for (int i = 3; i > 0; i++) {
    N = N % (10 * i);
  }
  if (N == 3) {
    cout << "bon" << endl;
  }
  if (N == 0 || N == 1 || N == 6 || N == 8) {
    cout << "pon" << endl;
  }
  if (N == 2 || N == 4 || N == 5 || N == 7 || N == 9) {
    cout << "hon" << endl;
  }
  return 0;
}
Problem p02675 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace __gnu_pbds;
using namespace std;

typedef tree<long long, null_type, less<long long>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;

// defines
typedef long long ll;

ll solve(ll t) { /*hon when the digit in the one's place of
                N
                 is
                2
                ,
                4
                ,
                5
                ,
                7
                , or
                9
                ;
                pon when the digit in the one's place of
                N
                 is
                0
                ,
                1
                ,
                6
                 or
                8
                ;
                bon when the digit in the one's place of
                N
                 is
                3
                .*/
  string s;
  cin >> s;
  ll n = s.size() - 1;
  if (s[n] == '0' or s[n] == '1' or s[n] == '6' or s[n] == '8')
    cout << "pon";
  else if (s[n] == '3')
    cout << "bon";
  else
    cout << "hon";
  if (t > 0)
    cout << "\\n";
  return 0;
}

int32_t main() {
#ifdef ONPC
  freopen("input.txt", "r", stdin);
#endif
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll t = 1;
  // cin>>t;
  while (t--) {
    solve(t);
  }

  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace __gnu_pbds;
using namespace std;

typedef tree<long long, null_type, less<long long>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;

// defines
typedef long long ll;

ll solve(ll t) { /*hon when the digit in the one's place of
                N
                 is
                2
                ,
                4
                ,
                5
                ,
                7
                , or
                9
                ;
                pon when the digit in the one's place of
                N
                 is
                0
                ,
                1
                ,
                6
                 or
                8
                ;
                bon when the digit in the one's place of
                N
                 is
                3
                .*/
  string s;
  cin >> s;
  ll n = s.size() - 1;
  if (s[n] == '0' or s[n] == '1' or s[n] == '6' or s[n] == '8')
    cout << "pon";
  else if (s[n] == '3')
    cout << "bon";
  else
    cout << "hon";
  if (t > 0)
    cout << "\\n";
}

int32_t main() {
#ifdef ONPC
  freopen("input.txt", "r", stdin);
#endif
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll t = 1;
  // cin>>t;
  while (t--) {
    solve(t);
  }

  return 0;
}