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

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

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

  if (N % 10 == 7) {
    cout << "Yes" << endl;
    return 0;
  }
  N /= 10;
  if (N % 10 == 7) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N / 10 == 7) {
    cout << "Yes" << endl;
    return 0;
  }

  cout << "No" << endl;
  return 0;
}

Error: -8

Fixed submission:

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

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

  if (N %= 10 == 7) {
    cout << "Yes" << endl;
    return 0;
  }
  N /= 10;
  if (N %= 10 == 7) {
    cout << "Yes" << endl;
    return 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>
// using namespace std;

// const int N = 1000000000, MAXI = N, D = 14;

// int main() {
//     freopen("output.txt", "r", stdin);
//     freopen("input.txt", "w", stdout);
//     srand(time(nullptr));
//     int tc = 5, flag = 1;
//     cout << tc << "\\n";
//     while (tc--)
//     {
//         int a = rand()%N+1;
//         a *= flag;

//         flag *= -1;

//         int b = rand()%MAXI + 1, c;

//         int d = rand()%D + 1;

//         int flag2 = rand()%3, k;

//         if(flag2==0)
//         {
//         	k = rand()%d+1;
//         	c = a + k*b;
//         }
//         else if(flag2==1)
//         {
//         	k = rand()%d + 1;
//         	c = a - k*b;
//         }
//         else
//         	c = rand()%MAXI;

//         cout << a << " " << b << " " << c << " " << d;
//         cout << "\\n";
//         cout << "~\\n";
//     }

//     return 0;
// }

//---------------------------------------------//

/*
#define int long long
#define mod (int)(1e9+9)
#define endl '\\n'
#define MAXI (int)(3e17+10)
#define N 200005
 */

//  /* while(!cin.eof()) */

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod (int)(1e9 + 9)
#define endl '\\n'
#define MAXI (int)(3e17 + 10)
#define N 200005

// Driver code to test above functions
int32_t main() {

  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);

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

  cout << "No";

  return 0;
}

Error: TLE

Fixed submission:

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

// const int N = 1000000000, MAXI = N, D = 14;

// int main() {
//     freopen("output.txt", "r", stdin);
//     freopen("input.txt", "w", stdout);
//     srand(time(nullptr));
//     int tc = 5, flag = 1;
//     cout << tc << "\\n";
//     while (tc--)
//     {
//         int a = rand()%N+1;
//         a *= flag;

//         flag *= -1;

//         int b = rand()%MAXI + 1, c;

//         int d = rand()%D + 1;

//         int flag2 = rand()%3, k;

//         if(flag2==0)
//         {
//         	k = rand()%d+1;
//         	c = a + k*b;
//         }
//         else if(flag2==1)
//         {
//         	k = rand()%d + 1;
//         	c = a - k*b;
//         }
//         else
//         	c = rand()%MAXI;

//         cout << a << " " << b << " " << c << " " << d;
//         cout << "\\n";
//         cout << "~\\n";
//     }

//     return 0;
// }

//---------------------------------------------//

/*
#define int long long
#define mod (int)(1e9+9)
#define endl '\\n'
#define MAXI (int)(3e17+10)
#define N 200005
 */

//  /* while(!cin.eof()) */

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod (int)(1e9 + 9)
#define endl '\\n'
#define MAXI (int)(3e17 + 10)
#define N 200005

