prithivMLmods/Coder-Stat huggingface dataset:
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
S, T = list(input().split())
A, B = list(map(int, input().split()))
U = input()
dict = {}
dict[S] = A
dict[T] = B
dict[U] -= 1
print(f"{dict[S]} {dict[T]}")


Fixed submission:
S, T = list(input().split())
A, B = list(map(int, input().split()))
U = input()
dict = {}
dict[S] = A
dict[T] = B
dict[U] -= 1
print(dict[S], dict[T])
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
def solve():
    S, T, A, B, U = map(int, open(0).read().split())
    if S == U:
        print(A - 1, B)
    else:
        print(A, B - 1)


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    S, T = map(str, input().split())
    A, B = map(int, input().split())
    U = input()
    if S == U:
        print(A - 1, B)
    else:
        print(A, B - 1)


if __name__ == "__main__":
    solve()
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
S, T = [i for i in input().split()]
A, B = map(int, input().split())
U = input()
if U == S:
    A -= 1
elif U == T:
    B -= 1
print(f"{A} {B}")


Fixed submission:
S, T = [i for i in input().split()]
A, B = map(int, input().split())
U = input()
if U == S:
    A -= 1
elif U == T:
    B -= 1
print(str(A) + " " + str(B))
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
keys = input.split()
values = tuple(map(int, input().split()))

ball = dict(zip(keys, values))
u = input()

ball[u] -= 1
print(ball[keys[0]], ball[keys[1]])


Fixed submission:
keys = input().split()
values = tuple(map(int, input().split()))

ball = dict(zip(keys, values))
u = input()

ball[u] -= 1
print(ball[keys[0]], ball[keys[1]])
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    A -= 1
else:
    B -= 1

print(f"{A} {B}")


Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    A -= 1
else:
    B -= 1

print(A, B)
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
#! env/bin/local python3

s, t = input().split()
a, b = map(int, input().split())
u = input()

balls = {s: a, t: b}

balls[u] -= 1

print(f"{balls[s]} {balls[t]}")


Fixed submission:
#! env/bin/local python3

s, t = input().split()
a, b = map(int, input().split())
u = input()

balls = {s: a, t: b}

balls[u] -= 1

print("{} {}".format(balls[s], balls[t]))
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = A2 + " " + B2

print(output)


Fixed submission:
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = "{} {}".format(A2, B2)

