結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー ゆにぽけゆにぽけ
提出日時 2023-10-21 15:26:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 193 ms / 2,000 ms
コード長 775 bytes
コンパイル時間 1,296 ms
コンパイル使用メモリ 133,044 KB
実行使用メモリ 16,012 KB
最終ジャッジ日時 2023-10-21 15:27:02
合計ジャッジ時間 3,610 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,348 KB
testcase_01 AC 8 ms
4,348 KB
testcase_02 AC 7 ms
4,348 KB
testcase_03 AC 15 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 11 ms
4,348 KB
testcase_10 AC 193 ms
16,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<cmath>
#include<ctime>
#include<iomanip>
#include<numeric>
#include<stack>
#include<queue>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<bitset>
#include<random>
using namespace std;
int N;
void solve()
{
	cin >> N;
	vector<pair<int,pair<int,int>>> vp;
	for(int i = 1;i <= N;i++)for(int j = i;j <= N && j <= N-i-j;j++) vp.push_back(make_pair(i,make_pair(j,N-i-j)));
	sort(vp.begin(),vp.end());
	for(int i = 0;i < (int)vp.size();i++) cout << vp[i].first << " " << vp[i].second.first << " " << vp[i].second.second << "\n";
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int tt = 1;
	//cin >> tt;
	while(tt--) solve();
}
0