// Driver code to test above functions
int32_t main() {

  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);

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

  cout << "No";

  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(1) != '7' && n.at(2) != '7' && n.at(0) != '7') {
    cout << "No" << endl;
  } else {
    cout << "Yes" << 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 << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

bool is_present(int n) {
  while (n) {
    int d = n % 10;
    if (d == 7) {
      return true;
    }

    n /= 10;
  }
  return false;
}

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

  if (is_present(n)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  cout << "\\n";
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

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

  bool is_present = false;
  while (n) {
    int d = n % 10;
    if (d == 7) {
      is_present = true;
      break;
    }
    d /= 10;
  }

  if (is_present) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  cout << "\\n";
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int count = 0;

  if (n % 10 == 7)
    count++;
  n /= 10;
  if (n % 10 == 7)
    count++;
  n /= 10;
  if (n % 10 == 7)
    count++;

  if (count > 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Error: -8

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int count = 0;
  if (n %= 10 == 7)
    count++;
  if (n %= 10 == 7)
    count++;
  if (n %= 10 == 7)
    count++;

  if (count > 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

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

#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  string num;
  cin >> num;
  for (int i = 0; i < 3; ++i) {
    if (num[i] == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Error: 1

Fixed submission:

#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <string>
#include <vector>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  string num;
  cin >> num;
  for (int i = 0; i < 3; ++i) {
    if (num[i] == '7') {
      cout << "Yes" << endl;
      return 1;
    }
  }
  cout << "No" << endl;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#include <math.h>

#define PI 3.14159265358979323846264338327950L
#define ll long long

using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  while (n > 0) {
    int digit = n % 10;
    if (digit == 7) {
      cout << "Yes"
           << "\\n";
      return 0;
    }
    n = n / 10;
  }
  cout << "No"
       << "\\n";
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <math.h>

#define PI 3.14159265358979323846264338327950L
#define ll long long

using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  while (n > 0) {
    int digit = n % 10;
    if (digit == 7) {
      cout << "Yes"
           << "\\n";
      return 0;
    }
  }
  cout << "No"
       << "\\n";
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

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

Error: TLE

Fixed submission:

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

#include <bits/stdc++.h>
using namespace std;
#define Hello                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define endl '\\n'
int main() {
  Hello int n;
  cin >> n;
  while (n) {
    if (n % 10 == 7)
      return cout << "Yes", 0;
    n /= 10;
  }
  cout << "No";
  return 0;
}

Error: 1

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define Hello                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define endl '\\n'
int main() {
  Hello int n;
  cin >> n;
  while (n) {
    if (n % 10 == 7)
      return cout << "Yes", 01;
    n /= 10;
  }
  cout << "No";
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll, ll>>
#define pii pair<int, int>
#define REP(i, a) for (int(i) = 0; (i) < (a); (i)++)
#define RREP(i, a) for (int(i) = a - 1; (i) >= (0); (i)--)
#define REP2(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define m0(x) memset(x, 0, sizeof(x))
typedef long long ll;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  bool flg = false;
  while (N > 0) {
    if (N % 10 == 7)
      flg = true;
    N /= 10;
  }
  if (flg)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  bool flg = false;
  while (N > 0) {
    if (N % 10 == 7)
      flg = true;
    N %= 10;
  }
  if (flg)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

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

Error: TLE

Fixed submission:

// created_by  Rishi_Mohan

#include <bits/stdc++.h>

#define ll long long
#define db1(x) cout << #x << "=" << x << '\\n'
#define db2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << '\\n'
#define db3(x, y, z)                                                           \\
  cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z     \\
       << '\\n'
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, n) for (int i = a; i >= (n); --i)

using namespace std;

void solve() {
  int n;
  cin >> n;
  bool ok = 0;
  while (n > 0) {
    if (n % 10 == 7)
      ok = 1;
  }
  if (ok == 0)
    cout << "NO";
  else
    cout << "YES";
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <string>
using namespace std;

int main() {
  string s;
  cin >> s;
  int i;
  bool t = 0;
  for (i = 0; i < s.length(); i++) {

    if (s.at(i) == '7') {
      t = 1;
    }
  }
  if (t == 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Error: 1

Fixed submission:

#include <iostream>
#include <sstream>

using namespace std;

int main() {

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

  a = n - 700;
  if ((a >= 0) && (a <= 100)) {
    cout << "Yes" << endl;
    return 3;
  } else {
    b = n % 100;
    b = b - 70;
    if ((b >= 0) && (b <= 10)) {
      cout << "Yes" << endl;
      return 2;
    } else {
      c = n % 10;
      c = c - 7;
      if (c == 0) {
        cout << "Yes" << endl;
        return 1;
      } else {
        cout << "No" << endl;
      }
    }
  }

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

#include <iostream>
#include <sstream>

using namespace std;

int main() {
  int f = 0;
  int n;
  cin >> n;
  int a;
  a = n - 700;
  if (a >= 0) {
    if (a < 100) {
      f = 1;
    }
  }

  a = n % 100;
  a = a - 70;
  if (a >= 0) {
    if (a < 10) {
      f = 1;
    }
  }

  a = n % 10;
  a = a - 7;
  if (a == 0) {
    f = 1;
  }

  if (f == 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}


Error: 0

Fixed submission:

#include <iostream>
#include <sstream>

using namespace std;

int main() {

  int n;
  cin >> n;
  int a;
  a = n - 700;
  if (a >= 0) {
    if (a < 100) {
      cout << "Yes" << endl;
      return -1;
    }
  }

  a = n % 100;
  a = a - 70;
  if (a >= 0) {
    if (a < 10) {
      cout << "Yes" << endl;
      return -1;
    }
  }

  a = n % 10;
  a = a - 7;
  if (a == 0) {
    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;
#define ll long long int
int main() {
  int s;
  cin >> s;
  ll c = 0;
  while (s > 0) {
    if (s % 10 == 7) {
      c = 1;
      break;
    }
    s = s / 10;
  }
  if (c == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Error: TLE

Fixed submission:

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

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a) ? "Yes" : "No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INFLL = 1LL << 62;
const int INF = 1 << 30;
const double PI = acos(-1);
int main() {
  string n;
  int ans = 0;

  cin >> n;

  cout << solve(n[0] == '7' || n[1] == '7' || n[2] == '7') << endl;
}

Error: -11

Fixed submission:

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a) ? "Yes" : "No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INFLL = 1LL << 62;
const int INF = 1 << 30;
const double PI = acos(-1);
int main() {
  string n;
  int ans = 0;
  scanf("%s", &n);
  // cin >>n;

  cout << solve(n[0] == '7' || n[1] == '7' || n[2] == '7') << endl;
}
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)
      return cout << "Yes" << endl, 0;
    n /= 10;
  }
  return cout << "No" << endl, 0;
}

Error: TLE

Fixed submission:

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

int n;
bool ans;

int main() {
  cin >> n;
  while (n)
    ans |= (n % 10) == 7;
  cout << (ans ? "YES" : "NO") << "\\n";
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 4;
  char c[10];
  cin >> c;
  while (--i) {
    if (c[i - 1] == '7') {
      printf("Yes\\n");
      return 0;
    }
  }
  printf("No\\n");
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 2;
  char c[10];
  cin >> c;
  while (i > -1) {
    if (c[i] == '7') {
      printf("Yes\\n");
      return 0;
    }
  }
  printf("No\\n");
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  string s;
  bool ans = false;
  cin >> s;
  for (int i = 0; i < 3; i++) {
    if (s[i] == '7') {
      ans = true;
    }
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


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


Fixed submission:

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

int main() {
  char str1[2];
  cin >> str1[2];
  if (str1[0] == '7' || str1[1] == '7' || str1[2] == '7')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int num, check = 7, count, temp;
  while (cin >> num, num >= 100 && num < 1000) {
    count = 0;
    while (num > 0) {
      temp = num % 10;
      if (temp == check) {
        count++;
        if (count != 0) {
          cout << "Yes" << endl;
        }
        break;
      }
      num /= 10;
    }
    if (count == 0) {
      cout << "No" << endl;
      break;
    }
    break;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int num, check = 7, count, temp;
  while (cin >> num, num >= 100 && num < 1000) {
    count = 0;
    while (num > 0) {
      temp = num % 10;
      if (temp == check) {
        count++;
        if (count != 0) {
          cout << "Yes" << endl;
        }
        break;
      }
      num /= 10;
    }
    if (count == 0) {
      cout << "No" << endl;
      break;
    }
  }
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <set>
#include <string>
#include <vector>

using namespace std;

int main(void) {
  long long K, count = 0;
  cin >> K;
  while (K != 0) {
    if (K % 10 == 7) {
      cout << "Yes\\n";
      return 0;
    }
    K /= 10;
  }
  cout << "No\\n";
}

Error: TLE

Fixed submission:

#include <iostream>
#include <set>
#include <string>
#include <vector>

using namespace std;

int main(void) {
  long long K, count = 0;
  cin >> K;
  while (K != 0) {
    if (K % 10 == 7) {
      cout << "Yes\\n";
      return 0;
    }
    K %= 10;
  }
  cout << "No\\n";
}
Problem p02711 (C++) — buggy submission, verdict: Time Limit Exceeded

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
// #include<bits/stdc++.h>

using namespace std;

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

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

  cout << "No" << endl;

  return 0;
}

Error: TLE

Fixed submission:

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
// #include<bits/stdc++.h>

using namespace std;

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

  while (t) {
    if (t % 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 pb push_back
#define PI 3.1415926535897932
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define f(i, a, n) for (int i = a; i < n; i++)
using namespace std;
typedef vector<int> vi;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

int main() {

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

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

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define pb push_back
#define PI 3.1415926535897932
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define f(i, a, n) for (int i = a; i < n; i++)
using namespace std;
typedef vector<int> vi;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

int main() {

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

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

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

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int n;

void solve() {
  int d_1 = n % 10;
  int d_10 = (n - d_1) % 100 / 10;
  int d_100 = (n - d_1 - d_10) % 1000 / 100;
  if (d_1 == 7 || d_10 == 7 || d_100 == 7)
    cout << "Yes";
  else
    cout << "No";
}

int main() {
  cin >> n;

  solve();

  return EXIT_SUCCESS;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int n;

int solve() {
  int d_1 = n % 10;
  int d_10 = (n - d_1) % 100 / 10;
  int d_100 = (n - d_1 - d_10) % 1000 / 100;
  if (d_1 == 7 || d_10 == 7 || d_100 == 7)
    cout << "Yes";
  else
    cout << "No";
}

int main() {
  cin >> n;

  solve();

  return EXIT_SUCCESS;
}