結果
| 問題 |
No.381 名声値を稼ごう Extra
|
| コンテスト | |
| ユーザー |
kuuso1
|
| 提出日時 | 2016-06-18 22:09:07 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,572 bytes |
| コンパイル時間 | 1,299 ms |
| コンパイル使用メモリ | 114,556 KB |
| 実行使用メモリ | 60,512 KB |
| 最終ジャッジ日時 | 2024-10-09 20:39:04 |
| 合計ジャッジ時間 | 10,498 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
using BI = System.Numerics.BigInteger;
class TEST{
static void Main(){
Sol mySol =new Sol();
mySol.Solve();
}
}
class Sol{
public void Solve(){
int W = 100;
BI carry = 1;
for(int i=0;i<W;i++){
carry *= 10;
}
String pad = "";
while((S.Length + pad.Length)%W != 0)pad += "0";
S = pad + S;
int N = S.Length;
int NN = N/W;
BI[] dp = new BI[NN];
for(int i=0;i<NN;i++){
dp[i] = BI.Parse(S.Substring(i*W,W));
}
//Console.WriteLine("{0} {1}",S,String.Join(" ",dp));
int t = 0;
int cnt = 0;
while(true){
for(int i=t;i<NN-1;i++){
if( (dp[i] & 1) == 1 )dp[i+1] += carry;
dp[i] >>= 1;
}
if((dp[NN-1] & 1 ) == 1)cnt++;
dp[NN-1] >>= 1;
if(dp[t] == 0)t++;
if(t==NN)break;
}
Console.WriteLine(cnt);
}
String S;
public Sol(){
S = rs();
}
static String rs(){return Console.ReadLine();}
static int ri(){return int.Parse(Console.ReadLine());}
static long rl(){return long.Parse(Console.ReadLine());}
static double rd(){return double.Parse(Console.ReadLine());}
static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
kuuso1