結果

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

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
using vii = vector<vector<int>>;
using vll = vector<vector<ll>>;
#define ALL(x) (x).begin(), (x).end()
#define coutY cout << "Yes" << endl;
#define coutN cout << "No" << endl;
#define arrIn(arr, start, N) for (ll i = (start); i < (N); ++i) cin >> arr[i];
#define arrOut(arr, start, N) for  (ll i = (start); i < (N); ++i) { cout << arr[i] <<" "; } cout << endl;
#define UNIQUE(A) sort(ALL(A)); A.erase(unique(ALL(A)),A.end());
#define mod9 998244353
#define mod1 1000000007
void yn(bool tf) { cout << (tf ? "Yes\n" : "No\n"); }
void YN(bool tf) { cout << (tf ? "YES\n" : "NO\n"); }
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string abc="abcdefghijklmnopqrstuvwxyz";
vi dx={0,-1,1,0};
vi dy={-1,0,0,1};
vi ddx={-1,0,1,-1,1,-1,0,1};
vi ddy={-1,-1,-1,0,0,1,1,1};

template<class T>
using priority_queueR = priority_queue<T, vector<T>, greater<T>>;

//cout << fixed << setprecision(20) <<

bool kaibun(string S){
  string T=S;
  reverse(ALL(S));
  return S==T;
}

int ketawa(int x){
  string S=to_string(x);
  int sum=0;
  int len=S.size();
  for(int i=0;i<len;i++){
    sum+=(int)(S[i]-'0');
  }
  return sum;
}

auto start = high_resolution_clock::now();

bool CheckTime(auto limit,auto eps){
  auto end = high_resolution_clock::now();
  return  duration_cast<milliseconds>(end - start).count()<limit-eps;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  char s,e;
  int N;
  cin >> s >> e >> N;
  if(N==1){
    cout << -1 << endl;
  }else{
    cout << s;
    for(int i=0;i<N-2;i++){
      cout << 'a';
    }
    cout << e << endl;
  }
 
  return 0;
}
0