結果
| 問題 |
No.2820 Non-Preferred IUPAC Nomenclature
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-26 22:21:39 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 952 bytes |
| コンパイル時間 | 5,653 ms |
| コンパイル使用メモリ | 309,860 KB |
| 実行使用メモリ | 818,232 KB |
| 最終ジャッジ日時 | 2024-07-26 22:21:47 |
| 合計ジャッジ時間 | 7,632 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 MLE * 1 |
| other | -- * 22 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using mint = atcoder::static_modint<998244353>;
//using mint = atcoder::static_modint<1000000007>;
using namespace std;
using namespace atcoder;
using ld = long double;
using ll = long long;
#define mp(a,b) make_pair(a,b)
#define rep(i,s,n) for(int i=s; i<n; i++)
const vector<int> dx{1,0,-1,0},dy{0,1,0,-1};
vector<vector<int>> G(200000);
string ans;
void dfs(int x,int p){
for(auto y:G[x])if(y!=p){
ans+='(';
dfs(y,x);
ans+=')';
}
ans+="methyl";
}
int main(){
int n;
cin >> n;
rep(i,0,n){
char c;
rep(j,0,4){
cin >> c;
if(c!='H'){
G[i].push_back(c-'1');
}
}
}
// rep(i,0,n){
// cout << i << "\n";
// for(auto x:G[i])cout << x << " ";
// cout <<"\n";
// }
dfs(0,-1);
ans.pop_back(),ans.pop_back();
ans+="ane";
cout << ans;
}