結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー yuruhiyayuruhiya
提出日時 2020-04-09 21:43:01
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 4,532 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 200,516 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 22:47:35
合計ジャッジ時間 4,176 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
using ll = long long;

#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#define putchar_unlocked _putchar_nolock
#define fwrite_unlocked _fwrite_nolock
#define fflush_unlocked _fflush_nolock
#endif
inline int gc() { return getchar_unlocked(); }
template<class T>inline void InputF(T& v) { cin >> v; }
inline void InputF(char& v) { while (isspace(v = gc())); }
inline void InputF(bool& v) { char c; InputF(c); v = c == '1'; }
inline void InputF(string& v) {
	char c; for (InputF(c); !isspace(c); c = gc())v += c;
}
inline void InputF(int& v) {
	bool neg = false; v = 0; char c; InputF(c);
	if (c == '-') { neg = true; c = gc(); }
	for (; isdigit(c); c = gc())v = v * 10 + (c - '0');
	if (neg)v = -v;
}
inline void InputF(long long& v) {
	bool neg = false; v = 0; char c; InputF(c);
	if (c == '-') { neg = true; c = gc(); }
	for (; isdigit(c); c = gc())v = v * 10 + (c - '0');
	if (neg)v = -v;
}
inline void InputF(double& v) {
	double dp = 1; bool neg = false, adp = false; v = 0; char c; InputF(c);
	if (c == '-') { neg = true; c = gc(); }
	for (; isdigit(c) || c == '.'; c = gc()) {
		if (c == '.')adp = true;
		else if (adp)v += (c - '0') * (dp *= 0.1);
		else v = v * 10 + (c - '0');
	}
	if (neg)v = -v;
}
template<class T, class U>inline void InputF(pair<T, U>& v) {
	InputF(v.first); InputF(v.second);
}
template<class T>inline void InputF(vector<T>& v) {
	for (auto& e : v)InputF(e);
}
template<class T>inline T InputF() { T v; InputF(v); return v; }
struct InputV {
	int n, m;
	InputV(int N) :n(N), m(0) {}
	InputV(pair<int, int> N) :n(N.first), m(N.second) {}
	template<class T>operator vector<T>() {
		vector<T> v(n); InputF(v); return v;
	}
	template<class T>operator vector<vector<T>>() {
		vector<vector<T>> v(n, vector<T>(m)); InputF(v); return v;
	}
};
struct Input {
	template<class T>operator T() { return InputF<T>(); }
	int operator--(int) { int v; InputF(v); v--; return v; }
	InputV operator[](int n) { return InputV(n); }
	InputV operator[](pair<int, int> n) { return InputV(n); }
	void operator()() {}
	template<class H, class...T>void operator()(H&& h, T&& ...t) {
		InputF(h); operator()(forward<T>(t)...);
	}
	template<class T>Input& operator,(T&& v) {
		InputF(v); return *this;
	}
}in;

struct BoolStr {
	const char* t, * f; BoolStr(const char* _t, const char* _f) :t(_t), f(_f) {}
}Yes("Yes", "No"), yes("yes", "no"), YES("YES", "NO"), Int("1", "0");
struct DivStr {
	const char* d, * l; DivStr(const char* _d, const char* _l) :d(_d), l(_l) {}
}spc(" ", "\n"), no_spc("", "\n"), end_line("\n", "\n"), comma(",", "\n"), no_endl(" ", "");
struct Output {
	BoolStr B{ Yes }; DivStr D{ spc };
	void p(int v) {
		if (v < 0)putchar_unlocked('-'), v = -v;
		char b[10]; int n = 0;
		while (v)b[n++] = '0' + v % 10, v /= 10;
		if (!n)b[n++] = 0;
		while (n--)putchar_unlocked(b[n]);
	}
	void p(ll v) {
		if (v < 0)putchar_unlocked('-'), v = -v;
		char b[20]; int n = 0;
		while (v)b[n++] = '0' + v % 10, v /= 10;
		if (!n)b[n++] = 0;
		while (n--)putchar_unlocked(b[n]);
	}
	void p(bool v) { p(v ? B.t : B.f); }
	void p(char v) { putchar_unlocked(v); }
	void p(const char* v) { fwrite_unlocked(v, 1, strlen(v), stdout); }
	void p(double v) { printf("%.20f", v); }
	void p(long double v) { printf("%.20Lf", v); }
	template<class T> void p(const T& v) { cout << v; }
	template<class T, class U>void p(const pair<T, U>& v) { p(v.first); p(D.d); p(v.second); }
	template<class T>void p(const vector<T>& v) { rep(i, sz(v)) { if (i)p(D.d); p(v[i]); } }
	template<class T>void p(const vector<vector<T>>& v) { rep(i, sz(v)) { if (i)p(D.l); p(v[i]); } }
	Output& operator()() { p(D.l); return *this; }
	template<class H>Output& operator()(H&& h) { p(h); p(D.l); return *this; }
	template<class H, class...T>Output& operator()(H&& h, T&& ...t) {
		p(h); p(D.d); return operator()(forward<T>(t)...);
	}
	template<class...T>void exit(T&& ...t) { operator()(forward<T>(t)...); std::exit(EXIT_SUCCESS); }
	Output& flush() { fflush_unlocked(stdout); return *this; }
	Output& set(const BoolStr& b) { B = b; return *this; }
	Output& set(const DivStr& d) { D = d; return *this; }
	Output& set(const char* t, const char* f) { B = BoolStr(t, f); return *this; }
}out;

int main() {
	int n = in;
	FOR(i, 1, n)FOR(j, i, n) {
		int k = n - i - j;
		if (j > k)break;
		out.p(i);
		putchar_unlocked(' ');
		out.p(j);
		putchar_unlocked(' ');
		out.p(k);
		putchar_unlocked('\n');
	}
}
0