結果

問題 No.2358 xy+yz+zx=N
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-06-29 19:07:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 507 bytes
コンパイル時間 2,131 ms
コンパイル使用メモリ 202,320 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-20 14:13:10
合計ジャッジ時間 6,121 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0