結果
| 問題 |
No.796 well known
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-14 00:05:32 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 752 bytes |
| コンパイル時間 | 1,444 ms |
| コンパイル使用メモリ | 169,080 KB |
| 実行使用メモリ | 17,600 KB |
| 最終ジャッジ日時 | 2024-12-17 19:51:35 |
| 合計ジャッジ時間 | 42,913 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 TLE * 13 |
ソースコード
/**
@file 796.cpp
@title No.796 well known - yukicoder
@url https://yukicoder.me/problems/no/796
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
template <class T>
void show(vector<T>& v) {
for (size_t i = 0; i < v.size(); i++) {
cout << v[i] << " ";
}
cout << "\n";
}
int main() {
int N;
cin >> N;
vector<int> num(N, 3);
int sum = 3 * N;
int pro = pow(3, N);
int limit = 312456;
while (1) {
if (sum % 3 == 1 && pro % 3 == 0 && sum <= limit) {
show(num);
break;
} else {
num[0]++;
sum++;
pro *= ((double)num[0] / (double)(num[0] - 1));
}
}
return 0;
}