alexjercan/bugnet huggingface dataset:
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vi vector<int>
#define vii vector<int, int>
#define po pop_back
#define hell 1000000007
using namespace std;

void solve() {
  int n;
  cin >> n;
  while (n > 0) {
    if (n % 10 == 7) {
      cout << "Yes";
      return;
    }
    n /= 10;
  }
  cout << "No";
}

int main() {
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vi vector<int>
#define vii vector<int, int>
#define po pop_back
#define hell 1000000007
using namespace std;

int a[201][201];

int gcd(int a, int b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}

void filla() {
  for (int i = 1; i < 201; i++) {
    for (int j = 1; j < 201; j++) {
      if (a[i][j] != 0)
        continue;
      else {
        a[i][j] = gcd(i, j);
        a[j][i] = a[i][j];
      }
    }
  }
}

void solve() {
  memset(a, 0, sizeof(a));
  filla();
  int k;
  cin >> k;
  ll ans = 0;
  for (int i = 1; i < k + 1; i++) {
    for (int j = 1; j < k + 1; j++) {
      for (int l = 1; l < k + 1; l++) {
        ans += a[i][a[j][l]];
      }
    }
  }
  cout << ans;
}

int main() {
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  string N;
  int count;
  cin >> N;
  rep(i, 3) {
    if (N.at(i) == '7') {
      count++;
    }
  }
  if (count >= 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


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


Fixed submission:

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

int main() {
  string s;
  int count;
  rep(i, 3) {
    if (s.at(i) == '7') {
      count++;
    }
  }
  if (count >= 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  char s[3];
  int i;
  for (i = 0; i < 3; i++) {
    cin >> s[i];
  }

  for (i = 0; i < 3; i++) {
    if (s[i] == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}


Error: 1

Fixed submission:

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

int main() {
  char s[3];
  int i;
  for (i = 0; i < 3; i++) {
    cin >> s[i];
  }

  for (i = 0; i < 3; i++) {
    if (s[i] == '7') {
      cout << "Yes" << endl;
      exit(1);
    }
  }
  cout << "No" << endl;

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

#include <stdio.h>

int main() {
  int num;
  scanf("%d", &num);
  if (num % 10 == 7 || (num / 10) % 10 == 7 || (num / 100) % 10 == 7) {
    printf("Yes\\n");
  } else {
    printf("No\\n");
  }
  return 0;
}


Error: -6
*** stack smashing detected ***: terminated


Fixed submission:

#include <stdio.h>
#include <string.h>

int main() {
  int i, j, k, cnt;

  char a[3];

  scanf("%c%c%c%c", &a[0], &a[1], &a[2], &a[3]);

  cnt = 0;

  for (i = 0; i <= 2; i++) {
    if (a[i] == '7') {
      cnt++;
    }
  }

  if (cnt > 0) {
    printf("Yes\\n");
  }

  else {
    printf("No\\n");
  }
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

// In the name of GOD

#include <bits/stdc++.h>
#define ll long long
#define pp pair<int, int>
using namespace std;
const int N = 1e5 + 10;
string s;
int n;

void solve() {
  cin >> n;
  while (n > 0) {
    if (n % 10 == 7) {
      cout << "Yes";
      return;
    }
    n /= 10;
  }
  cout << "No";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = 1;
  // cin >> tt;
  for (int tc = 1; tc <= tt; ++tc) {
    solve();
  }
}

Error: TLE

Fixed submission:

// In the name of GOD

#include <bits/stdc++.h>
#define ll long long
#define pp pair<int, int>
using namespace std;
const int N = 1e5 + 10;
string s;
int n;

void solve() {
  cin >> n;
  while (n > 0) {
    if (n % 10 == 7) {
      cout << "Yes";
      return;
    }
  }
  cout << "No";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = 1;
  // cin >> tt;
  for (int tc = 1; tc <= tt; ++tc) {
    solve();
  }
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

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

#define ll long long
#define MOD 1000000007

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

  int n;
  cin >> n;
  int r;
  while (n > 0) {
    r = n % 10;
    if (r == 7) {
      break;
    }
    n /= 10;
  }
  if (n)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Error: TLE

Fixed submission:

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

#define ll long long
#define MOD 1000000007

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

  int n;
  cin >> n;
  int r;
  while (n > 0) {
    r = n % 10;
    if (r == 7) {
      break;
    }
  }
  if (n)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

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

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

int main() {
  string N;
  cin >> N;
  if (N.at(0) == '7') {
    cout << "Yes" << endl;
  } else if (N.at(1) == '7') {
    cout << "Yes" << endl;
  } else if (N.at(2) == '7') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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


Fixed submission:

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

int main() {
  string N;
  if (N.at(0) == 7) {
    cout << "Yes" << endl;
  } else if (N.at(1) == 7) {
    cout << "Yes" << endl;
  } else if (N.at(2) == 7) {
    cout << "Yes" << endl;
  } else {
    cout << 0 << endl;
  }
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;

  while (n > 0) {
    int d = n % 10;
    if (d == 7) {
      cout << "Yes\\n";
      return 0;
    }
    n = n / 10;
  }
  cout << "No\\n";
  return 0;
}

Error: 1

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;

  while (n > 0) {
    int d = n % 10;
    if (d == 7) {
      return true;
    }
    n = n / 10;
  }
  return false;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int n, a;
  cin >> n;
  for (int i = 0; i < 3; i++) {
    a = n % 10;
    if (a == 7) {
      cout << "Yes";
      return 0;
    }
    n /= 10;
  }
  cout << "No";
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int n, a;
  cin >> n;
  while (n != 0) {
    a = n % 10;
    if (a == 7) {
      cout << "Yes";
      return 0;
    }
    a /= 10;
  }
  cout << "No";
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

/*

Coded and Decoded by : Yash Kapoor

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

#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair
#define pll pair<ll, ll>
#define vl vector<ll>
#define sl set<ll>
#define vll vector<pll>
#define ml map<ll, ll>
#define mll map<pll, ll>
#define all(a) a.begin(), a.end()
#define x first
#define y second
#define sz(x) (ll) x.size()
#define dl '\\n'
// #define why         (ll)1000000007
#define why (ll)998244353
#define lp(i, a, b) for (ll i = a; i < b; ++i)
#define lpr(i, a, b) for (ll i = a; i >= b; i--)
#define lpd(i, x) for (auto i : x)
#define ios                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
ll inf = 1e18;
ld pi = 3.141592653589;
ll mod = why;
ll fast_power(ll base, ll power, ll mod) {
  ll result = 1;
  while (power) {
    if (power % 2)
      result = (result * base) % mod;
    base = (base * base) % mod;
    power /= 2;
  }
  return result;
}

ll inverse(ll base, ll mod) { return fast_power(base, mod - 2, mod); }

ll solve() {
  string a;
  cin >> a;
  lp(i, 0, sz(a)) if (a[i] == '7') {
    cout << "Yes";
    return 0;
  }
  cout << "No";
  return 0;
}

int main() {
  ios ll t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
}


Error: WA

Fixed submission:

/*

Coded and Decoded by : Yash Kapoor

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

#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair
#define pll pair<ll, ll>
#define vl vector<ll>
#define sl set<ll>
#define vll vector<pll>
#define ml map<ll, ll>
#define mll map<pll, ll>
#define all(a) a.begin(), a.end()
#define x first
#define y second
#define sz(x) (ll) x.size()
#define dl '\\n'
// #define why         (ll)1000000007
#define why (ll)998244353
#define lp(i, a, b) for (ll i = a; i < b; ++i)
#define lpr(i, a, b) for (ll i = a; i >= b; i--)
#define lpd(i, x) for (auto i : x)
#define ios                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
ll inf = 1e18;
ld pi = 3.141592653589;
ll mod = why;
ll fast_power(ll base, ll power, ll mod) {
  ll result = 1;
  while (power) {
    if (power % 2)
      result = (result * base) % mod;
    base = (base * base) % mod;
    power /= 2;
  }
  return result;
}

ll inverse(ll base, ll mod) { return fast_power(base, mod - 2, mod); }

ll solve() {
  string a;
  cin >> a;
  lp(i, 0, sz(a)) if (a[i] == '7') {
    cout << "Yes";
    return 0;
  }
  cout << "No";
}

int main() {
  ios ll t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

/// Bismillahir Rahmanir Rahim

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f0(n) for (int i = 0; i < n; i++)
#define ms(x) memset(x, 0, sizeof(x))
#define ins insert
#define ALL(v) v.begin(), v.end()
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(), v.end())
#define maxv(v) *max_element(v.begin(), v.end())
#define PI acos(-1)
#define IOS ios::sync_with_stdio(false);
using namespace std;
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
const long long MOD = 1000000007;
template <typename T> inline T Bigmod(T base, T power, T MOD) {
  T ret = 1;
  while (power) {
    if (power & 1)
      ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}

bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int main() {
  IOS int n;
  cin >> n;
  while (n > 1) {
    if (n % 10 == 7) {
      cout << "Yes\\n";
      return 0;
    }
    n /= 10;
  }
  cout << "No\\n";
  return 0;
}
/// Alhamdulillah


Error: TLE

Fixed submission:

/// Bismillahir Rahmanir Rahim

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f0(n) for (int i = 0; i < n; i++)
#define ms(x) memset(x, 0, sizeof(x))
#define ins insert
#define ALL(v) v.begin(), v.end()
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(), v.end())
#define maxv(v) *max_element(v.begin(), v.end())
#define PI acos(-1)
#define IOS ios::sync_with_stdio(false);
using namespace std;
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
const long long MOD = 1000000007;
template <typename T> inline T Bigmod(T base, T power, T MOD) {
  T ret = 1;
  while (power) {
    if (power & 1)
      ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}

bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int main() {
  IOS int n;
  cin >> n;
  while (n > 1) {
    if (n % 10 == 7) {
      cout << "Yes\\n";
      return 0;
    }
  }
  cout << "No\\n";
  return 0;
}
/// Alhamdulillah
Problem p02711 (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() {
  char n[3];
  cin >> n;
  if (n[0] == '7' || n[1] == '7' || n[2] == '7')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}


Error: -6
*** stack smashing detected ***: terminated


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() {
  char n[2];
  cin >> n;
  if (n[0] == '7' || n[1] == '7' || n[2] == '7')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int n;
  cin >> n;
  while (n) {
    if (n % 10 == 7) {
      cout << "Yes" << endl;
      return 0;
    }
    n /= 10;
  }
  cout << "No" << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  int n;
  cin >> n;
  while (n) {
    if (n % 10 == 7) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int main() {
  int N;
  std::string str;
  cin >> N;

  str = std::to_string(N);
  if (str[0] == '7' || str[1] == '7' || str[2] == '7')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Error: -11

Fixed submission:

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int main() {
  int N;
  char *numStr;
  cin >> N;

  sprintf(numStr, "%d", N);

  if (numStr[0] == '7' || numStr[1] == '7' || numStr[2] == '7')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, f = 0;
  cin >> n;
  while (n != 0) {
    x = n % 10;
    n = n / 10;
    if (x == 7) {
      f = 1;
    }
  }
  if (f == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, f = 0;
  cin >> n;
  while (n != 0) {
    x = n % 10;
    if (x == 7) {
      f == 1;
    }
  }
  if (f == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cmath>
#include <cstring>
#include <map>
#include <math.h>
#include <set>
#include <string>

#define INF 1000000000000
#define MOD 1000000007 // 10^9+7:合同式の法

using namespace std;
typedef long long ll;

// マクロ
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)

int main() {
  string s;
  cin >> s;
  bool fla = false;

  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == '7')
      fla = true;
  }

  if (fla)
    cout << "Yes" << endl;
  else {
    cout << "No" << endl;
  }
}

Error: -6
*** stack smashing detected ***: terminated


Fixed submission:

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

int main() {
  char N[4];
  cin >> N[4];

  if (N[0] == '7' || N[1] == '7' || N[2] == '7')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a = n;
  while (n != 0) {
    int rem = n % 10;
    if (rem == 7) {
      cout << "Yes";
      return 0;
    }
    n = n / 10;
  }
  cout << "No";
  return 0;
}

Error: 1

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int flag = 0;
  while (n != 0) {
    int rem = n % 10;
    if (rem == 7) {
      cout << "Yes";
      flag = 1;
      exit(1);
    }
    n = n / 10;
  }
  if (flag == 0)
    cout << "No";
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i;
  bool p = true;
  while (p) {
    if (n % 10 == 7) {
      cout << "Yes";
      p = false;
    }
    n = n / 10;
    if (n == 0)
      break;
  }
  if (p)
    cout << "No";
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i;
  bool p = true;
  while (p) {
    if (n % 10 == 7) {
      cout << "Yes";
      p = false;
    }
    n = n / 10;
  }
  if (p)
    cout << "No";
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded


// Problem : A - Lucky 7
// Contest : AtCoder Beginner Contest 162
// URL : https://atcoder.jp/contests/abc162/tasks/abc162_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>

using namespace std;

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

  while (n != 0) {
    if (n % 10 == 7) {
      cout << "Yes" << endl;
      return 0;
    }
    n = n / 10;
  }
  cout << "No" << endl;
  return 0;
}


Error: TLE

Fixed submission:


// Problem : A - Lucky 7
// Contest : AtCoder Beginner Contest 162
// URL : https://atcoder.jp/contests/abc162/tasks/abc162_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>

using namespace std;

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

  while (n != 0) {
    if (n % 10 == 7) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main(void) {
  int N;
  cin >> N;
  while (N) {
    int x = N % 10;
    if (x == 7) {
      cout << "Yes" << endl;
      return 0;
    }
    N /= 10;
  }
  cout << "No" << endl;
}

Error: TLE

Fixed submission:

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

int main(void) {
  int N;
  cin >> N;
  while (true) {
    int x = N % 10;
    if (x == 7) {
      cout << "Yes" << endl;
      return 0;
    }
    if (N / 10)
      N /= 10;
  }
  cout << "No" << endl;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  string N;
  cin >> N;
  if (N[0] == '7' || N[1] == '7' || N[2] == '7') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Error: 0

Fixed submission:

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

int main() {
  string N;
  cin >> N;

  if (N.at(1) == '7' || N.at(2) == '7' || N.at(3) == '7') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define ll long long
using namespace std;
void isN(int n) {
  while (n) {
    if (n % 10 == 7) {
      cout << "Yes\\n";
      return;
    }
    n /= 10;
  }
  cout << "No\\n";
  return;
}
int main() {
  int T;
  cin >> T;
  isN(T);
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define ll long long
using namespace std;
void isN(int n) {
  while (n) {
    if (n % 10 == 7) {
      cout << "Yes\\n";
      return;
    }
  }
  cout << "No\\n";
  return;
}
int main() {
  int T;
  cin >> T;
  isN(T);
  return 0;
}
Problem p02711 (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() {
  string n;
  cin >> n;

  rep(i, 3) {
    if (n.at(i) == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

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


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() {
  string n;
  rep(i, 3) {
    cin >> n[i];
    if (n.at(i) == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

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

void digit(int n, int k) {
  if (n < 0)
    n = -1 * n;

  if (n % 10 == k) {
    cout << "Yes\\n";
    return;
  } else if (n / 10 > 0)
    digit(n / 10, k);
  else
    cout << "No" << endl;
}

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

  digit(n, 7);
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int digit(int n, int k) {
  if (n < 0)
    n = -1 * n;
  if (n / 10 > 0) {
    digit(n / 10, k);
  }

  if (n % 10 == k)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
}
int main() {
  int n;
  scanf("%d", &n);
  digit(n, 7);
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {

  int n;
  cin >> n;
  int a, b, c;

  a = n / 100;
  b = n / 10 - a * 10;

  c = n % 10;

  if (a == 7 || b == 7 || c == 7) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;

  return 0;
}


Error: -6
*** stack smashing detected ***: terminated


Fixed submission:

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {

  char n[3];
  for (int i = 1; i < 4; i++) {
    cin >> n[i];
    if (n[i] == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;

const ll INF = 1000000009;

void solve() {
  int n;
  cin >> n;
  while (n) {
    if (n % 10 == 7) {
      cout << "Yes\\n";
      return;
    }
    n /= 10;
  }
  cout << "No\\n";
}

int main() {
#ifndef LOCAL
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
#endif
  // int t;cin >> t;while(t--) solve();
  solve();
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;

const ll INF = 1000000009;

void solve() {
  int n;
  cin >> n;
  while (n) {
    if (n % 10 == 7) {
      cout << "Yes\\n";
      return;
    }
  }
  cout << "No\\n";
}

int main() {
#ifndef LOCAL
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
#endif
  // int t;cin >> t;while(t--) solve();
  solve();
}