結果
| 問題 |
No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-05 23:24:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 194 ms / 2,000 ms |
| コード長 | 365 bytes |
| コンパイル時間 | 986 ms |
| コンパイル使用メモリ | 76,420 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-06 14:36:54 |
| 合計ジャッジ時間 | 11,134 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int N,K;
main()
{
cin>>N>>K;
string ans(N,'B');
vector<pair<int,int> >A(N);
for(int i=0;i<N;i++)cin>>A[i].first;
for(int i=0;i<N;i++)
{
int b;cin>>b;
A[i].first-=b;
A[i].second=i;
}
sort(A.begin(),A.end());
for(int i=0;i<K;i++)ans[A[N-i-1].second]='A';
cout<<ans<<endl;
}