結果
問題 | No.1729 ~サンプルはちゃんと見て!~ 16進数と8進数(1) |
ユーザー |
![]() |
提出日時 | 2021-11-05 21:36:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 1,616 ms |
コンパイル使用メモリ | 170,472 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-06 12:21:17 |
合計ジャッジ時間 | 2,505 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1000000007; using P = pair<int,int>; #define rep(i, n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() int main(){ string s; cin >> s; vector<int> cnt(8,0); int n = s.size(); reverse(all(s)); int now = 0; rep(i,(n+3)/4){ int p = 0; for(int j=0;now<n && j<4;j++){ p += (10 + s[now++]-'A') * pow(16,j); } while(p){ cnt[p%8]++; p /= 8; } } int x = *max_element(all(cnt)); rep(i,8) if(cnt[i]==x) cout << i << " "; cout << endl; return 0; }