結果

問題 No.111 あばばばば
ユーザー 313makoto0313makoto0
提出日時 2015-01-10 00:19:09
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 470 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 24,852 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-03 22:54:01
合計ジャッジ時間 1,348 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int main()
{
  int l,lcopy,carry=0,ans[20]={0},i;

  scanf("%d",&l);

  l--;
  lcopy=l;

  for (i=0;l>0;i++) {
    ans[i]=l%10;
    l/=10;
  }

  i--;

  for (;i>=1;i--) {
    ans[i-1]+=(ans[i]%4)*10;
    ans[i]/=4;
  }
  ans[0]/=4;

  l=lcopy;

  for (i=0;i<20;i++) {
    ans[i]*=l;
    ans[i]+=carry;
    carry=ans[i]/10;
    ans[i]%=10;
  }

  i=19;
  while (ans[i]==0) {
    i--;
  }

  for (;i>=0;i--) {
    printf("%d",ans[i]);
  }
  return 0;
}
0