prithivMLmods/Coder-Stat huggingface dataset:
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
const intll INF = 100000000000000000;
const int MOD = 1e9 + 7;

int main() {
  string s;
  cin >> s;
  string t = "YAKI";
  rep(i, 4) {
    if (s.at(i) != t.at(i)) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}


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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
const intll INF = 100000000000000000;
const int MOD = 1e9 + 7;

int main() {
  string s;
  cin >> s;
  string t = "YAKI";

  if (s.size() < 4) {
    cout << "No" << endl;
    return 0;
  }
  rep(i, 4) {
    if (s.at(i) != t.at(i)) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void) {
  string s;
  cin >> s;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void) {
  string s;
  cin >> s;
  if (s.length() < 4) {
    cout << "No" << endl;
    return 0;
  }
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S;
  if (S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' && S.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string S;
  cin >> S;
  if (S.size() < 4) {
    cout << "No" << endl;
  } else if (S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' &&
             S.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define INF 2147483647
#define SYOU(x) setprecision(x)
using namespace std;
long long i[300000];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a, b, c, d = 0, e = 0;
  cin >> a >> b >> c;
  for (int n = 0; n < c; n++)
    cin >> i[n];
  i[c] = 0, i[c + 1] = a + 1;
  sort(i, i + c + 2);
  for (int n = 0; n <= c; n++) {
    e = i[n + 1] - i[n] - 1;
    d += e - e / b;
  }
  cout << d << '\n';
  return (0);
}


Fixed submission:
#include <bits/stdc++.h>
#define INF 2147483647
#define SYOU(x) setprecision(x)
using namespace std;
long long i[300000];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a, b, c, d = 0, e = 0;
  string s;
  cin >> s;
  if (s[0] == 'Y' && s[1] == 'A' && s[2] == 'K' && s[3] == 'I')
    cout << "Yes\n";
  else
    cout << "No\n";
  return (0);
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string S, t = "YAKI";
  cin >> S;

  bool ans = true;
  for (int i = 0; i < 4; i++) {
    if (S.at(i) != t.at(i)) {
      ans = false;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string S, t = "YAKI";
  cin >> S;

  bool ans = true;
  if (S.size() < 4) {
    ans = false;
  } else {
    for (int i = 0; i < 4; i++) {
      if (S.at(i) != t.at(i)) {
        ans = false;
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

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

  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  string s;
  cin >> s;
  if (s.size() < 4)
    cout << "No" << endl;
  else if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


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

int main() {
  string s;
  cin >> s;
  if (s.size() >= 4 && s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' &&
      s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  if (S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' && S.at(3) == 'I') {
    cout << "Yes";
  } else {
    cout << "No";
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  if (S.size() > 3) {
    if (S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' && S.at(3) == 'I') {
      cout << "Yes";
    } else {
      cout << "No";
    }
  } else {
    cout << "No";
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int)x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9 + 7;
const ll INF = 2e18;
template <class T> void print(const T &t) { cout << t << endl; }
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;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

int main() {
  string s;
  cin >> s;
  s.erase(4);
  if (s == "YAKI") {
    print("Yes");
  } else {
    print("No");
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int)x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9 + 7;
const ll INF = 2e18;
template <class T> void print(const T &t) { cout << t << endl; }
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;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

int main() {
  string s;
  cin >> s;
  if (sz(s) < 4) {
    print("No");
    return 0;
  }
  s.erase(4);
  if (s == "YAKI") {
    print("Yes");
  } else {
    print("No");
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.length() <= 3)
    cout << "No" << endl;
  else if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  if (S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' && S.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  if (S.size() >= 4 && S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' &&
      S.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.size() < 4)
    cout << "No" << endl;
  else if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define MOD 1000000007

typedef long long ll;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  bool a = true;
  if (s.length() < 4)
    a = false;
  if (s.at(0) != 'Y' || s.at(1) != 'A' || s.at(2) != 'k' || s.at(3) != 'I')
    a = false;
  if (a)
    cout << "Yes";
  else
    cout << "No";
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define MOD 1000000007

typedef long long ll;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  bool a = true;
  if (s.length() < 4)
    a = false;
  else {
    if (s.at(0) != 'Y')
      a = false;
    if (s.at(1) != 'A')
      a = false;
    if (s.at(2) != 'K')
      a = false;
    if (s.at(3) != 'I')
      a = false;
  }
  if (a)
    cout << "Yes";
  else
    cout << "No";
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  string A;
  cin >> A;

  int size = A.size();
  if (size < 3) {
    cout << "No" << endl;
  } else if ((A.at(0) == 'Y' && A.at(1) == 'A') &&
             (A.at(2) == 'K' && A.at(3) == 'I')) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  string A;
  cin >> A;

  int size = A.size();
  if (size < 4) {
    cout << "No" << endl;
  } else if ((A.at(0) == 'Y' && A.at(1) == 'A') &&
             (A.at(2) == 'K' && A.at(3) == 'I')) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string a;
  cin >> a;
  if (a.at(0) == 'Y' && a.at(1) == 'A' && a.at(2) == 'K' && a.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


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

int main() {
  string a;
  cin >> a;
  if (a.size() < 4) {
    cout << "No" << endl;
    return 0;
  }
  if (a.at(0) == 'Y' && a.at(1) == 'A' && a.at(2) == 'K' && a.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <ostream>
using namespace std;
template <typename T> void printRange(T &x) {
  for (auto y : x)
    cout << y << ' ';
  cout << endl;
}
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define getNum(i) scanf("%d", &(i))
#define MODULO 321555123
#define INF 10000000007ll
#define FOR(i, j, k) for (int(i) = (j); (i) <= (k); (i)++)
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define getNum(i) scanf("%d", &(i))
#define mp make_pair
#define reset(a) memset((a), 0, sizeof((a)))

const int maxn = 2e5 + 10;

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.in", "r", stdin);
#endif
  IOS string s;
  cin >> s;
  if (s.length() > 3) {
    s = s.substr(0, 4);
    if (s == "YAKI") {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#include <ostream>
using namespace std;
template <typename T> void printRange(T &x) {
  for (auto y : x)
    cout << y << ' ';
  cout << endl;
}
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define getNum(i) scanf("%d", &(i))
#define MODULO 321555123
#define INF 10000000007ll
#define FOR(i, j, k) for (int(i) = (j); (i) <= (k); (i)++)
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define getNum(i) scanf("%d", &(i))
#define mp make_pair
#define reset(a) memset((a), 0, sizeof((a)))

const int maxn = 2e5 + 10;

int main() {
  IOS string s;
  cin >> s;
  if (s.length() > 3) {
    s = s.substr(0, 4);
    if (s == "YAKI") {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP2(i, x, n) for (int i = x; i < (n); i++)
int main() {
  string s;
  cin >> s;

  string ans = "Yes";
  if (s.size() < 4)
    ans = "No";
  if (s.substr(4) != "YAKI")
    ans = "No";
  cout << ans << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP2(i, x, n) for (int i = x; i < (n); i++)
int main() {
  string s;
  cin >> s;

  string ans = "Yes";
  if (s.size() < 4)
    ans = "No";
  else if (s.substr(0, 4) != "YAKI")
    ans = "No";
  cout << ans << endl;

  return 0;
}
Problem p03591 (Python)

Buggy submission (status: Runtime Error):
inn = input()
ans = "No"
if inn[0] == "Y" and inn[1] == "A" and inn[2] == "K" and inn[3] == "I":
    ans = "Yes"
print(ans)


Fixed submission:
inn = input()
ans = "No"
try:
    if inn[0] == "Y" and inn[1] == "A" and inn[2] == "K" and inn[3] == "I":
        ans = "Yes"
except:
    pass
print(ans)
Problem p03591 (Python)

Buggy submission (status: Runtime Error):
import sys
import socket

hostname = socket.gethostname()

if hostname == "F451C":
    sys.stdin = open("a1.in")


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    s = read_str()
    if s[0] == "Y" and s[1] == "A" and s[2] == "K" and s[3] == "I":
        print("Yes")
    else:
        print("No")


main()


Fixed submission:
import sys
import socket

hostname = socket.gethostname()

if hostname == "F451C":
    sys.stdin = open("a1.in")


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    s = read_str()
    if s[0:4] == "YAKI":
        print("Yes")
    else:
        print("No")


main()
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define mem(a, b) memset(a, b, sizeof(a))
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, s, e) for (int i = s; i < (e); i++)
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = 999999999;
const double PI = acos(-1.0);

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

  string S;
  cin >> S;
  cout << (S.substr(4) == "YAKI" ? "Yes" : "No") << "\n";
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define mem(a, b) memset(a, b, sizeof(a))
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, s, e) for (int i = s; i < (e); i++)
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = 999999999;
const double PI = acos(-1.0);

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

  string s;
  cin >> s;
  cout << (s.find("YAKI") == 0 ? "Yes" : "No") << "\n";
  return 0;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  if (str.at(0) == 'Y' && str.at(1) == 'A' && str.at(2) == 'K' &&
      str.at(3) == 'I' && str.size() >= 4) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  if (str.size() >= 4) {
    if (str.at(0) == 'Y' && str.at(1) == 'A' && str.at(2) == 'K' &&
        str.at(3) == 'I') {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  cout << (S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' && S.at(3) == 'I'
               ? "Yes"
               : "No")
       << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  cout << (S.size() >= 4 && S.at(0) == 'Y' && S.at(1) == 'A' &&
                   S.at(2) == 'K' && S.at(3) == 'I'
               ? "Yes"
               : "No")
       << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string s;
  cin >> s;
  if (s.size() >= 4) {
    if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I') {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  int count = 0;
  string a = "YAKI";
  for (int i = 0; i < 4; i++) {
    if (s.at(i) == a.at(i))
      count++;
  }
  if (count == 4)
    cout << "Yes";
  else
    cout << "No";
}

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

int main() {
  string s;
  cin >> s;
  int count = 0;
  string a = "YAKIaaaaaa";
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == a.at(i))
      count++;
  }
  if (count == 4)
    cout << "Yes";
  else
    cout << "No";
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
// #include <iomanip>
#include <string>
// #include <vector>
// #include <algorithm>
// #include <utility>
// #include <set>
// #include <map>
// #include <queue>
// #include <bitset>
// #include <math.h>
using namespace std;
// using ll = long long ;
// using ld = long double ;
// using vll = vector<ll> ;
// using vvll = vector<vll> ;
// using vc = vector<char> ;
// using vvc = vector<vc> ;
// using vb = vector<bool> ;
// using vvb = vector<vb> ;
// using pll = pair<ll,ll> ;

// ll mod = 1000000007 ;
// long double pie = acos(-1) ;

string yorn(bool a) {
  if (a)
    return "Yes";
  return "No";
}
// string YorN(bool a){if(a) return"YES" ; return "NO" ;}
// ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
// ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
// ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
// void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
// void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}

int main() {
  string s;
  cin >> s;
  cout << yorn(s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' &&
               s.at(3) == 'I')
       << endl;
}


Fixed submission:
#include <iostream>
// #include <iomanip>
#include <string>
// #include <vector>
// #include <algorithm>
// #include <utility>
// #include <set>
// #include <map>
// #include <queue>
// #include <bitset>
// #include <math.h>
using namespace std;
// using ll = long long ;
// using ld = long double ;
// using vll = vector<ll> ;
// using vvll = vector<vll> ;
// using vc = vector<char> ;
// using vvc = vector<vc> ;
// using vb = vector<bool> ;
// using vvb = vector<vb> ;
// using pll = pair<ll,ll> ;

// ll mod = 1000000007 ;
// long double pie = acos(-1) ;

string yorn(bool a) {
  if (a)
    return "Yes";
  return "No";
}
// string YorN(bool a){if(a) return"YES" ; return "NO" ;}
// ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
// ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
// ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
// void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
// void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}

int main() {
  string s;
  cin >> s;
  cout << yorn(s.size() >= 4 && s.at(0) == 'Y' && s.at(1) == 'A' &&
               s.at(2) == 'K' && s.at(3) == 'I')
       << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  string s;
  cin >> s;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Fixed submission:
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  string s;
  cin >> s;
  if (s.size() >= 4 &&
      (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string str;
  cin >> str;
  string ans = "No";
  if (str.at(0) == 'Y') {
    if (str.at(1) == 'A') {
      if (str.at(2) == 'K') {
        if (str.at(3) == 'I') {
          ans = "Yes";
        }
      }
    }
  }
  cout << ans << endl;
}

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

int main() {
  string str;
  cin >> str;
  string ans = "No";
  if (str.size() >= 4) {
    if (str.at(0) == 'Y') {
      if (str.at(1) == 'A') {
        if (str.at(2) == 'K') {
          if (str.at(3) == 'I') {
            ans = "Yes";
          }
        }
      }
    }
  }
  cout << ans << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

int main() {
  string s;
  cin >> s;
  if (s.size() < 4)
    cout << "No" << endl;
  else if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define ll long long int
#define vi vector<int>
#define vii vector<vector<int>>
#define PI 3.1415926535897932384626433832795

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  bool is = false;
  if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' && s.at(3) == 'I') {
    is = true;
  }
  cout << (is ? "Yes" : "No");
  return 0;
}


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

#define MOD 1000000007
#define ll long long int
#define vi vector<int>
#define vii vector<vector<int>>
#define PI 3.1415926535897932384626433832795

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  bool is = false;
  if (s.size() >= 4 && s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' &&
      s.at(3) == 'I') {
    is = true;
  }
  cout << (is ? "Yes" : "No");
  return 0;
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod = 1000000007;
const int MAX_N = 1000; // n の最大値

// nCk を取得
double nCk(int n, int k) {
  double res = 1.0;
  for (int i = 0; i < n; i++) {
    res *= 0.5;
  }
  for (int i = 0; i < k; i++) {
    res *= (double)(n - i);
    res /= (double)(k - i);
  }
  return res;
}

int main() {
  int k, t;
  string s;
  cin >> s;
  k = s.size();
  if (k < 3) {
    cout << "No" << endl;
  } else if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' &&
             s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod = 1000000007;
const int MAX_N = 1000; // n の最大値

// nCk を取得
double nCk(int n, int k) {
  double res = 1.0;
  for (int i = 0; i < n; i++) {
    res *= 0.5;
  }
  for (int i = 0; i < k; i++) {
    res *= (double)(n - i);
    res /= (double)(k - i);
  }
  return res;
}

int main() {
  int k, t;
  string s;
  cin >> s;
  k = s.size();
  if (k <= 3) {
    cout << "No" << endl;
  } else if (s.at(0) == 'Y' && s.at(1) == 'A' && s.at(2) == 'K' &&
             s.at(3) == 'I') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p03591 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  if (S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' && S.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  if (S.size() > 3 && S.at(0) == 'Y' && S.at(1) == 'A' && S.at(2) == 'K' &&
      S.at(3) == 'I')
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long INF = 1LL << 60;

void YN(bool x) {
  if (x)
    cout << "Yes";
  else
    cout << "No";
  return;
}

int main() {
  int N, H, K;
  cin >> N >> H >> K;
  bool finish = false;
  for (int i = 1; i <= N; i++) {
    if (K - H < 0)
      continue;
    if (K - H * i < 0) {
      if (N - i > i)
        continue;
      else {
        if (H * i - K % (2 * i - N) == 0)
          finish = true;
      }
    } else if (K - H * i > 0) {
      if (N - i < i)
        continue;
      else {
        if (K - H * i % (N - 2 * i) == 0)
          finish = true;
      }
    } else
      finish = true;
  }
  YN(finish);
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long INF = 1LL << 60;

void YN(bool x) {
  if (x)
    cout << "Yes";
  else
    cout << "No";
  return;
}

int main() {
  int N, H, K;
  cin >> N >> H >> K;
  bool finish = false;
  for (int i = 0; i <= N; i++)
    for (int j = 0; j <= H; j++)
      if (i * H + j * N - 2 * i * j == K)
        finish = true;
  YN(finish);
}
Problem p03592 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()

template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

int main() {
  int N, M, K;
  cin >> N >> M >> K;

  REP(i, N + 1) {
    REP(j, M + 1) {
      auto open = (N * M) - ((i * M) + (j * N)) + (i * j) * 2;
      cerr << i << " " << j << " " << open << endl;
      if (K == open || ((N * M) - open) == K) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()

template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

int main() {
  int N, M, K;
  cin >> N >> M >> K;

  REP(i, N + 1) {
    REP(j, M + 1) {
      auto open = (N * M) - ((i * M) + (j * N)) + (i * j) * 2;
      if (K == open || ((N * M) - open) == K) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;

  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
using namespace std;

int main(int argc, char const *argv[]) {
  int n, m, k;
  cin >> n >> m >> k;
  vector<bool> v(n * m + 1, false);
  rep(i, n + 1) rep(j, m + 1) {
    v[(i * m + j * n - 2 * (i * j))] = true;
    cerr << i << " " << j << " " << (i * m + j * n - (i * j)) << endl;
  }
  if (v[k] == true) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
using namespace std;

int main(int argc, char const *argv[]) {
  int n, m, k;
  cin >> n >> m >> k;
  vector<bool> v(n * m + 1, false);
  rep(i, n + 1) rep(j, m + 1) { v[(i * m + j * n - 2 * (i * j))] = true; }
  if (v[k] == true) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

#define REP(type, i, a, b) for (type i = a; i < b; i++)
typedef long long ll;

using namespace std;

int main(void) {
  ll N, M, K;
  scanf("%lld %lld %lld", &N, &M, &K);
  int Tile = K / N;
  int Mod = K - Tile;
  if (Mod % (M - Tile))
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

#define REP(type, i, a, b) for (type i = a; i < b; i++)
typedef long long ll;

using namespace std;

int main(void) {
  int N, M, K;
  scanf("%d %d %d", &N, &M, &K);
  REP(int, i, 0, M + 1) {
    REP(int, j, 0, N + 1) {
      int BlackNum = (N - j) * i + (M - i) * j;
      if (K == BlackNum) {
        printf("Yes\n");
        return 0;
      }
    }
  }
  printf("No\n");
  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <vector>

using namespace std;

typedef long long int ll;
typedef std::numeric_limits<double> dbl;
const long long int LL_INF = 1LL << 60;

vector<string> split(const string &input, char delimiter) {
  stringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
    result.push_back(field);
  }
  return result;
}

// #define DEBUG

ll A, B, M, N, D, K, L, Q, W, H, T, X, Y, S;

bool field[1000][1000];

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

  for (int n = 0; n <= N; ++n) {
    for (int m = 0; m <= M; ++m) {
      ll cnt = 0;
      cnt += n * M;
      cnt += m * N;
      cnt -= 2 * n * m;
      // cnt -= (M-m) * (N-n);
      cerr << n << " " << m << " " << cnt << endl;
      if (cnt == K) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }

  cout << "No" << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <vector>

using namespace std;

typedef long long int ll;
typedef std::numeric_limits<double> dbl;
const long long int LL_INF = 1LL << 60;

vector<string> split(const string &input, char delimiter) {
  stringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
    result.push_back(field);
  }
  return result;
}

// #define DEBUG

ll A, B, M, N, D, K, L, Q, W, H, T, X, Y, S;

bool field[1000][1000];

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

  for (int n = 0; n <= N; ++n) {
    for (int m = 0; m <= M; ++m) {
      ll cnt = 0;
      cnt += n * M;
      cnt += m * N;
      cnt -= 2 * n * m;
      // cnt -= (M-m) * (N-n);
      // cerr << n << " " << m << " " << cnt << endl;
      if (cnt == K) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }

  cout << "No" << endl;

  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; i++)
#define rep3(i, n, m) for (ll i = n; i >= m; i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
const ll INF = 1e18;
inline void chmax(ll &a, ll b) { a = max(a, b); }
inline void chmin(ll &a, ll b) { a = min(a, b); }

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  bool ok = 0;
  if (n > m)
    swap(n, m);
  rep2(i, 0, n) {
    int x = k - n * m + m * i;
    if (x % (2 * i - n) == 0 && (x / (2 * i - n)) >= 0 &&
        (x / (2 * i - n)) <= m)
      ok = 1;
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Fixed submission:
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; i++)
#define rep3(i, n, m) for (ll i = n; i >= m; i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
const ll INF = 1e18;
inline void chmax(ll &a, ll b) { a = max(a, b); }
inline void chmin(ll &a, ll b) { a = min(a, b); }

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  bool ok = 0;
  if (n > m)
    swap(n, m);
  rep2(i, 0, n) {
    int x = k - n * m + m * i;
    if (2 * i - n == 0) {
      if (n * m - m * i == k)
        ok = 1;
    } else if (x % (2 * i - n) == 0 && (x / (2 * i - n)) >= 0 &&
               (x / (2 * i - n)) <= m)
      ok = 1;
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e9;
const long long int mod = 1e9 + 7;
typedef pair<ll, ll> pairs;
vector<pairs> p;

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

ll keta(ll N) {
  int tmp{};
  while (N > 0) {
    tmp += (N % 10);
    N /= 10;
  }
  N = tmp;
  return N;
}

vector<vector<ll>> combination(ll n, ll r) {
  vector<vector<ll>> v(n + 1, vector<ll>(n + 1, 0));
  for (ll i = 0; i < v.size(); ++i) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (ll i = 1; i < v.size(); ++i) {
    for (ll j = 0; j < i; ++j) {
      v[i][j] = (v[i - 1][j - 1] + v[i - 1][j]);
    }
  }
  return v;
}
// ------------------------------------

int main() {
  ll n, m, k;
  cin >> n >> m >> k;
  string ans = "No";
  if (n % k == 0 or m % k == 0) {
    ans = "Yes";
  } else {
    for (ll i = 0; i < n; ++i) {
      for (ll j = 0; j < m; ++j) {
        if (i * (n - j) + j * (m - i) == k) {
          ans = "Yes";
          break;
        }
      }
    }
  }
  cout << ans << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e9;
const long long int mod = 1e9 + 7;
typedef pair<ll, ll> pairs;
vector<pairs> p;

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

ll keta(ll N) {
  int tmp{};
  while (N > 0) {
    tmp += (N % 10);
    N /= 10;
  }
  N = tmp;
  return N;
}

vector<vector<ll>> combination(ll n, ll r) {
  vector<vector<ll>> v(n + 1, vector<ll>(n + 1, 0));
  for (ll i = 0; i < v.size(); ++i) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (ll i = 1; i < v.size(); ++i) {
    for (ll j = 0; j < i; ++j) {
      v[i][j] = (v[i - 1][j - 1] + v[i - 1][j]);
    }
  }
  return v;
}
// ------------------------------------

int main() {
  ll n, m, k;
  cin >> n >> m >> k;
  string ans = "No";
  for (ll i = 0; i <= n; ++i) {
    for (ll j = 0; j <= m; ++j) {
      if (i * (m - j) + j * (n - i) == k) {
        ans = "Yes";
        break;
      }
    }
  }
  cout << ans << endl;

  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll, ll> P;
typedef vector<P> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); ++i)
#define drep(i, a, b) for (ll i = (a); i >= (b); --i)
#define SIZE(a) ll((a).size())
#define out(a) cout << (a) << endl;
const ll inf = 1e9;
const int MAX = 510000;
const ll MOD = 998244353;

inline ll mod(ll a, ll m) { return (a % m + m) % m; }

int main() {
  ll n, m, k;
  cin >> n >> m >> k;
  rep(i, 0, m + 1) {
    ll sum = m * i;
    if (k == sum) {
      cout << "Yes" << endl;
      return 0;
    }
    ll tmp = n - 2 * i;
    if (abs(k - sum) % abs(tmp) == 0 && abs(k - sum) / abs(tmp) <= n &&
        (k - sum) * tmp >= 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


Fixed submission:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll, ll> P;
typedef vector<P> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); ++i)
#define drep(i, a, b) for (ll i = (a); i >= (b); --i)
#define SIZE(a) ll((a).size())
#define out(a) cout << (a) << endl;
const ll inf = 1e9;
const int MAX = 510000;
const ll MOD = 998244353;

inline ll mod(ll a, ll m) { return (a % m + m) % m; }

int main() {
  ll n, m, k;
  cin >> n >> m >> k;
  rep(i, 0, m + 1) {
    rep(j, 0, n + 1) {
      if (n * i + m * j - i * j * 2 == k) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define MOD 1000000007

using namespace std;

int main(void) {
  int n, m, k;
  bool flag = false;
  int *dp;
  int p = 1;

  cin >> n >> m >> k;

  dp = new int[(n + 1) * (m + 1)]();
  FOR(i, 0, n) {
    FOR(t, 0, m) {
      dp[p] = (m - t) * i + t * (n - i);
      p++;
    }
  }
  FOR(i, 0, p - 1) {
    if (dp[i] == k) {
      flag = true;
      break;
    }
  }

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

  delete[] dp;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define MOD 1000000007

using namespace std;

int main(void) {
  int n, m, k;
  bool flag = false;
  int *dp;
  int p = 1;

  cin >> n >> m >> k;

  dp = new int[(n + 2) * (m + 2)]();
  FOR(i, 0, n) {
    FOR(t, 0, m) {
      dp[p] = (m - t) * i + t * (n - i);
      p++;
    }
  }
  FOR(i, 0, p - 1) {
    if (dp[i] == k) {
      flag = true;
      break;
    }
  }

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

  delete[] dp;
  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define call(var) cout << #var << "=" << var << endl;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int, int>;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
template <class t, class u> void chmax(t &a, u b) {
  if (a < b)
    a = b;
}
template <class t, class u> void chmin(t &a, u b) {
  if (b < a)
    a = b;
}

int main() {
  int n, m, K;
  cin >> n >> m >> K;
  bool ok = false;
  for (int l = 0; K - n * l >= 0; l++) {
    int e = m - 2 * l;
    if (e < 0)
      break;
    if ((K - n * l) % (m - 2 * l) == 0) {
      ok = true;
      break;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define call(var) cout << #var << "=" << var << endl;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int, int>;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
template <class t, class u> void chmax(t &a, u b) {
  if (a < b)
    a = b;
}
template <class t, class u> void chmin(t &a, u b) {
  if (b < a)
    a = b;
}

int main() {
  int n, m, K;
  cin >> n >> m >> K;
  bool ok = false;
  for (int l = 0; l <= m; l++) {
    for (int k = 0; k <= n; k++) {
      if (k * m - 2 * k * l + n * l == K)
        ok = true;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
long long a, b, c;
int main() {
  cin >> a >> b >> c;
  if (a % c == 0 || b % c == 0 || abs(a - b) == 0) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
long long a, b, c;
int main() {
  cin >> a >> b >> c;
  for (int s = 0; s <= a; s++) {
    for (int v = 0; v <= b; v++) {
      if (c == s * b + v * a - 2 * s * v) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Time Limit Exceeded):

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

int main() {
#ifdef foo_
  freopen("foo", "rt", stdin);
#endif
  int n, m, k;
  while (cin >> n >> m >> k) {
    bool good = false;
    for (int i = 0; i < n; i++) {
      for (int j = 0; i < m; j++) {
        if (i * m + j * n - 2 * i * j == k)
          good = true;
      }
    }
    if (good)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}


Fixed submission:

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

int main() {
#ifdef foo_
  freopen("foo", "rt", stdin);
#endif
  int n, m, k;
  while (cin >> n >> m >> k) {
    bool good = false;
    for (int i = 0; i < n + 1; i++) {
      for (int j = 0; j < m + 1; j++) {
        if (i * m + j * n - 2 * i * j == k)
          good = true;
      }
    }
    if (good)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
Problem p03592 (C++)

Buggy submission (status: Runtime Error):
// Atcoder 2
#include <bits/stdc++.h>
using namespace std;

int INF = 0x3f3f3f3f;

int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  if (k % n == 0 || k % m == 0 || k % abs(m - n))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Fixed submission:
// Atcoder 2
#include <bits/stdc++.h>
using namespace std;

int INF = 0x3f3f3f3f;

int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      if ((i * m + j * n - 2 * i * j) == k) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}