結果
問題 | No.420 mod2漸化式 |
ユーザー | mayoko_ |
提出日時 | 2016-09-09 22:31:33 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 2,786 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 98,256 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-06 17:59:21 |
合計ジャッジ時間 | 1,574 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 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 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 1 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 1 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
testcase_22 | AC | 1 ms
5,376 KB |
testcase_23 | AC | 1 ms
5,376 KB |
testcase_24 | AC | 2 ms
5,376 KB |
testcase_25 | AC | 2 ms
5,376 KB |
testcase_26 | AC | 2 ms
5,376 KB |
testcase_27 | AC | 2 ms
5,376 KB |
testcase_28 | AC | 2 ms
5,376 KB |
testcase_29 | AC | 2 ms
5,376 KB |
testcase_30 | AC | 1 ms
5,376 KB |
testcase_31 | AC | 2 ms
5,376 KB |
testcase_32 | AC | 2 ms
5,376 KB |
testcase_33 | AC | 2 ms
5,376 KB |
testcase_34 | AC | 2 ms
5,376 KB |
testcase_35 | AC | 1 ms
5,376 KB |
ソースコード
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> //#include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> //#include<list> #include<queue> #include<deque> #include<algorithm> //#include<numeric> #include<utility> //#include<memory> #include<functional> #include<cassert> #include<set> #include<stack> #include<random> const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, -1, 0, 1}; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; int cnt[33]; ll sum[33]; int main() { // for (ll x = 0; x < 1ll<<31; x++) { // int t = __builtin_popcountll(x); // cnt[t]++; // sum[t] += x; // } // for (int t = 0; t <= 32; t++) { // printf("cnt[%d] = %d;\n", t, cnt[t]); // printf("sum[%d] = %lld;\n", t, sum[t]); // } cnt[0] = 1; sum[0] = 0; cnt[1] = 31; sum[1] = 2147483647; cnt[2] = 465; sum[2] = 64424509410; cnt[3] = 4495; sum[3] = 934155386445; cnt[4] = 31465; sum[4] = 8718783606820; cnt[5] = 169911; sum[5] = 58851789346035; cnt[6] = 736281; sum[6] = 306029304599382; cnt[7] = 2629575; sum[7] = 1275122102497425; cnt[8] = 7888725; sum[8] = 4371847208562600; cnt[9] = 20160075; sum[9] = 12569060724617475; cnt[10] = 44352165; sum[10] = 30724370660176050; cnt[11] = 84672315; sum[11] = 64521178386369705; cnt[12] = 141120525; sum[12] = 117311233429763100; cnt[13] = 206253075; sum[13] = 185742786263791575; cnt[14] = 265182525; sum[14] = 257182319442172950; cnt[15] = 300540195; sum[15] = 312292816465495725; cnt[16] = 300540195; sum[16] = 333112337563195440; cnt[17] = 265182525; sum[17] = 312292816465495725; cnt[18] = 206253075; sum[18] = 257182319442172950; cnt[19] = 141120525; sum[19] = 185742786263791575; cnt[20] = 84672315; sum[20] = 117311233429763100; cnt[21] = 44352165; sum[21] = 64521178386369705; cnt[22] = 20160075; sum[22] = 30724370660176050; cnt[23] = 7888725; sum[23] = 12569060724617475; cnt[24] = 2629575; sum[24] = 4371847208562600; cnt[25] = 736281; sum[25] = 1275122102497425; cnt[26] = 169911; sum[26] = 306029304599382; cnt[27] = 31465; sum[27] = 58851789346035; cnt[28] = 4495; sum[28] = 8718783606820; cnt[29] = 465; sum[29] = 934155386445; cnt[30] = 31; sum[30] = 64424509410; cnt[31] = 1; sum[31] = 2147483647; cnt[32] = 0; sum[32] = 0; int x; cin >> x; if (x > 32) cout << 0 << " " << 0 << endl; else cout << cnt[x] << " " << sum[x] << endl; return 0; }