結果
問題 | No.2198 Concon Substrings (COuNt-CONstruct Version) |
ユーザー |
![]() |
提出日時 | 2023-01-31 07:56:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,190 bytes |
コンパイル時間 | 1,679 ms |
コンパイル使用メモリ | 196,424 KB |
最終ジャッジ日時 | 2025-02-10 07:54:23 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 102 WA * 2 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)#define ALL(v) v.begin(),v.end()typedef long long ll;#include <bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(false);std::cin.tie(nullptr);ll m;cin>>m;if(m<=60000){cout<<"co";rep(i,m) cout<<"n";cout<<endl;return 0;}vector<ll> A(10010);rep(i,10010) A[i]=(ll)i*i*i;auto it=lower_bound(ALL(A),m)-A.begin();if(A[it]==m){rep(i,it) cout<<"c";rep(i,it) cout<<"o";rep(i,it) cout<<"n";cout<<endl;return 0;}ll k=it-100;for(ll c=max(1LL,k);c<=it+100;c++){for(ll o=max(1LL,k);o<=it+100;o++){for(ll n=max(1LL,k);n<=it+100;n++){if(c*o*n==m && c+o+n<=60000){rep(i,c) cout<<"c";rep(i,o) cout<<"o";rep(i,n) cout<<"n";cout<<endl;return 0;}ll c2=m-c*o*n-c*o-c;if(c2<1) continue;if(c+o+n+c2+2<=60000){rep(i,c) cout<<"c";rep(i,o) cout<<"o";rep(i,n) cout<<"n";rep(i,c2) cout<<"c";cout<<"on";cout<<endl;return 0;}}}}return 0;}