結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー mogurockermogurocker
提出日時 2017-10-16 00:35:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 660 bytes
コンパイル時間 1,460 ms
コンパイル使用メモリ 162,420 KB
実行使用メモリ 22,748 KB
最終ジャッジ日時 2024-04-28 22:12:41
合計ジャッジ時間 7,901 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
typedef pair<int, int> P;

int n;

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> n;
	vector<pair<int, P> > v;
	for (int c = 1; c <= n; c++) {
		for (int b = 1; b <= c; b++) {
			for (int a = 1; a <= b; a++) {
				if (a+b+c==n) v.push_back({a, {b, c}});
			}
		}
	}
	FOR(i, v.size()) cout << v[i].first << " " << v[i].second.first << " " << v[i].second.second << endl;
	return 0;
}
0