結果
問題 |
No.522 Make Test Cases(テストケースを作る)
|
ユーザー |
|
提出日時 | 2024-12-12 15:56:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,213 ms / 2,000 ms |
コード長 | 766 bytes |
コンパイル時間 | 4,799 ms |
コンパイル使用メモリ | 238,432 KB |
実行使用メモリ | 15,824 KB |
最終ジャッジ日時 | 2024-12-12 15:56:18 |
合計ジャッジ時間 | 10,620 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:29:17: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions] 29 | for(auto[a,b,c]:ans)cout<<a<<" "<<b<<" "<<c<<endl; | ^
ソースコード
#include<bits/stdc++.h> #include <atcoder/all> #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif using namespace atcoder; using mint=modint998244353; using namespace std; using ll=long long; using ul=unsigned long long; int dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0}; int dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0}; using Graph=vector<vector<int>>; ll op(ll a,ll b){return min(a,b);} ll e(){return 2e9;} int main(){ int N; cin>>N; vector<tuple<int,int,int>>ans; for(int i=1;i<=N;i++){ for(int j=1;i+j<=N;j++){ if(i<=j&&j<=(N-i-j))ans.push_back({i,j,N-i-j}); } } sort(ans.begin(),ans.end()); for(auto[a,b,c]:ans)cout<<a<<" "<<b<<" "<<c<<endl; }