結果
問題 | No.2198 Concon Substrings (COuNt-CONstruct Version) |
ユーザー | akiaa11 |
提出日時 | 2023-08-24 18:25:09 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 3,285 bytes |
コンパイル時間 | 4,267 ms |
コンパイル使用メモリ | 262,792 KB |
実行使用メモリ | 817,792 KB |
最終ジャッジ日時 | 2024-12-23 03:00:30 |
合計ジャッジ時間 | 87,519 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | AC | 2 ms
5,248 KB |
testcase_04 | AC | 2 ms
5,248 KB |
testcase_05 | RE | - |
testcase_06 | MLE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | MLE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | MLE | - |
testcase_18 | RE | - |
testcase_19 | MLE | - |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | MLE | - |
testcase_25 | RE | - |
testcase_26 | RE | - |
testcase_27 | MLE | - |
testcase_28 | RE | - |
testcase_29 | RE | - |
testcase_30 | RE | - |
testcase_31 | RE | - |
testcase_32 | MLE | - |
testcase_33 | WA | - |
testcase_34 | RE | - |
testcase_35 | MLE | - |
testcase_36 | MLE | - |
testcase_37 | MLE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | MLE | - |
testcase_41 | RE | - |
testcase_42 | MLE | - |
testcase_43 | RE | - |
testcase_44 | MLE | - |
testcase_45 | MLE | - |
testcase_46 | MLE | - |
testcase_47 | MLE | - |
testcase_48 | RE | - |
testcase_49 | RE | - |
testcase_50 | MLE | - |
testcase_51 | MLE | - |
testcase_52 | MLE | - |
testcase_53 | MLE | - |
testcase_54 | RE | - |
testcase_55 | RE | - |
testcase_56 | MLE | - |
testcase_57 | RE | - |
testcase_58 | RE | - |
testcase_59 | MLE | - |
testcase_60 | MLE | - |
testcase_61 | RE | - |
testcase_62 | RE | - |
testcase_63 | MLE | - |
testcase_64 | RE | - |
testcase_65 | RE | - |
testcase_66 | RE | - |
testcase_67 | MLE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | MLE | - |
testcase_72 | MLE | - |
testcase_73 | MLE | - |
testcase_74 | MLE | - |
testcase_75 | TLE | - |
testcase_76 | MLE | - |
testcase_77 | RE | - |
testcase_78 | RE | - |
testcase_79 | MLE | - |
testcase_80 | RE | - |
testcase_81 | MLE | - |
testcase_82 | RE | - |
testcase_83 | MLE | - |
testcase_84 | MLE | - |
testcase_85 | MLE | - |
testcase_86 | RE | - |
testcase_87 | RE | - |
testcase_88 | MLE | - |
testcase_89 | MLE | - |
testcase_90 | RE | - |
testcase_91 | RE | - |
testcase_92 | MLE | - |
testcase_93 | RE | - |
testcase_94 | RE | - |
testcase_95 | RE | - |
testcase_96 | MLE | - |
testcase_97 | RE | - |
testcase_98 | RE | - |
testcase_99 | RE | - |
testcase_100 | RE | - |
testcase_101 | MLE | - |
testcase_102 | MLE | - |
testcase_103 | MLE | - |
testcase_104 | MLE | - |
testcase_105 | RE | - |
testcase_106 | MLE | - |
testcase_107 | RE | - |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>#define SELECTER(_1,_2,_3,SELECT,...) SELECT#define rep1(i,n) for(int i=0;i<(int)n;++i)#define rep2(i,a,n) for(int i=(int)a;i<(int)n;++i)#define rep(...) SELECTER(__VA_ARGS__,rep2,rep1)(__VA_ARGS__)#define RSELECTER(_1, _2, _3, RSELECT, ...) RSELECT#define rrep1(i,n) for(int i=(int)n-1;i>=0;--i)#define rrep2(i,a,n) for(int i=(int)n-1;i>=(int)a;--i)#define rrep(...) RSELECTER(__VA_ARGS__, rrep2, rrep1)(__VA_ARGS__)#define all(a) a.begin(),a.end()#define rall(a) a.rbegin(),a.rend()#define fi first#define se second#define PrintR LogOutput#ifdef _DEBUG#define Log(...) LogOutput(__VA_ARGS__)#else#define Log(...)#endifusing namespace std;using namespace atcoder;using ll=long long;using pii=pair<int,int>;using pll=pair<long long,long long>;using pdd=pair<long double,long double>;using veci=vector<int>;using vecpii=vector<pair<int,int>>;using vecll=vector<long long>;using vecpll=vector<pair<long long,long long>>;using vecpdd=vector<pair<long double,long double>>;using vecs=vector<string>;using vecb=vector<bool>;using vecd=vector<long double>;using tp=tuple<int,int,int>;using tpll=tuple<ll,ll,ll>;using mint=modint998244353;using mint10=modint1000000007;template<typename T, typename S>istream& operator>>(istream& in, pair<T, S>& a){return in >> a.first >> a.second;}template<typename T, typename S>ostream& operator<<(ostream& out, const pair<T, S>& a){return out << a.first << ' ' << a.second;}ostream& operator<<(ostream& out, const mint& a){return out << a.val();}ostream& operator<<(ostream& out, const mint10& a){return out << a.val();}ostream& operator<<(ostream& out, const modint& a){return out << a.val();}template<typename T>ostream& operator<<(ostream& out, const vector<T>& d){for(int i = 0 ; i < d.size() ; ++i) out << d[i] << (i == d.size() - 1 ? "" : " "); return out;}template<typename T, typename S>pair<T, S> operator+(const pair<T, S>& a, const pair<T, S>& b){return {a.fi + b.fi, a.se + b.se};}template<typename T, typename S>pair<T, S> operator-(const pair<T, S>& a, const pair<T, S>& b){return {a.fi - b.fi, a.se - b.se};}template<class T> inline bool chmax(T& a,T b){if(a<b) {a=b;return true;} return false;}template<class T> inline bool chmin(T& a,T b){if(a>b) {a=b;return true;} return false;}bool Judge(int i, int j, int h, int w){return i < 0 || j < 0 || i >= h || j >= w;}constexpr ll INF=numeric_limits<ll>::max() / 4;constexpr ll MOD=998244353;const int vi[] = {0, 1, 0, -1}, vj[] = {1, 0, -1, 0};template<typename... Args>void LogOutput(Args&&... args){stringstream ss;((ss << args << ' '), ...);cout << ss.str().substr(0, ss.str().length() - 1) << endl;}template<typename T>void LogOutput(vector<vector<T>>& data){for(auto d : data) LogOutput(d);}int main(){ios::sync_with_stdio(false);std::cin.tie(nullptr);ll n;cin>>n;if(n == 0){cout<<"a"<<endl;return 0;}veci a(20000);a[0] = 0;ll s = 0;rep(i, 1, 20000){a[i] = i + a[i - 1];s += a[i];if(s + i + 1 > n){n -= s;veci b(i + 1, 0);rrep(j, 1, i + 1){b[j] = n / a[j];n -= n / a[j] * n;}string ans;rep(j, 1, i + 1){ans += "con" + (b[j] ? string(b[j], 'n') : "");}cout<<ans<<endl;return 0;}}}