結果

問題 No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1)
ユーザー Josué RoblesJosué Robles
提出日時 2021-11-05 22:16:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 746 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 65,012 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-24 06:05:19
合計ジャッジ時間 4,207 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,576 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie();
    cout.tie();
    unsigned long long total=0, temp=1, maximo=0;
    string palabra;
    long long int lista[8]={};
    cin>>palabra;
    for(int i=palabra.size()-1; i>=0; --i){
      char letra=palabra[i];
      total+=(letra-55)*temp;
      temp*=16;
    }
    temp=1;
    for(temp=1; temp<total; temp*=8);
    if(temp>total){
      temp/=8;
    }
    for(int i; temp>0 && total>0; temp/=8){
      i=total/temp;
      total%=temp;
      if(i>0){
        lista[i-1]++;
      }
      if(maximo<lista[i-1]){
        maximo=lista[i-1];
      }
    }
    for(int i=0; i<8; ++i){
      if(lista[i]==maximo){
        cout<<i+1<<' ';
      }
    }
}
0