結果

問題 No.2748 Strange Clock
ユーザー ponjuice
提出日時 2024-04-19 14:09:05
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,540 bytes
コンパイル時間 2,073 ms
コンパイル使用メモリ 200,068 KB
最終ジャッジ日時 2025-02-21 03:20:02
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const vector<vector<ll>> ch = {
{},
{1, 10},
{1, 142},
{1, 286, 1438, 1726},
{1, 5470, 15262, 20734},
{1, 15262, 26206, 41470, 192094, 207358, 233566, 248830}, // 5
{1, 264094, 705022, 2016862, 2280958, 2721886, 2985982},
{1, 3250078, 5971966, 9222046, 20637790, 26609758, 29859838, 35831806},
{1, 80885662, 182409118, 194353054, 235628638, 247572574, 349096030, 429981694},
{1, 859963390, 4299816958, 5159780350},
{1, 16339304446, 45578059774, 61917364222}, // 10
{1, 123834728446, 619173642238, 743008370686},
{1, 2105190383614, 6810910064638, 8916100448254},
{1, 17832200896510, 89161004482558, 106993205379070},
{1, 1283918464548862},
{1, 2567836929097726, 12839184645488638, 15407021574586366} // 15
};
const vector<vector<ll>> cnt = {
{},
{2, 1},
{6, 3},
{18, 3, 3, 3},
{54, 6, 6, 15},
{162, 18, 6, 15, 6, 15, 6, 15}, // 5
{486, 18, 54, 12, 42, 6, 111},
{1458, 18, 243, 18, 18, 18, 207, 207},
{4374, 108, 18, 18, 18, 18, 108, 1899},
{13122, 2187, 2187, 2187},
{39366, 4374, 4374, 10935}, // 10
{118098, 19683, 19683, 19683},
{354294, 39366, 39366, 98415},
{1062882, 177147, 177147, 177147},
{3188646, 1594323},
{9565938, 1594323, 1594323, 1594323}
};
int main(){
ll n, m;
cin >> n >> m;
ll ans = 0;
for (int i = 0; i < (int)ch[n].size(); i++) {
if(ch[n][i] > m) ans += cnt[n][i];
}
cout << ans << endl;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0