print(output)
Problem p02777 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define int long long int
#define pb push_back
#define MAX INT_MAX
#define MIN INT_MIN
#define MOD 1000000007
#define FO                                                                     \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;
set<int> s;
bool ar[100001];
void seive() {
  ar[0] = ar[1] = true;

  for (int p = 2; p * p <= 100001; p++) {
    if (ar[p] == false) {
      for (int i = p * p; i <= 100001; i += p)
        ar[i] = true;
    }
  }

  for (int p = 2; p <= 100001; p++) {
    if (ar[p] == false)
      s.insert(p);
  }
}
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  vector<double> pre(n);
  vector<double> temp;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    pre[i] = ((v[i] * (v[i] + 1)) / 2.0) / double(v[i]);
    // cout << pre[i] << " ";
  }
  // cout << endl;
  double sum = 0.0;
  for (int i = 0; i < k; i++)
    sum += pre[i];
  temp.pb(sum);
  // for(double x : temp)
  // 	cout << x << " ";
  // cout << endl;
  int c = 0;
  double cursum = sum;
  for (int i = k; i < n; i++) {
    double x = cursum - pre[c] + pre[i];
    temp.pb(x);
    cursum = x;
    c++;
  }
  // for(double x : temp)
  // 	cout << x << " ";
  // cout << endl;

  double x = *max_element(temp.begin(), temp.end());
  cout << setprecision(10) << x << endl;
  return;
}
int32_t main() {
  FO;
  solve();
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define int long long int
#define pb push_back
#define MAX INT_MAX
#define MIN INT_MIN
#define MOD 1000000007
#define FO                                                                     \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;
set<int> s;
bool ar[100001];
void seive() {
  ar[0] = ar[1] = true;

  for (int p = 2; p * p <= 100001; p++) {
    if (ar[p] == false) {
      for (int i = p * p; i <= 100001; i += p)
        ar[i] = true;
    }
  }

  for (int p = 2; p <= 100001; p++) {
    if (ar[p] == false)
      s.insert(p);
  }
}
void solve() {
  string s, t;
  cin >> s >> t;
  int a, b;
  cin >> a >> b;
  string r;
  cin >> r;
  (r == s ? a : b)--;
  cout << a << ' ' << b << endl;
  return;
}
int32_t main() {
  FO;
  solve();
  return 0;
}
Problem p02777 (C++)

Buggy submission (status: Runtime Error):
#define _CRT_SECURE_NO_WARNINGS

#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

int t;

int main() {
  ios::sync_with_stdio(false);
  freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  string s, t, u;
  int a, b;
  while (cin >> s >> t) {
    cin >> a >> b;
    cin >> u;
    if (u == s)
      cout << a - 1 << " " << b << endl;
    else
      cout << a << " " << b - 1 << endl;
  }
  return 0;
}

Fixed submission:
#define _CRT_SECURE_NO_WARNINGS

#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

int t;

int main() {
  ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  string s, t, u;
  int a, b;
  while (cin >> s >> t) {
    cin >> a >> b;
    cin >> u;
    if (u == s)
      cout << a - 1 << " " << b << endl;
    else
      cout << a << " " << b - 1 << endl;
  }
  return 0;
}
Problem p02777 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <cstring>
#include <iostream>
using namespace std;
string s, t, x;
int a, b;
int main() {
  cin >> s >> t >> a >> b >> x;
  cout << (a - (x == s)) << ' ' << (b - (x == t));
  while (1)
    ;
  return 0;
}

Fixed submission:
#include <cstring>
#include <iostream>
using namespace std;
string s, t, x;
int a, b;
int main() {
  cin >> s >> t >> a >> b >> x;
  cout << (a - (x == s)) << ' ' << (b - (x == t)) << endl;
  return 0;
}
Problem p02777 (C++)

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

char str[3][MAX];

int streq() {
  int i = 0;
  while (str[0][i] || str[2][i]) {
    if (str[0][i] != str[2][i])
      return 0;
  }
  return 1;
}

int main(void) {
  int N, M;
  cin >> str[0] >> str[1] >> N >> M >> str[2];
  if (streq())
    cout << N - 1 << " " << M << endl;
  else
    cout << N << " " << M - 1 << endl;
  return 0;
}


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

char str[3][MAX];

int streq() {
  int i = 0;
  while (str[0][i] || str[2][i]) {
    if (str[0][i] != str[2][i])
      return 0;
    i++;
  }
  return 1;
}

int main(void) {
  int N, M;
  cin >> str[0] >> str[1] >> N >> M >> str[2];
  if (streq())
    cout << N - 1 << " " << M << endl;
  else
    cout << N << " " << M - 1 << endl;
  return 0;
}
Problem p02777 (C++)

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

void ioThings() {
  ios::sync_with_stdio(0);
  cin.tie(0);
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
  freopen("err.txt", "w", stderr);
#endif
}

using ll = long long;
#define debug(x) cerr << #x << ": <" << x << ">\n"
#define dotc()                                                                 \
  int tcs;                                                                     \
  if (cin >> tcs)                                                              \
    for (int tc = 0; tc < tcs; tc++)
#define sz(x) (int)x.size()
#define eb emplace_back
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define mod 1000000007

int main() {
  ioThings();

  string a, b;
  cin >> a >> b;
  int ca, cb;
  cin >> ca >> cb;
  string u;
  cin >> u;
  if (u == a)
    ca--;
  else
    cb--;
  cout << ca << ' ' << cb;

  return 0;
}


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

void ioThings() {
  ios::sync_with_stdio(0);
  cin.tie(0);
#ifdef LOCAL
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
  freopen("err.txt", "w", stderr);
#endif
}

using ll = long long;
#define debug(x) cerr << #x << ": <" << x << ">\n"
#define dotc()                                                                 \
  int tcs;                                                                     \
  if (cin >> tcs)                                                              \
    for (int tc = 0; tc < tcs; tc++)
#define sz(x) (int)x.size()
#define eb emplace_back
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define mod 1000000007

int main() {
  ioThings();

  string a, b;
  cin >> a >> b;
  int ca, cb;
  cin >> ca >> cb;
  string u;
  cin >> u;
  if (u == a)
    ca--;
  else
    cb--;
  cout << ca << ' ' << cb;

  return 0;
}
Problem p02777 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define endl "\n"
#define int long long
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repd(i, a, b) for (int i = a; i > b; i--)
#define vi vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define SET(A, VAL) memset(A, VAL, sizeof(A))
#define ff first
#define ss second
#define pb push_back
const int MAX = 1e6 + 8;
const int sz = 1e5 + 5;
void f_io() {
  IOS;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
#endif
}

int32_t main() {
  f_io();
  int t = 1;
  // cin>>t;
  while (t--) {
    string temp1, temp2;
    cin >> temp1 >> temp2;
    int a, b;
    cin >> a >> b;
    string temp3;
    cin >> temp3;
    if (temp3 == temp1)
      a--;
    else
      b--;
    cout << a << " " << b;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define endl "\n"
#define int long long
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repd(i, a, b) for (int i = a; i > b; i--)
#define vi vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define SET(A, VAL) memset(A, VAL, sizeof(A))
#define ff first
#define ss second
#define pb push_back
const int MAX = 1e6 + 8;
const int sz = 1e5 + 5;
void f_io() {
  IOS;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
#endif
}

int32_t main() {
  // f_io();
  int t = 1;
  // cin>>t;
  while (t--) {
    string temp1, temp2;
    cin >> temp1 >> temp2;
    int a, b;
    cin >> a >> b;
    string temp3;
    cin >> temp3;
    if (temp3 == temp1)
      a--;
    else
      b--;
    cout << a << " " << b;
  }
}
Problem p02777 (C++)

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

#define int long long
#define ll long long
#define f1(i, a, b) for (int i = a; i < b; i++)
#define f2(i, a, b) for (int i = a; i >= b; i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair

const int mod = 1000000007;
ll temp;

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

#ifndef ONLINE_JUDGE
  freopen("/home/akmittal/Desktop/Competitive Programming/in.txt", "r", stdin);
  freopen("/home/akmittal/Desktop/Competitive Programming/out.txt", "w",
          stdout);
#endif

  string s, t;
  cin >> s >> t;
  int a, b;
  cin >> a >> b;
  string y;
  cin >> y;
  if (y == s)
    a--;
  else
    b--;

  cout << a << gp << b << endl;

  return 0;
}

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

#define int long long
#define ll long long
#define f1(i, a, b) for (int i = a; i < b; i++)
#define f2(i, a, b) for (int i = a; i >= b; i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair

const int mod = 1000000007;
ll temp;

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

  // #ifndef ONLINE_JUDGE
  // 	freopen("/home/akmittal/Desktop/Competitive
  // Programming/in.txt","r",stdin); 	freopen("/home/akmittal/Desktop/Competitive
  // Programming/out.txt","w",stdout); #endif

  string s, t;
  cin >> s >> t;
  int a, b;
  cin >> a >> b;
  string y;
  cin >> y;
  if (y == s)
    a--;
  else
    b--;

  cout << a << gp << b << endl;

  return 0;
}
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = read().decode().split()
a, b = map(int, read().split())
u = read().decode()

if u == s:
    a -= 1
else:
    b -= 1

print(a, b)


Fixed submission:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = readline().decode("utf-8").split()
a, b = map(int, readline().split())
u = read().decode("utf-8").rstrip()

if u == s:
    a -= 1
else:
    b -= 1

print(a, b)
Problem p02777 (Python)

Buggy submission (status: Runtime Error):
S, T = input().split()
A, B = input().split()
U = input()

print(f"{int(A) - 1 if S == U else 0} {int(B) - 1 if T == U else 0}")


Fixed submission:
S, T = input().split()
A, B = input().split()
U = input()

print("{} {}".format(int(A) - (1 if S == U else 0), int(B) - (1 if T == U else 0)))
Problem p02778 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
#include <string>
using namespace std;

int main() {
  string S;
  cin >> S;
  int i = 0;
  while (1) {
    if (i == S.length()) {
      break;
    }
    S[i] = 'x';
  }
  cout << S << endl;
  return 0;
}


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

int main() {
  string S;
  cin >> S;
  int i = 0;
  while (1) {
    if (i == S.length()) {
      break;
    }
    S[i] = 'x';
    i++;
  }
  cout << S << endl;
  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Time Limit Exceeded):

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

void Main() {
  // input
  string S;
  cin >> S;

  // process

  // output
  for (int i = 0; S.length(); i++) {
    cout << "x";
  }
  cout << endl;
}

int main() {
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Fixed submission:

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

void Main() {
  // input
  string S;
  cin >> S;

  // process

  // output
  for (int i = 0; i < S.length(); i++) {
    cout << "x";
  }
  cout << endl;
}

int main() {
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define rep(i, a, b) for (int i = a; i <= b; i++)

int main() {

  ios::sync_with_stdio(0);
  cin.tie(0);

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    s[i] = 'x';
  }
  cout << s;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define rep(i, a, b) for (int i = a; i <= b; i++)

int main() {

  ios::sync_with_stdio(0);
  cin.tie(0);

  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    s[i] = 'x';
  }
  cout << s;

  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < 19; i++)
    s[i] = 'x';
  cout << s << endl;

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    cout << "x";
  }
  return 0;
}
Problem p02778 (C++)

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

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

  for (int i = 0; S.at(i) != '\0'; i++) {
    cout << 'x';
  }
  cout << endl;
  return 0;
}

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

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

  for (int i = 0; S.size() > i; i++) {
    cout << 'x';
  }
  cout << endl;
  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  char s1[10];
  cin >> s1;
  for (int i = 0; i < strlen(s1); i++) {
    s1[i] = 'x';
    cout << s1[i];
  }
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  char s1[101];
  cin >> s1;
  for (int i = 0; i < strlen(s1); i++) {
    s1[i] = 'x';
    cout << s1[i];
  }
  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  for (int i = 0; (int)s.size(); i++)
    cout << "x";
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  for (int i = 0; i < (int)s.size(); i++)
    cout << "x";
  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
