Submission #1306796


Source Code Expand

#include <math.h>
#include <stdlib.h>
#include <stdio.h>

int main(void){

  int N;
  int R[1000];
  int S = 0;

  // 入力
  scanf("%d",&N);

  for(int i=0;i<N;i++) {
    scanf("%d",&R[i]);
    //printf("%d\n", R[i]);
  }

  int tmp;

  // ソートを実行
  for(int i=0;i<N-1;i++){
    for(int j=N-1;i<j;j--){
      if(R[j-1] > R[j]){
        tmp = R[j];
        R[j] = R[j-1];
        R[j-1] = tmp;
      }
    }
  }

  /* デバッグ
  for(int i=0;i<N;i++) {
    printf("%d\n", R[i]);
  } */

  //for(int i=0+2;i<N;i+=2){
  for(int i=0;i<N;i++){
    S += pow((double)R[i], 2.0) * ( i%2==0 ? 1 : -1);
    //printf("%d\n", R[i]);
  }

  // 結果の出力
  printf("%.12f\n",(double)S * M_PI);
}

Submission Info

Submission Time
Task A - 掛け算の最大値
User whitebacker
Language C (GCC 5.4.1)
Score 0
Code Size 745 Byte
Status WA
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:12:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&N);
   ^
./Main.c:15:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&R[i]);
     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
WA × 2
WA × 16
Set Name Test Cases
Sample example_0.txt, example_1.txt
All example_0.txt, example_1.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, special_0.txt, special_1.txt, example_0.txt, example_1.txt
Case Name Status Exec Time Memory
example_0.txt WA 1 ms 128 KB
example_1.txt WA 1 ms 128 KB
random_0.txt WA 1 ms 128 KB
random_1.txt WA 1 ms 128 KB
random_2.txt WA 1 ms 128 KB
random_3.txt WA 1 ms 128 KB
random_4.txt WA 1 ms 128 KB
random_5.txt WA 1 ms 128 KB
random_6.txt WA 1 ms 128 KB
random_7.txt WA 1 ms 128 KB
random_8.txt WA 1 ms 128 KB
random_9.txt WA 1 ms 128 KB
special_0.txt WA 1 ms 128 KB
special_1.txt WA 1 ms 128 KB