結果
問題 | No.689 E869120 and Constructing Array 3 |
ユーザー |
![]() |
提出日時 | 2018-05-18 23:18:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 9 ms / 1,000 ms |
コード長 | 666 bytes |
コンパイル時間 | 2,040 ms |
コンパイル使用メモリ | 192,904 KB |
最終ジャッジ日時 | 2025-01-05 10:40:03 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main() {int K;cin >> K;vector< int > ans;for(int i = 1; i <= 100; i++) {for(int j = 1; j <= 100; j++) {for(int k = 1; k <= 100; k++) {for(int l = 1; l <= 100; l++) {if(i + j + k + l > 250) continue;if(i * j + k * l == K) {cout << i + j + k + l << endl;for(int p = 0; p < i; p++) cout << 3 << " ";for(int p = 0; p < j; p++) cout << 4 << " ";for(int p = 0; p < k; p++) cout << 5 << " ";for(int p = 0; p < l; p++) cout << 6 << " ";return 0;}}}}}}