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

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

Error: WA

Fixed submission:

#include <stdio.h>
int main() {
  int a[100], i = 0;
  do {
    scanf("%d", &a[i]);
    i++;
  } while (a[i - 1] != 0);
  for (int b = 0; b < i - 1; b++) {
    printf("Case %d: %d", b + 1, a[b]);
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>
using namespace std;

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

  while (1) {

    scanf("%d", &x);

    if (x == 0)
      break;

    i++;
    printf("Case %d: %d\\n", i, x);
  }
}

Error: TLE

Fixed submission:

#include <cstdio>
using namespace std;

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

  while (1) {

    scanf("%d", &x);

    if (x = 0)
      break;

    i++;
    printf("Case %d: %d", i, x);
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

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

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


Error: 0

Fixed submission:

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

int main() {
  int i = 0, Case[1000];
  Case[0] = 1;
  while (1) {
    cin >> Case[i];
    if (Case[i] == 0) {
      break;
    }
    i++;
  }
  for (int j = 0; j <= i - 1; j++) {
    cout << "Case " << j + 1 << ": " << Case[j] << endl;
  }
}
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;
    else
      cout << "Case " << i << ": " << x << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

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

// ConsoleApplication3.cpp : コンソール アプリケーションのエントリ
// ポイントを定義します。
//

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


Error: TLE

Fixed submission:

// ConsoleApplication3.cpp : コンソール アプリケーションのエントリ
// ポイントを定義します。
//

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

#include <iostream>

using namespace std;

int main() {
  int i = 0;
  int x;

  cin >> x;

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

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int x;
  int i = 0;

  cin >> x;

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

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

#include <iostream>

using namespace std;

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

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

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

#include <algorithm>
#include <cstdio>

using namespace std;

int main() {
  int N[65535];
  int i = 0;
  while (true) {
    scanf("%d", &N[i]);
    if (N[i] == 0)
      break;
    i++;
  }

  for (int j = 0; j < i; j++) {
    printf("Case %d: %d\\n", j + 1, N[j]);
  }
  return 0;
}

Error: 0

Fixed submission:

#include <algorithm>
#include <cstdio>

using namespace std;

int main() {
  int N[100];
  int i = 0;
  while (true) {
    scanf("%d", &N[i]);
    if (N[i] == 0)
      break;
    i++;
  }

  for (int j = 0; j < i; j++) {
    printf("Case %d: %d\\n", j + 1, N[j]);
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
using namespace std;

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


Error: TLE

Fixed submission:

#include <stdio.h>
using namespace std;

int x = 1;
int i = 0;
int main() {
  while (1) {
    i++;
    scanf("%d", &x);
    printf("Case %d: %d", i, x);
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

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

Error: 0

Fixed submission:

#include <stdio.h>
int main() {
  int a[100], i, count = 0, j = 0;
  while (scanf("%d", &a[j]) != EOF) {
    count++;
    if (a[j] == 0) {
      for (i = 0; i < count - 1; i++)
        printf("Case %d: %d\\n", i + 1, a[i]);
      return 0;
    } else
      j++;
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

/*
 * taete.cpp
 *
 *  Created on: 2018/04/26
 *      Author: J01003
 */
#include <iostream>
using namespace std;

int main() {

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

  return 0;
}


Error: TLE

Fixed submission:

/*
 * taete.cpp
 *
 *  Created on: 2018/04/26
 *      Author: J01003
 */
#include <iostream>
using namespace std;

int main() {

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

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

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

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


Error: -11

Fixed submission:

#include <cstdio>
int main() {
  int id, data;
  id = 1;
  while (true) {
    scanf("%d", data);
    if (data == 0)
      break;
    printf("Case %d: %d\\n", id, data);
    ++id;
  }
  return 0;
};
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

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

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int x;
  for (;;) {
    scanf("%d", x);
    printf("%d\\n", x);
    if (x == 0) {
      break;
    }
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {

  int i, x;

  for (i = 1; i < 100000; i++) {

    cin >> x;

    if (x == 0)
      break;

    cout << "Case " << i << ": " << x << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

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

int main() {

  int i = 1, x;

  while (i = 1) {

    cin >> x;

    cout << "Case " << i << " " << x << endl;

    if (i == 0)
      break;
  }

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

#include <cstdio>

int main(void) {
  int x;

  for (int i = 1;; i++) {
    scanf("%d", &x);
    if (x == 0)
      break;

    printf("Case %d: %d\\n", i, x);
  }

  return 0;
}

Error: WA

Fixed submission:

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

int main(void) {
  int x[1000], i = 0;
  while (1) {
    cin >> x[i];
    if (x[i] == 0)
      break;
    i++;
  }

  for (int j = 0; j < i - 1; j++) {
    printf("Case %d: %d\\n", j + 1, x[j]);
  }

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

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

Error: WA

Fixed submission:

#include <stdio.h>
int main() {
  int x[255], cnt = 0;
  while (1) {
    cnt++;
    scanf("%d", &x[cnt]);
    if (x[cnt] == 0)
      break;
  }
  cnt = 0;
  while (1) {
    cnt++;
    if (x[cnt] == 0)
      break;
    else
      printf("Case %d:%d\\n", cnt, x[cnt]);
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

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

  int x, i;
  i = 0;
  while (i <= 10000 && i >= 0) {

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

Error: -11

Fixed submission:

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

  int x, i, *k;
  i = 0;
  k = 0;
  while (i <= 10000 && i >= 0) {

    cin >> x;
    if (x[k] == 0) {
      break;
    } else {
      i++;
      k = k + 1;
      cout << "Case " << i << ": " << x << endl;
    }
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main(void) {
  int i, x;

  scanf("%d", &x);
  for (i = 1; x != 0; i++) {
    printf("Case %d: %d\\n", i, x);
    scanf("%d", &x);
  }
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>

int main(void) {
  int i, x;

  scanf("%d", x);
  for (i = 1; x != 0; i++) {
    printf("Case %d: %d\\n", i, x);
    scanf("%d", x);
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int x;
  int n = 1;
  int d[10000];
  cin >> x;

  while (x != 0) {
    d[n] = x;
    n++;
    cin >> x;
  }

  for (int i = 1; i < n; i++) {
    cout << "Case"
         << " " << i << ":"
         << " " << d[i] << "\\n";
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x;
  int n = 1;    //??\\????????????x(?????????)?????° ?????????1
  int d[10000]; //?????????????????????
  while (1) {
    cin >> x;
    if (x != 0) {
      d[n] = x;
      n++;
    }
    if (x == 0) {
      for (int i = 1; i < n; i++) {
        cout << "case"
             << " " << i << ":"
             << " " << d[i] << "\\n";
      }
    }
  }
  return 0;
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  for (int x, i = 1;; i++) {
    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 x, i = 1;; i++) {
    cin >> x;
    cout << "Case " << i << ": " << x << endl;
  }
  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;
    }
    cout << "Case " << i << ": " << x << endl;
    i++;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

#include <iostream>
using namespace std;
int main() {
  int n = 1;
  int a;
  int b[10000];
  while (cin >> a && a != 0) {
    b[n] = a;
    n++;
  }
  for (int i = 1; i < n; i++) {
    cout << "Case " << i << ": " << b[i] << endl;
  }
}

Error: 0

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int n[10000];
  int a;
  n[0] = 1;
  for (int i = 1; n[i - 1] != 0; i++) {
    cin >> n[i];
    a++;
  }
  for (int i = 1; a > 1; i++) {
    cout << "Case " << i << ": " << n[i] << endl;
    a--;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

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


Error: TLE

Fixed submission:

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

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

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

  int x[10000], i = 0;
  do {
    cin >> x[i];
  } while (x[i++] != 0);

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

Error: 0

Fixed submission:

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

  int x[1000], i = 0;
  do {
    cin >> x[i];
  } while (x[i++] != 0);

  int k = 0;
  while (k < i - 1) {
    cout << "Case " << k + 1 << ": " << x[k] << endl;
    k++;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

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

Error: -11

Fixed submission:

#include <iostream>
using namespace std;

int x[100];
int main() {
  cin >> x[0];
  int i;
  while (x[i] != 0) {
    cin >> x[i + 1];
    ++i;
  }
  i = 0;
  while (x[i] != 0) {
    cout << "Case " << i + 1 << ": " << x[i] << endl;
    ++i;
  }
}
Problem p02396 (C++) — buggy submission, verdict: Time Limit Exceeded

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

#include <iostream>

using namespace std;

int main() {
  int n;
  int a;
  n = 10000;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 0) {
      cout << "";
      return 0;
    } else {
      cout << "Case"
           << " " << i + 1 << ":"
           << " " << a << endl;
    }
  }
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int n;
  int a[n];
  n = 10000;
  for (int i = 0; i < n; i++) {
    if (a[n] != 0) {
      cin >> a[i];
      cout << "Case"
           << " " << i + 1 << ":"
           << " " << a[i];
    } else
      return 0;
  }

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

#include <iostream>

using namespace std;

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


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

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

#include <iostream>
using namespace std;

int main() {
  int x[10000];

  int n = 0;
  while (true) {
    // if (n>9999) return -1;

    cin >> x[n];

    if (x[n] == 0)
      break;

    ++n;
  }

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

  return 0;
}


Error: 0

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x[10000];

  int n = 0;
  while (true) {
    if (n > 9999)
      return -1;

    cin >> x[n];

    if (x[n] == 0)
      break;

    ++n;
  }

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

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

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

int main() {

  double r = 0;
  double pi = 3.141592653589; // 円周率の設定

  cin >> r;

  cout << fixed; // 出力時の小数点以下の有効数字を6桁に設定
  cout << setprecision(6); // さらに大きな数を指定しても可

  cout << r * r * pi << " ";  // 面積の出力
  cout << r * 2 * pi << endl; // 円周の出力

  return 0;
}


Error: WA

Fixed submission:

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_D&lang=jp

#include <iostream>
using namespace std;

int main() {

  int a, b;
  int d, r;
  double da, db, f;
  cin >> a >> b;

  da = a;
  db = b;

  cout << fixed;
  cout << a / b << " " << a % b << " " << da / db << endl;
  return 0;
}
Problem p02400 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  double r;
  double S = 0.0, L = 0.0, pi = 3.14159265359;
  scanf("%lf", &r);
  S = r * r * pi;
  L = 2 * r * pi;
  printf("%.6lf %.6lf\\n", S, L);
  return 0;
}

Error: -8

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, d = 0, r = 0;
  double f = 0.0;
  scanf("%d%d", &a, &b);
  d = a / b;
  r = a % b;
  f = (double)a / b;
  printf("%d %d %f\\n", d, r, f);
  return 0;
}
Problem p02400 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>

using namespace std;

int main() {

  double r;
  cin >> r;
  printf("%f %f\\n", M_PI * (r * r), 2 * M_PI * r);
  return 0;
}


Error: WA

Fixed submission:

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

int main() {

  int a, b, d, r;
  double f;
  cin >> a >> b;

  d = a / b;
  r = a % b;
  f = (double)a / (double)b;

  printf("%ld %ld %.61f\\n", d, r, f);
  return 0;
}
Problem p02400 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  cout << fixed << setprecision(6);
  double a;
  cin >> a;
  cout << a * a * acos(-1) << " " << 2 * a * acos(-1) << endl;

  return 0;
}


Error: WA

Fixed submission:

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

int main() {
  cout << fixed << setprecision(12);
  int a, b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " " << (double)a / b << endl;

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

#include <cassert>
#include <cmath>
#include <iostream>
// #define NDEBUG
int main(void) {
  using namespace std;
  static const int INPUT_R_MAX = 10000;
  static const int INPUT_R_MIN = 0;
  double input_r = 0;
  double area = 0;          /* 面積 */
  double circumference = 0; /* 円周 */

  cin >> input_r; /* 半径 */

  /* 入力値の前提条件 */
  assert(INPUT_R_MIN <= input_r && input_r <= INPUT_R_MAX);

  /* Calculation */
  area = input_r * input_r * M_PI;
  circumference = input_r * 2 * M_PI;

  /* Output */
  cout << fixed << area << " " << circumference << endl;
  return 0;
}


Error: 0

Fixed submission:

#include <cassert>
#include <cmath>
#include <iostream>
// #define NDEBUG
int main(void) {
  using namespace std;
  static const int INPUT_R_MAX = 10000;
  static const int INPUT_R_MIN = 1;
  double input_r = 0;
  double area = 0;          /* 面積 */
  double circumference = 0; /* 円周 */

  cin >> input_r; /* 半径 */

  /* 入力値の前提条件 */
  assert(INPUT_R_MIN <= input_r && input_r <= INPUT_R_MAX);

  /* Calculation */
  area = input_r * input_r * M_PI;
  circumference = input_r * 2 * M_PI;

  /* Output */
  cout << fixed << area << " " << circumference << endl;
  return 0;
}
Problem p02400 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  cout << fixed << setprecision(12);

  double r;
  cin >> r;

  double PI = acos(-1);
  double area = r * r * PI;
  double cir = (r + r) * PI;
  cout << area << " " << cir << endl;

  return 0;
}


Error: WA

Fixed submission:

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

int main() {

  cout << fixed << setprecision(12);

  int a, b;
  cin >> a >> b;

  cout << a / b << " ";
  cout << a % b << " ";
  cout << (double)a / b << endl;

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

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

int main() {
  double r;
  cin >> r;
  printf("%f %f\\n", r * r * 3.141592653589, 2 * r * 3.141592653589);
  return 0;
}

Error: 9

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
// #define shosu(n) setprecision(n)
// #define ENDL endl
using namespace std;
int main() {
  double n;
  cin >> n;
  cout << setprecision(8) << n * n * 3.141592653589 << ' ' << setprecision(8)
       << 2 * n * 3.14159265358972 << endl;
  return 9;
}
Problem p02400 (C++) — buggy submission, verdict: Time Limit Exceeded

// incomplete......
#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, r;
  double are, cir, pi = 3.1415926535897932384626433832795;
  while (cin >> r) {
    are = pi * r * r;
    cir = 2 * pi * r; // circumstances...
    // cout<<are<<" "<<cir<<endl;
    printf("%.15lf %.15lf\\n", are, cir);
  }
  return 0;
}


Error: TLE

Fixed submission:

// incomplete......
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, r;
  double are, cir, pi = 3.141592;
  while (scanf("%d", &r) != EOF) {
    are = pi * r * r;
    cir = 2 * pi * r; // circumstances...
    // cout<<are<<" "<<cir<<endl;
    printf("%.6lf %.6lf\\n", are, cir);
  }
}
Problem p02400 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  double pi = 3.141592653589793;
  double r, pir;
  cin >> r;
  pir = pi * r;
  cout << fixed << setprecision(5) << pir * r << " " << pir * 2 << endl;
  return 0;
}

Error: WA

Fixed submission:

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

int main() {
  int a, b, d;
  cin >> a >> b;
  d = a / b;
  cout << d << " " << a - b * d << " " << fixed << setprecision(5)
       << (double)a / b << endl;
  return 0;
}
Problem p02400 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
  double r, a, l;
  cin >> r;
  a = r * r * 3.141592653589;
  l = r * 2 * 3.141592653589;

  cout << fixed << setprecision(6) << a;
  cout << " ";
  cout << fixed << setprecision(6) << l;
  cout << endl;
}


Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  int a, b, r;
  double d, f;
  cin >> a;
  cin >> b;

  d = a / b;
  r = a % b;
  f = 1.00000 * a / b;
  cout << d;
  cout << " ";
  cout << r;
  cout << " ";
  cout << f;
  cout << endl;
}
Problem p02400 (C++) — buggy submission, verdict: Runtime Error

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

#define _USE_MATH_DEFINES
#include <math.h>

int main() {
  double nA;
  cin >> nA;
  double dA, dC;
  dA = M_PI * nA * nA;
  dC = 2 * M_PI * nA;

  printf("%.6f %.6f\\n", dA, dC);

  // system("pause");
  return 0;
}

Error: WA

Fixed submission:

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

#define _USE_MATH_DEFINES
#include <math.h>

int main() {
  int nA;
  cin >> nA;
  double dA, dC;
  dA = M_PI * nA * nA;
  dC = 2 * M_PI * nA;

  printf("%.6d %.6d\\n", dC, dA);

  system("pause");
  return 0;
}