結果
問題 | No.522 Make Test Cases(テストケースを作る) |
ユーザー |
![]() |
提出日時 | 2017-06-02 22:38:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1,839 ms / 2,000 ms |
コード長 | 1,399 bytes |
コンパイル時間 | 991 ms |
コンパイル使用メモリ | 72,528 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-22 02:07:12 |
合計ジャッジ時間 | 4,907 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
#include <algorithm>#include <iomanip>#include <istream>#include <map>#include <numeric>#include <ostream>#include <set>#include <sstream>#include <string>#include <utility>#include <vector>using namespace std;// Powered by caide (code generator, tester, and library code inliner)class Solution {public:void solve(std::istream& in, std::ostream& out) {int n;in >> n;for (int i = 1; i <= n; i++){for (int j = i; j <= n; j++){if (i + j >= n){break;}for (int k = j; k <= n; k++){if (i + j + k == n){out << i << " " << j << " " << k << endl;}else if (i + j + k > n){break;}}}}}};void solve(std::istream& in, std::ostream& out){out << std::setprecision(12);Solution solution;solution.solve(in, out);}#include <fstream>#include <iostream>int main() {ios_base::sync_with_stdio(0);cin.tie(0);istream& in = cin;ostream& out = cout;solve(in, out);return 0;}