結果
問題 |
No.1318 ABCD quadruplets
|
ユーザー |
👑 ![]() |
提出日時 | 2020-07-12 04:03:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 695 bytes |
コンパイル時間 | 3,354 ms |
コンパイル使用メモリ | 219,884 KB |
最終ジャッジ日時 | 2025-01-11 19:55:03 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 TLE * 5 |
ソースコード
#pragma GCC target("avx") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; using uint = uint32_t; int main(){ uint n, m; cin >> n >> m; uint ans[1600001] = {}; for(uint a = 0, x1 = 0; a <= m; a++, x1 += (a << 1) - 1){ for(uint b = 0, x2 = x1, y2 = a; b <= m && x2 <= n; b++, x2 += a + (b << 1) - 1, y2++){ for(uint c = 0, x3 = x2, y3 = y2; c <= m && x3 <= n; c++, x3 += y2 + (c << 1) - 1, y3++){ for(uint d = 0, x4 = x3; d <= m && x4 <= n; d++, x4 += y3 + (d << 1) - 1){ ans[x4]++; } } } } for(uint i = 0; i <= n; i++) printf("%u\n", ans[i]); }