結果
| 問題 | No.3487 Restricted Shiritori |
| コンテスト | |
| ユーザー |
SnowBeenDiding
|
| 提出日時 | 2026-04-01 21:21:35 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 626 bytes |
| 記録 | |
| コンパイル時間 | 6,414 ms |
| コンパイル使用メモリ | 417,920 KB |
| 実行使用メモリ | 424,192 KB |
| 最終ジャッジ日時 | 2026-04-01 21:22:07 |
| 合計ジャッジ時間 | 7,774 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;
typedef long long ll;
void solve() {
char s, h;
int n;
cin >> s >> h >> n;
if (n == 1 && s != h) {
cout << "-1\n";
return;
}
string ans;
ans += s;
while (ans.size() < n) ans += h;
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
solve();
}
SnowBeenDiding