結果
問題 |
No.2358 xy+yz+zx=N
|
ユーザー |
![]() |
提出日時 | 2023-06-29 19:07:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 507 bytes |
コンパイル時間 | 1,941 ms |
コンパイル使用メモリ | 195,948 KB |
最終ジャッジ日時 | 2025-02-15 03:08:30 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ int N, ans=0; cin >> N; vector<vector<int>> v; for (int x=0; x<=N; x++){ for (int y=0; y<=N/x; y++){ if (x == 0 && y == 0) continue; if (N-x*y >= 0 && (N-x*y)%(x+y) == 0){ v.push_back({x, y, (N-x*y)/(x+y)}); } } } cout << v.size() << '\n'; for (auto &x : v) cout << x[0] << " " << x[1] << " " << x[2] << '\n'; return 0; }