結果
| 問題 |
No.1089 三変数方程式
|
| ユーザー |
ManjushriMitra
|
| 提出日時 | 2024-07-27 13:01:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 700 bytes |
| コンパイル時間 | 1,926 ms |
| コンパイル使用メモリ | 174,168 KB |
| 実行使用メモリ | 171,424 KB |
| 最終ジャッジ日時 | 2024-07-27 13:01:39 |
| 合計ジャッジ時間 | 6,271 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 TLE * 1 -- * 13 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:19:22: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
19 | for(auto [i, j, k] : per){
| ^
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,m,n) for(int i=m; i<n; ++i)
#define repl(i,m,n) for(ll i=m; i<n; ++i)
int main(){
int N;
cin >> N;
set<array<int, 3>> st;
vector<array<int, 3>> per = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2},
{1, 2, 0}, {2, 0, 1}, {2, 1, 0}};
for(int x = 0; x <= N; ++x){
for(int y = 0; x + y <= N; ++y){
int z = N - x - y;
if(z < 0) continue;
array<int, 3> tmp = {x, y, z};
for(auto [i, j, k] : per){
st.insert({tmp[i], tmp[j], tmp[k]});
}
}
}
cout << st.size() << endl;
return 0;
}
ManjushriMitra