結果
問題 |
No.2358 xy+yz+zx=N
|
ユーザー |
|
提出日時 | 2023-06-23 21:51:31 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 812 bytes |
コンパイル時間 | 2,976 ms |
コンパイル使用メモリ | 248,464 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 17:29:34 |
合計ジャッジ時間 | 4,716 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.hpp" #else #define debug(...) 1 #endif const int MX = 3300; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<tuple<int, int, int>> ans; for (int x = 0; x <= MX; x++) { for (int y = 0; y <= MX; y++) { if (x == 0 && y == 0) { continue; } if (n - x * y < 0) { continue; } if ((n - x * y) % (x + y) == 0) { ans.emplace_back(x, y, (n - x * y) / (x + y)); } } } cout << ans.size() << '\n'; for (int i = 0; i < (int) ans.size(); i++) { cout << get<0>(ans[i]) << ' ' << get<1>(ans[i]) << ' ' << get<2>(ans[i]) << '\n'; } }