結果
問題 |
No.327 アルファベット列
|
ユーザー |
![]() |
提出日時 | 2015-12-26 23:24:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,080 bytes |
コンパイル時間 | 628 ms |
コンパイル使用メモリ | 67,784 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 00:38:12 |
合計ジャッジ時間 | 2,100 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | WA * 50 |
ソースコード
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; #define FOR(x,y) for(int x = 0;x < y;x++) #define LLI long long int template<int um> class UF { public: vector<int> par,rank,cnt; UF() {par=rank=vector<int>(um,0); cnt=vector<int>(um,1); for(int i=0;i<um;i++) par[i]=i;} void reinit() {FOR(i,um) rank[i]=0,cnt[i]=1,par[i]=i;} int operator[](int x) {return (par[x]==x)?(x):(par[x] = operator[](par[x]));} int count(int x) { return cnt[operator[](x)];} int operator()(int x,int y) { if((x=operator[](x))==(y=operator[](y))) return x; cnt[y]=cnt[x]=cnt[x]+cnt[y]; if(rank[x]>rank[y]) return par[x]=y; rank[x]+=rank[x]==rank[y]; return par[y]=x; } }; int main(int argc, const char * argv[]) { LLI N; cin >> N; vector<char> texts; while(N > 0) { int mod = N % 26; texts.push_back('A' + mod); N /= 26; } reverse(texts.begin(),texts.end()); for(auto c : texts){ cout << c; } cout << endl; return 0; }