結果
問題 |
No.2246 1333-like Number
|
ユーザー |
![]() |
提出日時 | 2024-08-10 19:07:10 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 769 bytes |
コンパイル時間 | 2,876 ms |
コンパイル使用メモリ | 246,756 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-08-10 19:07:14 |
合計ジャッジ時間 | 3,900 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i<n; ++i) #define repl(i,m,n) for(ll i=m; i<n; ++i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() int main(){ int N; cin >> N; vector<pair<int,int>> p; for(int a = 1; a <= 9; ++a){ for(int b = a+1; b <= 9; ++b){ p.push_back({a, b}); } } if(N % 36 == 0){ int cnt = N/36; cout << p.back().first << p.back().second; rep(i, 0, cnt-1) cout << p.back().second; cout << endl; }else{ int i = N % 36 - 1, cnt = N/36; cout << p[i].first << p[i].second; rep(j, 0, cnt) cout << p[i].second; cout << endl; } return 0; }