結果

問題 No.2246 1333-like Number
ユーザー zezerozezero
提出日時 2023-03-17 22:09:53
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 788 bytes
コンパイル時間 3,146 ms
コンパイル使用メモリ 168,608 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-18 11:13:57
合計ジャッジ時間 3,920 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
  int n;
  cin >> n;
  n--;
  int x = n/36;
  int y = n%36;
  string ans;
  int a = 0;
  int b = 0;
  int cnt = 0;
  for (int i = 1; i <= 9;i++){
    for (int j = 1; j <= 9;j++){
      if (i >= j) continue;
      if (cnt == y){
        ans = to_string(10*i+j);
        a = i;
        b = j;
      }
      //cout << 10*i+j << endl;
      cnt++;
    }
  }
  for (int i = 0; i < x;i++){
    ans += to_string(b);
  }
  cout << ans << endl;
  

  return 0;
}
0