char a[105];
int main() {
  cin >> a;
  int i;
  for (i = 0; i <= strlen(a); i++) {
    a[i] = 'x';
  }
  for (i = 0; i <= strlen(a); i++) {
    printf("%c", a[i]);
  }
  return 0;
}

Fixed submission:
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
char a[105];
int main() {
  cin >> a;
  int i;
  for (i = 0; i <= strlen(a) - 1; i++) {
    printf("x");
  }
  return 0;
}
Problem p02778 (C++)

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

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

  for (char x : str) {
    str.at(x) = x;
  }

  cout << str << endl;
}


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

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

  for (int i = 0; i < str.size(); i++) {
    str.at(i) = 'x';
  }

  cout << str << endl;
}
Problem p02778 (C++)

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

int main() {
  string s, n;
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    n.at(i) = 'x';
  cout << n << endl;
}

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

int main() {
  string s, n;
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    n += 'x';
  cout << n << endl;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
#include <string.h>
int main(void) {
  // Your code here!
  char s[20], t[20], u[20];
  int a, b;

  scanf("%s", s);

  int x = strlen(s);
  while (x-- > 0)
    printf("x");
  printf("\n");
}


Fixed submission:
#include <stdio.h>
#include <string.h>
int main(void) {
  // Your code here!
  char s[100];

  scanf("%s", s);

  int x = strlen(s);
  while (x-- > 0)
    printf("x");
  printf("\n");
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
#include <string.h>

int main() {
  char s[100];
  char t[100];
  scanf("%s", &s);
  int j = strlen(s);

  sprintf(t, "x");
  for (int i = 1; i != j; i++) {
    sprintf(t, "%sx", t);
  }
  printf("%s", t);
  return 0;
}

Fixed submission:
#include <stdio.h>
#include <string.h>

int main() {
  char s[101];
  char t[101];
  scanf("%s", &s);
  int j = strlen(s);

  sprintf(t, "x");
  for (int i = 1; i != j; i++) {
    sprintf(t, "%sx", t);
  }
  printf("%s", t);
  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;

  for (int i = 0; i < sizeof(S) - 1; i++) {
    S.at(i) = 'x';
  }
  cout << S << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;

  for (int i = 0; i < S.size(); i++) {
    S.at(i) = 'x';
  }
  cout << S << endl;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <climits>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;

int main() {
  char s[10];
  cin >> s;
  int n = strlen(s);
  for (int i = 0; i < n; i++)
    cout << 'x';
}

Fixed submission:
#include <climits>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;

int main() {
  char s[101];
  cin >> s;
  int n = strlen(s);
  for (int i = 0; i < n; i++)
    cout << 'x';
}
Problem p02778 (C++)

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

#define int long long
#define ll long long
#define f1(i, a, b) for (int i = a; i < b; i++)
#define f2(i, a, b) for (int i = a; i >= b; i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair

const int mod = 1000000007;
ll temp;

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

#ifndef ONLINE_JUDGE
  freopen("/home/akmittal/Desktop/Competitive Programming/in.txt", "r", stdin);
  freopen("/home/akmittal/Desktop/Competitive Programming/out.txt", "w",
          stdout);
#endif

  string s;
  cin >> s;

  int n = s.size();
  string t;
  f1(i, 0, n) t.pb('x');
  cout << t << endl;

  return 0;
}

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

#define int long long
#define ll long long
#define f1(i, a, b) for (int i = a; i < b; i++)
#define f2(i, a, b) for (int i = a; i >= b; i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair

const int mod = 1000000007;
ll temp;

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

  // #ifndef ONLINE_JUDGE
  // 	freopen("/home/akmittal/Desktop/Competitive
  // Programming/in.txt","r",stdin); 	freopen("/home/akmittal/Desktop/Competitive
  // Programming/out.txt","w",stdout); #endif

  string s;
  cin >> s;

  int n = s.size();
  string t;
  f1(i, 0, n) t.pb('x');
  cout << t << endl;

  return 0;
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
#define EPS 1e-9
#define PI acos(-1.0)

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  int n = (int)s.size();
  cout << string(n, 'x') << "\n";
}

Fixed submission:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
#define EPS 1e-9
#define PI acos(-1.0)

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  int n = (int)s.size();
  cout << string(n, 'x') << "\n";
}
Problem p02778 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
#include <string.h>

