結果
| 問題 | 
                            No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
                             | 
                    
| コンテスト | |
| ユーザー | 
                             monnu
                         | 
                    
| 提出日時 | 2021-12-02 20:58:57 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 564 bytes | 
| コンパイル時間 | 3,918 ms | 
| コンパイル使用メモリ | 233,272 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-05 02:06:40 | 
| 合計ジャッジ時間 | 13,571 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 7 WA * 31 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define INF 1000000000
#define MOD 998244353
#define MAX 1000000
int main(){
  int N,K;
  cin>>N>>K;
  vector<pair<int,int>> diff(N);
  for(int i=0;i<N;i++){
    int A,B;
    cin>>A>>B;
    diff[i].first=B-A;
    diff[i].second=i;
  }
  sort(diff.begin(),diff.end());
  vector<char> ans(N,'B');
  for(int i=0;i<K;i++){
    ans[diff[i].second]='A';
  }
  for(int i=0;i<N;i++){
    cout<<ans[i];
  }
  cout<<'\n';
}
            
            
            
        
            
monnu