結果
| 問題 |
No.83 最大マッチング
|
| コンテスト | |
| ユーザー |
babumideep
|
| 提出日時 | 2020-08-04 02:32:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,271 bytes |
| コンパイル時間 | 2,777 ms |
| コンパイル使用メモリ | 196,852 KB |
| 最終ジャッジ日時 | 2025-01-12 14:10:02 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 WA * 6 |
ソースコード
#include <bits/stdc++.h>
#define ll long long
#define pi (acos(-1))
#define rep(i, n) for (unsigned long long i = 0; i < (unsigned long long)(n); ++i)
using namespace std;
std::vector<unsigned ll> genprimevec(const unsigned ll N);
int main()
{
int n;
cin >> n;
if (n == 2)
{
cout << 1 << endl;
return 0;
}
if (n == 3)
{
cout << 7 << endl;
return 0;
}
if (n % 2 == 0)
{
rep(i, (n / 2)) { cout << 1; }
cout << endl;
return 0;
}
cout<<7<<endl;
rep(i, (n / 2) - 1) { cout << 1; }
return 0;
}
/*author https://qiita.com/drken/items/0c88a37eec520f82b788*/
ll extgcd(ll a, ll b, ll &x, ll &y)
{
if (b == 0)
{
x = 1, y = 0;
return a;
}
ll d = extgcd(b, a % b, y, x);
y -= a / b * x;
return d;
}
std::vector<unsigned ll> genprimevec(const unsigned ll N)
{
std::vector<bool> is_prime(N + 1);
for (unsigned ll i = 0; i <= N; i++) { is_prime[i] = true; }
std::vector<unsigned ll> P;
for (unsigned ll i = 2; i <= N; i++)
{
if (is_prime[i])
{
for (unsigned ll j = 2 * i; j <= N; j += i) { is_prime[j] = false; }
P.emplace_back(i);
}
}
return P;
}
babumideep