using namespace std;

int main() {
  char s[10];
  scanf("%s", s);

  int num = strlen(s);
  for (int i = 0; i < num; i++) {
    printf("x");
  }
  printf("\n");

  return 0;
}

Fixed submission:
#include <stdio.h>
#include <string.h>

using namespace std;

int main() {
  char s[100];
  scanf("%s", s);

  int num = strlen(s);
  for (int i = 0; i < num; i++) {
    printf("x");
  }
  printf("\n");

  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
long long arr[3000000], cnt[3000000];
int main() {
  long long n, i, j, k;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    cnt[arr[i]]++;
  }
  sort(arr, arr + n);
  for (i = 0; i < n - 1; i++) {
    if (arr[i + 1] == arr[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
long long arr[3000000], cnt[3000000];
int main() {
  long long n, i, j, k;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    // cnt[arr[i]]++;
  }
  sort(arr, arr + n);
  for (i = 0; i < n - 1; i++) {
    if (arr[i + 1] == arr[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
long long n, x;
bool cek[30000000], ceks;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (cek[x])
      ceks = true;
    cek[x] = true;
  }
  if (ceks)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
long long n, x;
bool cek[1000000005], ceks;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (cek[x])
      ceks = true;
    cek[x] = true;
  }
  if (ceks)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  string ans = "NO";
  int count = 0;
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i != j && vec.at(i) == vec.at(j)) {
        count++;
      }
    }
  }
  if (count == 0) {
    ans = "YES";
  }
  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  string ans = "NO";
  int count = 0;
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < N - 1; i++) {
    if (vec.at(i) == vec.at(i + 1)) {
      count++;
    }
  }
  if (count == 0) {
    ans = "YES";
  }
  cout << ans << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
typedef long long ll;
#define dump(x) cerr << #x << "=" << x << endl

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a.at(i);

  vector<bool> used(100000001, false);
  rep(i, n) {
    if (!used.at(a.at(i))) {
      used.at(a.at(i)) = true;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
typedef long long ll;
#define dump(x) cerr << #x << "=" << x << endl

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a.at(i);

  vector<bool> used(1000000010, false);
  rep(i, n) {
    if (!used.at(a.at(i))) {
      used.at(a.at(i)) = true;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
}
Problem p02779 (C++)

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);

  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }

  sort(A.begin(), A.end());

  for (int i = 1; i <= N - 1; i++) {
    if (A.at(i) == A.at(i - 1) or A.at(i) == A.at(i + 1)) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);

  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }

  sort(A.begin(), A.end());

  for (int i = 1; i <= N - 1; i++) {
    if (A.at(i) == A.at(i - 1)) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
}
Problem p02779 (C++)

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

  long long int a[100000], n, i, s1 = 0;
  cin >> n;
  for (i = 0; i < n; i++)
    cin >> a[i];
  sort(a, a + n);
  for (i = 0; i < (n - 1); i++) {
    if (a[i] == a[i + 1]) {
      s1 = 1;
      break;
    }
  }
  if (s1 == 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {

  long long int a[200000], n, i, s1 = 0;
  cin >> n;
  for (i = 0; i < n; i++)
    cin >> a[i];
  sort(a, a + n);
  for (i = 0; i < (n - 1); i++) {
    if (a[i] == a[i + 1]) {
      s1 = 1;
      break;
    }
  }
  if (s1 == 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;

  return 0;
}
Problem p02779 (C++)

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

int main() {
  int size;
  cin >> size;
  vector<int> nums(size);
  for (int i = 0; i < size; i++)
    cin >> nums.at(i);

  // sort
  int tmp;
  for (int j = 0; j < size; j++) {
    for (int i = 1; i < size; i++) {
      if (nums.at(j) < nums.at(i)) {
        tmp = nums.at(j);
        nums.at(j) = nums.at(i);
        nums.at(i) = tmp;
      }
    }
  }

  // check if same
  int flg;
  flg = 0;
  for (int i = 0; i < size - 1; i++) {
    if (nums.at(i) == nums.at(i + 1)) {
      flg = 1;
    }
  }

  if (flg == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

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

int main() {
  int size;
  cin >> size;
  vector<int> nums(size);
  for (int i = 0; i < size; i++)
    cin >> nums.at(i);

  // sort
  sort(nums.begin(), nums.end());

  // check if same
  int flg;
  flg = 0;
  for (int i = 0; i < size - 1; i++) {
    if (nums.at(i) == nums.at(i + 1)) {
      flg = 1;
    }
  }

  if (flg == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
///******* In the name of Allah *******///

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

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

void Ok() {
  long long int a[30013], b[10013], c, d, e, f, g, h, t, s, i, j, k, l1, l2, m,
      n, r, sum = 0, ans_1, ans_2, ans_3, cnt = 0, Max, Min, flag, div, temp;
  double aa, bb, cc, dd, ee, tot;
  char aaa[3013], bbb[1013], ccc[1013], num;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i < n; i++) {
    if (a[i] != a[i + 1]) {
      cnt++;
    }
  }
  if (cnt == (n - 1)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

int main() {
  Ok();

  return 0;
}


Fixed submission:
///******* In the name of Allah *******///

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

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

void Ok() {
  long long int a[300013], b[10013], c, d, e, f, g, h, t, s, i, j, k, l1, l2, m,
      n, r, sum = 0, ans_1, ans_2, ans_3, cnt = 0, Max, Min, flag, div, temp;
  double aa, bb, cc, dd, ee, tot;
  char aaa[3013], bbb[1013], ccc[1013], num;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i < n; i++) {
    if (a[i] != a[i + 1]) {
      cnt++;
    }
  }
  if (cnt == (n - 1)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

int main() {
  Ok();

  return 0;
}
Problem p02779 (C++)

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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }

  sort(vec.begin(), vec.end());

  bool a = true;
  for (int i = 0; i < N; i++) {
    if (vec.at(i) == vec.at(i + 1)) {
      a = false;
      break;
    }
  }

  if (a) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }

  sort(vec.begin(), vec.end());

  bool a = true;
  for (int i = 0; i < N - 1; i++) {
    if (vec.at(i) == vec.at(i + 1)) {
      a = false;
      break;
    }
  }

  if (a) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02779 (C++)

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    for (int j = 0; j < i; j++) {
      if (A[i] == A[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  for (int i = 0; i < N - 1; i++) {
    if (A[i] == A[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
Problem p02779 (C++)

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

int main() {
  int i, j, N;
  int judge = 1;
  cin >> N;
  vector<int> vec(N);
  for (i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  for (j = 0; j < N; j++) {
    for (i = j + 1; i < N; i++) {
      if (vec.at(i) == vec.at(j)) {
        judge--;
        break;
      }
    }
  }
  if (judge) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

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

int main() {
  int i, j, N;
  int judge = 1;
  cin >> N;
  vector<int> vec(N);
  for (i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  for (j = 0; j < N - 1; j++) {
    if (vec.at(j) == vec.at(j + 1)) {
      judge--;
      break;
    }
  }
  if (judge) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int main() {
  long long N;
  cin >> N;
  vector<long long> S(N);

  for (long long i = 0; i < N; i++) {
    cin >> S[i];
  }

  for (long long i = 0; i < N; i++) {
    for (long long j = 0; j < N; j++) {
      if (S[i] == S[j] && i != j) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }

  cout << "YES" << endl;
}


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

int main() {
  long long N;
  cin >> N;
  vector<long long> S(N);

  for (long long i = 0; i < N; i++) {
    cin >> S[i];
  }

  sort(S.begin(), S.end());

  for (long long i = 1; i < N; i++) {
    if (S[i] == S[i - 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
#define mo 1000000007
#define ull unsigned long long

int main() {
  ll n;
  cin >> n;
  string s = "YES";
  vector<ll> p(n);
  rep(i, n) cin >> p.at(i);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (p.at(i) == p.at(j)) {
        s = "NO";
      }
    }
  }
  cout << s;
}


Fixed submission:
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
#define mo 1000000007
#define ull unsigned long long

int main() {
  ll n;
  cin >> n;
  string s = "YES";
  vector<ll> p(n);
  rep(i, n) cin >> p.at(i);
  sort(p.begin(), p.end());
  for (int i = 1; i < n; i++) {
    if (p.at(i - 1) == p.at(i))
      s = "NO";
  }
  cout << s;
}
Problem p02779 (C++)

Buggy submission (status: 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;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (a[i] == a[j]) {
        cout << "NO"
             << "\n";
        return 0;
      }
    }
  }
  cout << "YES"
       << "\n";
  return 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() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  sort(a.begin(), a.end());
  rep(i, n - 1) {
    if (a[i] == a[i + 1]) {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  cout << "YES"
       << "\n";
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < N; i++)
    cin >> A[i];

  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (A[i] == A[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
}


Fixed submission:
#include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < N; i++)
    cin >> A[i];

  sort(A.begin(), A.end());
  A.erase(unique(A.begin(), A.end()), A.end());

  if (A.size() == N)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
string s1, s2, s3;
ll n1, n2;
ll a[200005], f;
int main() {
  cin >> n1;
  for (int i = 1; i <= n1; i++)
    cin >> a[i];
  sort(a + 1, a + 1 + n1);
  for (int i = 1; i <= n1; i++) {
    for (int j = i + 1; j <= n1; j++) {
      if (a[i] == a[j]) {
        f = 1;
        break;
      }
    }
  }
  if (f == 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
string s1, s2, s3;
ll n1, n2;
ll a[200005], f;
int main() {
  cin >> n1;
  for (int i = 1; i <= n1; i++)
    cin >> a[i];
  sort(a + 1, a + 1 + n1);
  for (int i = 1; i < n1; i++) {
    if (a[i] == a[i + 1]) {
      f = 1;
      break;
    }
  }
  if (f == 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
Problem p02779 (C++)

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

int main() {
  int n;
  bool flg = true;

  cin >> n;
  vector<long long> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }

  sort(vec.begin(), vec.end());
  for (int i = 0; i < n; i++) {
    if (vec.at(i) == vec.at(i + 1)) {
      cout << "NO" << endl;
      flg = false;
      break;
    }
  }
  if (flg) {
    cout << "YES" << endl;
  }
  return 0;
}

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

int main() {
  int n;
  bool flg = true;

  cin >> n;
  vector<long long> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }

  sort(vec.begin(), vec.end());
  for (int i = 0; i < n - 1; i++) {
    if (vec.at(i) == vec.at(i + 1)) {
      cout << "NO" << endl;
      flg = false;
      break;
    }
  }
  if (flg) {
    cout << "YES" << endl;
  }
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

#define rep(i, n) for (int i = 0; i < n; i++)
#define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup.
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;

int main() {
  ll N;
  cin >> N;
  //	vector<ll> A(N);
  ll A;
  vector<int> D(1000000000, 0);
  string ans = "YES";
  rep(i, N) {
    cin >> A;
    if (D[A] == 0) {
      D[A] = 1;
    } else {
      ans = "NO";
      break;
    }
  }

  cout << ans << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

#define rep(i, n) for (int i = 0; i < n; i++)
#define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup.
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;

int main() {
  ll N;
  cin >> N;
  //	vector<ll> A(N);
  ll A;
  map<ll, int> D;
  string ans = "YES";
  rep(i, N) {
    cin >> A;
    if (D[A] == 0) {
      D[A] = 1;
    } else {
      ans = "NO";
      break;
    }
  }

  cout << ans << endl;

  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i <= (b); ++i)
#define rv(i, a, b) for (int i = (a); i >= (b); --i)
using namespace std;
const int M = 120000;
typedef long long ll;
int n, m, k;
int a[M];
int main() {
  cin >> n;
  fo(i, 1, n) cin >> a[i];
  sort(a + 1, a + 1 + n);
  bool fg = 1;
  fo(i, 1, n - 1) {
    if (a[i] == a[i + 1])
      fg = 0;
  }
  if (fg)
    puts("YES");
  else
    puts("NO");
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i <= (b); ++i)
#define rv(i, a, b) for (int i = (a); i >= (b); --i)
using namespace std;
const int M = 220000;
typedef long long ll;
int n, m, k;
int a[M];
int main() {
  cin >> n;
  fo(i, 1, n) cin >> a[i];
  sort(a + 1, a + 1 + n);
  bool fg = 1;
  fo(i, 1, n - 1) {
    if (a[i] == a[i + 1])
      fg = 0;
  }
  if (fg)
    puts("YES");
  else
    puts("NO");
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <vector>
#define rep(i, cc, n) for (int i = cc; i <= n; ++i)
#define drep(i, cc, n) for (int i = cc; i >= n; --i)
typedef long long ll;
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  rep(i, 0, n - 1) cin >> a[i];
  bool flag = false;
  rep(i, 0, n - 1) {
    rep(j, i + 1, n - 1) {
      if (a[i] == a[j]) {
        flag = true;
        break;
      }
      if (flag)
        break;
    }
  }
  if (flag)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <vector>
#define rep(i, cc, n) for (int i = cc; i <= n; ++i)
#define drep(i, cc, n) for (int i = cc; i >= n; --i)
typedef long long ll;
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  rep(i, 0, n - 1) cin >> a[i];
  bool flag = false;
  sort(a, a + n);
  rep(i, 0, n - 2) {
    if (a[i] == a[i + 1])
      flag = true;
  }
  if (flag)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
Problem p02779 (C++)

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

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

  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (A[i] == A[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }

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

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

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

  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  sort(A.begin(), A.end());

  for (int i = 0; i < N - 1; i++) {
    if (A[i] == A[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#define rep(k, nu) for (int i = k; i < nu; i++)
#define rep2(k, n) for (int j = k; j < n; j++)
#define INF 1000000000000 // 1e+12
#define MOD 10000007      // 1e9+7
#define ll long long
#define pb pop_back
template <typename T> inline void chMin(T *a, T *b) {
  if (*a > *b)
    *a = *b;
}
template <typename T> inline void chMax(T *a, T *b) {
  if (*a < *b)
    *a = *b;
}
template <typename T> inline int divUp(T a, T b) { return ((a + b - 1) / b); }
const double PI = acos(-1);

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(0, n) cin >> a[i];

  rep(0, n / 2) {
    rep2(i + 1, n) {
      if (a[i] == a[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}
/*
3 3
1 7
3 2
1 7
*/


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(k, nu) for (int i = k; i < nu; i++)
#define rep2(k, n) for (int j = k; j < n; j++)
#define INF 1000000000000 // 1e+12
#define MOD 10000007      // 1e9+7
#define ll long long
#define pb pop_back
template <typename T> inline void chMin(T *a, T *b) {
  if (*a > *b)
    *a = *b;
}
template <typename T> inline void chMax(T *a, T *b) {
  if (*a < *b)
    *a = *b;
}
template <typename T> inline int divUp(T a, T b) { return ((a + b - 1) / b); }
const double PI = acos(-1);

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(0, n) cin >> a[i];

  sort(a.begin(), a.end());
  rep(0, n) {
    if (a[i] == a[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
/*
3 3
1 7
3 2
1 7
*/