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

#include <iostream>
using namespace std;

int main() {

  int i, counter = 1;

  while (true) {
    cin >> i;
    if (i == 0) {
      break;
    }
    cout << "Case " << counter << ": " << i << endl;
    counter++;
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int i, counter = 1;
  while (i >= 0 && i <= 10000) {
    cin >> i;
    cout << "Case"
         << " " << counter << ": "
         << " " << i;
    counter++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int i, n;
  i = 1;
  while (1) {
    cin >> n;
    if (n == 0)
      break;
    cout << "Case " << i << ": " << n << endl;
    i++;
  }
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int i, n;
  int A[10000];
  while (1) {
    cin >> n;
    if (n == 0)
      break;
    A[i] = n;
    i++;
  }
  for (n = 0; n < i + 1; n++) {
    cout << "Case " << n + 1 << ": " << A[i] << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int x, i = 1;
  cin >> x;
  while (x > 0) {
    cout << "Case " << i << ": " << x << endl;
    i++;
    cin >> x;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, i = 1;
  for (cin >> x; x > 0; i = i + 1) {
    cout << "case " << i << ": " << x << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {

  int i = 0, a[10000], j;

  while (1) {
    scanf("%d", &a[i]);
    if (a[i] == 0) {
      break;
    }
    printf("Case %d: %d\\n", i + 1, a[i]);
    i++;
  }

  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main() {

  int i = 0, a[10000000], j;

  while (1) {
    scanf("%d", &a[i]);
    if (a[i] == 0) {
      break;
    }
    i++;
  }

  for (j = 0; j < i; j++) {
    printf("Case %d; %d\\n", j, a[j]);
  }

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

#include <iostream>
using namespace std;
int main() {
  int x, i = 1;
  while (true) {
    cin >> x;
    if (x == 0) {
      break;
    } else {
      cout << "Case"
           << " " << i << ":"
           << " " << x << endl;
      i++;
    }
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, i;
  i = 0;
  while (true) {
    i = i + 1;
    cin >> x;
    cout << "Case"
         << " " << i << ": " << x << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  // Your code here!int i,n;
  int i, n;
  i = 1;
  while (1) {
    cin >> n;
    if (n == 0)
      break;
    cout << "Case " << i << ": " << n << endl;
    i++;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {

  int i, n;
  cin >> n;
  while (1) {
    cout << "Case i :"
         << " "
         << "n" << endl;
    if (n == 0)
      break;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main() {
  int i, a;
  a = 0;
  scanf("%d", &i);
  while (i != 0) {
    a = a + 1;
    printf("Case %d: %d\\n", a, i);
    scanf("%d", &i);
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>
int main() {
  int i;
  scanf("%d", &i);
  while (i != 0) {
    printf("Case i: %d\\n", i);
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>
int main() {
  int x;
  int i = 1;
  while (1) {
    scanf("%d", &x);
    if (x == 0)
      break;
    printf("Case %d: %d\\n", i, x);
    i++;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <cstdio>
int main() {
  int x;
  int i = 1;
  while (1) {
    scanf("%d", &x);
    if (x = 0)
      break;
    printf("Case %d: %d\\n", i, x);
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int x;
  cin >> x;
  int i = 1;
  while (x != 0) {
    cout << "Case " << i << ": " << x << endl;
    cin >> x;
    i++;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int x;
  cin >> x;
  int i = 1;
  while (x != 0) {
    cout << "Case " << i << ": " << x << endl;
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a[1000000], aa = 0, i;
  for (i = 0; aa < 1; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 0) {
      aa = 2;
    }
  }
  for (int j = 1; j < i; j++) {
    printf("Case %d: %d\\n", j, a[j - 1]);
  }
  return 0;
}

Error: 0

Fixed submission:

#include <stdio.h>
int main() {
  int a[100], aa = 0, i;
  for (i = 0; aa < 1; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 0) {
      aa = 2;
    }
  }
  for (int j = 1; j < i; j++) {
    printf("Case %d: %d\\n", j, a[j - 1]);
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int i = 1, j = 1, x[100000];
  x[0] = -1;

  while (x[i - 1] != 0) {
    cin >> x[i];
    i = i + 1;
  }

  while (x[j] != 0) {
    cout << "Case " << j << ": " << x[j] << endl;
    j = j + 1;
  }

  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int i = 1, j, x[100];
  x[0] = -1;

  while (x[i - 1] != 0) {
    cin >> x[i];
    i = i + 1;
  }

  i = 1;
  while (x[i] != 0) {
    cout << "Case" << i << ": " << x[i] << endl;
    i = i + 1;
  }

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

#include <iostream>
using namespace std;

int main() {
  int x[10000];

  for (int i = 0; i < 10000; i++) {
    cin >> x[i];
    if (x == 0)
      break;
    cout << "Case " << i + 1 << ": " << x[i] << endl;
  }

  return 0;
}


Error: 0

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x[10];

  for (int i = 1; i < 11; i++) {
    cin >> x[i];
    if (x[i] == 0)
      break;
    cout << "Case " << i << ": " << x[i] << endl;
  }

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  int x = 0;
  while (1) {
    cin >> a;
    x = x + 1;
    if (a > 0) {
      cout << "Case " << x << ": " << a << endl;
    }
    if (a == 0) {
      break;
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  int x = 0;
  while (1) {
    cin >> a;
    x = x + 1;
    if (a > 0) {
      cout << "Case " << x << ": " << a << endl;
    }
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b = 1;
  while (true) {
    cin >> a;
    if (a == 0)
      break;
    else if (a != 0)
      cout << "Case " << b << ": " << a << endl;
    b++;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a;
  while (true) {
    cin >> a;
    if (a = 0)
      break;
    else if (a != 0)
      cout << a << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  vector<int> x(10000);
  int i = 0;
  while (1) {
    int flag = 1;
    cin >> x[i];
    if (x[i] == 0) {
      break;
    }
    i++;
  }
  for (int t = 0; t < i; t++) {
    cout << "Case " << t + 1 << ": " << x[t] << endl;
  }
  return 0;
}


Error: 0

Fixed submission:

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  vector<int> x(1000);
  int i = 0;
  while (1) {
    int flag = 1;
    cin >> x[i];
    if (x[i] == 0) {
      break;
    }
    i++;
  }
  for (int t = 0; t < i; t++) {
    cout << "Case " << t + 1 << ": " << x[t] << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
int main() {
  int x;
  int i;
  i = 1;
  while (true) {
    std::cin >> x;
    if (x == 0)
      break;
    std::cout << "Case " << i << ": " << x << std::endl;
    i++;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
int main() {
  int x;
  int i;
  while (true) {
    std::cin >> x;
    if (x == 0)
      break;
    for (i = 1;; i++) {
    }
    std::cout << "Case" << i << ":" << x << std::endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int i, x;
  i = 1;

  while (1) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
    i++;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int i, x;
  i = 1;

  while (x = !0) {
    cin >> x;
    cout << "Cace " << i << ": " << x << endl;
  }

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

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

//---- Print Test Cases
int main() {
  int x = 1, i = 1;
  while (true) {
    scanf("%d", &x);
    if (x == 0)
      break;
    printf("Case %d: %d\\n", i, x);
    i++;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

//---- Print Test Cases
int main() {
  int i;
  while (true) {
    cin >> i;
    cout << "case:" << i << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int data, i = 1;

  while (1) {
    cin >> data;
    if (data == 0) {
      break;
    }
    cout << "Case " << i << ": " << data << endl;
    i++;
  }
  return 0;
}

Error: 0

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int data[30], i = 0;

  while (1) {
    cin >> data[i];
    if (data[i] == 0) {
      break;
    }
    cout << "Case " << i + 1 << ": " << data[i] << endl;
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int i = 1, x;

  while (1) {
    cin >> x;
    if (x == 0)
      break;
    cout << "Case"
         << " " << i << ":"
         << " " << x << endl;
    i++;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int i = 1, x;
  cin >> x;
  while (1) {
    if (x == 0)
      break;
    cout << "Case"
         << " " << i << ":"
         << " " << x << endl;
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#include <iostream>

int main() {
  int buf, count;
  count = 0;
  while (true) {
    scanf("%d", &buf);
    if (buf == 0)
      break;
    count++;
    printf("Case %d: %d\\n", count, buf);
  }
  return 0;
}


Error: WA

Fixed submission:

#include <cstdio>
#include <iostream>

int main() {
  int x[10000], count;
  for (int i; i < 10000; i++) {
    scanf("%d", &x[i]);
    count++;
    if (x[i] == 0) {
      break;
    }
  }
  for (int i = 1; i <= count; i++) {
    printf("Case %d: %d \\n", i, x[i - 1]);
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>

int main() {
  int num;
  int cnt = 1;
  while (1) {
    std::cin >> num;
    if (num == 0)
      break;
    std::cout << "Case " << cnt << ": " << num << std::endl;
    ;
    cnt++;
  }
  return 0;
}

Error: -11

Fixed submission:

#include <cstdio>

int main() {
  int num;
  int cnt = 1;
  do {
    scanf("%d", num);
    printf("Case %d: %d, cnt, num");
    cnt++;
  } while (num != 0);
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>

int main() {
  int i = 1;
  int x;
  while (1) {
    scanf("%d", &x);
    if (x == 0)
      break;
    printf("Case %d: %d\\n", i, x);
    i++;
  }
}


Error: TLE

Fixed submission:

#include <stdio.h>

int main() {
  int i = 1;
  int x;
  while (1) {
    if (scanf("%d", &x) == 0)
      break;
    printf("Case %d: %d\\n", i, x);
    i++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int i = 1;
  int n;

  while (true) {
    cin >> n;
    if (n == 0)
      break;
    cout << "Case " << i << ": " << n << endl;
    i++;
  }
}


Error: TLE

Fixed submission:

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

int main() {
  int x, i = 0;
  cin >> x;
  while (true) {
    cout << "case" << i << ":" << x;
    if (x == 0)
      break;
    i++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int x[10000];
  int i = 0;

  while (true) {
    cin >> x[i];

    if (x[i] == 0) {
      break;
    }

    ++i;
  }

  for (int j = 0; j < i; ++j) {
    cout << "Case " << 1 + j << ": " << x[j] << endl;
  }

  return 0;
}


Error: 0

Fixed submission:

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

int main() {
  int x[100];
  int i = 0;

  while (true) {
    cin >> x[i];

    if (x[i] == 0) {
      break;
    }

    i++;
  }

  for (int j = 0; j < i; ++j) {
    cout << "Case " << 1 + j << ": " << x[j] << endl;
  }

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

#include <iostream>

int main() {
  int x;
  for (int i = 1;; i++) {
    std::cin >> x;
    if (x == 0)
      break;
    std::cout << "Case " << i << ": " << x << std::endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

int main() {

  int x;

  for (int i = 1;; i++) {
    std::cin >> x;
    if (x = 0) {
      break;
    }
    std::cout << "Case " << i << ": " << x << std::endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  for (int i = 1;; ++i) {
    int x;
    cin >> x;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  for (int i = 1;; ++i) {
    int x;
    cin >> x;
    cout << "Case " << i << ": " << x;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int cou = 1;
  int n;
  while (1) {
    cin >> n;
    if (n == 0)
      break;
    cout << "Case"
         << " " << cou << ":"
         << " " << n << endl;
    cou++;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cou = 1;
  while (n != 0) {
    if (n == 0)
      break;
    cout << "Case"
         << "" << cou << ":"
         << "" << n << endl;
    cou++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x;
  int i = 0;
  while (1) {
    cin >> x;
    i += 1;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x;
  cin >> x;
  int i = 0;
  cin >> i;

  while (x <= 10000) {
    i += 1;
    if (x == 0)
      break;
    cout << "Case " << i << ": " << x << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int n;
  vector<int> x(10010);
  int i;
  for (i = 0; i < 10010; i++) {
    cin >> x.at(i);
  }
  for (int j = 0; x.at(j) != 0; j++) {
    cout << "Case " << j + 1 << ": " << x.at(j) << endl;
  }
}


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


Fixed submission:

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

int main() {
  vector<int> x;
  int i;
  while (x.at(i) != 0) {
    cin >> x.at(i);
    i++;
  }
  for (int j = 0; j < i; j++) {
    cout << "Case " << j + 1 << ": " << x.at(j) << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int input, i = 0;
  while (cin >> input) {
    if (input == 0)
      break;

    i++;
    cout << "Case " << i << ": " << input << endl;
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int input[1000], i = 0;
  while (cin >> input[i]) {
    if (input[i] == 0)
      break;

    i++;
  }
  for (int j = 0; j < i; j++) {
    cout << "Case " << i << ": " << input[j] << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <math.h>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string>

using namespace std;

int main(void) {
  long x[10000];

  long co = 0;

  for (long i = 0; i < 10000; i++) {
    cin >> x[i];

    if (x[i] == 0) {
      break;
    }
    co += 1;
  }

  for (long i = 0; i < co; i++) {
    cout << "Case"
         << " " << i + 1 << ':' << " " << x[i] << endl;
  }
}


Error: 0

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <math.h>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string>

using namespace std;

int main(void) {
  int x[100];

  int co = 0;

  for (long i = 0; i < 10000; i++) {
    cin >> x[i];

    if (x[i] == 0) {
      break;
    }
    co += 1;
  }

  for (int i = 0; i < co; i++) {
    cout << "Case"
         << " " << i + 1 << ':' << " " << x[i] << endl;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  for (int count = 1;; ++count) {
    int input;
    cin >> input;
    if (input == 0) {
      break;
    }
    cout << "Case " << count << ":"
         << " " << input << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  for (int count = 1;; ++count) {
    int input;
    cin >> input;
    cout << "Case " << count << ":"
         << " " << input << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {

  int a = 1, b;

  while (true) {

    cin >> b;

    if (b == 0)
      break;

    cout << "Case " << a << ": " << b << endl;

    a++;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {

  int a = 1, b;

  while (true) {

    cin >> b;

    if (b = 0)
      break;

    cout << "Case " << a << ": " << b << endl;

    a++;
  }

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

#include <cstdio>

int main() {
  int x;
  int n = 1;
  while (1) {
    scanf("%d", &x);
    if (x == 0)
      break;
    printf("Case %d: %d\\n", n, x);
    n++;
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <cstdio>
using namespace std;
int main() {
  int x;
  int i = 1;
  while (1) {
    scanf("%d", &x);
    if (x = 0)
      break;
    printf("Case %d: %d\\n", i, x);
    i++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Memory Limit Exceeded

#include <stdio.h>
int main() {
  int x, i;
  i = 1;
  while (1) {
    scanf("%d", &x);
    if (x == 0)
      break;
    printf("Case %d: %d\\n", i, x);
    i++;
  }
  return 0;
}

Error: MLE

Fixed submission:

#include <cstdio>
#include <queue>
#include <stdio.h>
using namespace std;
int main(void) {
  queue<int> que1, que2;
  int x1, y2, tmp, count;
  tmp = count = 0;
  do {
    scanf("%d", &x1);
    scanf("%d", &y2);
    if (x1 == 0)
      if (y2 == 0)
        break;

    if (x1 < y2) {
      tmp = x1;
      x1 = y2;
      y2 = tmp;
    }
    que1.push(x1);
    que2.push(y2);

    count++;
  } while (x1 != 0 || y2 != 0);

  for (int i = 0; i < count; i++) {
    printf("%d %d\\n", que1.front(), que2.front());
    que1.pop();
    que2.pop();
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int i = 1;
  int n;

  while (true) {
    cin >> n;
    if (n == 0)
      break;
    cout << "Case " << i << ": " << n << endl;
    i++;
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, y;
  cin >> x;
  y = 0;
  while (1) {
    y++;
    if (x == 0) {
      break;
    }
    cout << "Case " << y << ": " << x << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int i = 1;
  int n;
  while (1) {
    cin >> n;
    if (n == 0)
      break;
    cout << "Case " << i << ": " << n << endl;
    i++;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int y = 0;
  int x;
  cin >> x;
  while (1) {
    y++;
    if (x == 0) {
      break;
    }
    cout << "Case " << y << ": " << x << endl;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b = 1;
  while (1) {
    cin >> a;
    if (a == 0)
      break;
    cout << "Case " << b << ": " << a << endl;
    b++;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, y = 1;
  cin >> x;
  while (1) {
    if (x == 0) {
      break;
    }
    cout << "Case " << y << ": " << x << endl;
    y++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int a, b = 0;
  while (1) {
    cin >> a;
    if (a == 0)
      break;
    b++;
    cout << "Case " << b << ": " << a << endl;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b = 1;
  cin >> a;
  while (1) {
    if (a == 0)
      break;
    cout << "Case " << b << ": " << a << endl;
    b++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a;
  int b = 1;
  while (1) {
    cin >> a;
    if (a == 0)
      break;
    cout << "Case " << b << ": " << a << endl;
    b++;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b = 1;
  while (1) {
    cin >> a;
    cout << "Case " << b << ": " << a << endl;
    b++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int a, i = 1;
  while (1) {
    cin >> a;
    if (a == 0)
      break;
    cout << "Case " << i << ": " << a << endl;
    i++;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int a;
  for (int i = 1;; i++) {
    cin >> a;
    if (a != 0) {
      cout << "case " << i << ": " << a << endl;
    }
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

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

signed main() {
  int a;
  for (int b = 1; scanf("%d", &a), a; b++) {
    printf("Case %d: %d\\n", b, a);
  }
}

Error: TLE

Fixed submission:

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

signed main() {
  int a;
  for (int b = 1; scanf("%d", &a); b++) {
    printf("Case %d: %d\\n", b, a);
  }
}