結果
| 問題 | No.69 文字を自由に並び替え |
| コンテスト | |
| ユーザー |
sorag
|
| 提出日時 | 2022-08-15 11:27:45 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 360µs | |
| コード長 | 620 bytes |
| 記録 | |
| コンパイル時間 | 398 ms |
| コンパイル使用メモリ | 97,600 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-09-08 09:24:16 |
| 合計ジャッジ時間 | 1,686 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include<string>
#include<queue>
#include<math.h>
#define all(x) begin(x),end(x)
#define ll long long
#define P pair<int,int>
#define lP pait<ll,ll>
using namespace std;
int main() {
int ans=0;
string s,t;
cin>>s>>t;
vector<int> a(s.size());
for(int i=0;i<s.size();i++){
for(int j=0;j<s.size();j++){
if(s[i]==t[j]){
a[i]=1;
t.erase(j,1);
break;
}
}
ans+=a[i];
}
if(ans==s.size()) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
}
sorag