結果

問題 No.3487 Restricted Shiritori
コンテスト
ユーザー daiota
提出日時 2026-04-01 21:26:04
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 411 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,360 ms
コンパイル使用メモリ 209,624 KB
実行使用メモリ 215,896 KB
最終ジャッジ日時 2026-04-01 21:27:05
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
















int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	ll i,j;




	ll N;
	char s,e;
	cin >> s >> e >> N;

	if(N==1){
		cout << -1 << endl;
		return 0;
	}

	string x;
	x+=s;
	REP(i,N-2) x+=s;
	x+=e;


	cout << x << endl;










	return 0;

}
0