結果

問題 No.2000 Distanced Characters
ユーザー RubikunRubikun
提出日時 2022-07-08 21:22:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,235 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 204,564 KB
実行使用メモリ 4,944 KB
最終ジャッジ日時 2023-08-27 20:43:38
合計ジャッジ時間 3,002 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 4 ms
4,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=1005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string S;cin>>S;
    vector<vector<int>> pos(26);
    for(int i=0;i<si(S);i++){
        pos[S[i]-'a'].push_back(i);
    }
    vector<vector<int>> A(26,vector<int>(26));
    for(int i=0;i<26;i++){
        for(int j=0;j<26;j++){
            cin>>A[i][j];
        }
    }
    
    for(int i=0;i<26;i++){
        for(int j=0;j<26;j++){
            if(si(pos[i])==0||si(pos[j])==0){
                cout<<"Y ";
            }else{
                int a=pos[i].back(),b=pos[j].front();
                if(a+A[i][j]>b){
                    cout<<"N ";
                }else{
                    cout<<"Y ";
                }
            }
        }
        cout<<"\n";
    }
}
0