結果
| 問題 | No.629 グラフの中に眠る門松列 | 
| コンテスト | |
| ユーザー |  ngtkana | 
| 提出日時 | 2020-03-15 16:45:32 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 720 bytes | 
| コンパイル時間 | 2,113 ms | 
| コンパイル使用メモリ | 196,032 KB | 
| 最終ジャッジ日時 | 2025-01-09 07:01:54 | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 3 | 
| other | AC * 29 WA * 7 | 
ソースコード
#include<bits/stdc++.h>
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n,m;std::cin>>n>>m;
    std::vector<lint>a(n);
    for(lint&x:a)std::cin>>x;
    std::vector<lint>up(n),down(n);
    while(m--){
        lint u,v;std::cin>>u>>v;u--,v--;
        if(a.at(u)<a.at(v)){
            up.at(u)++;
            down.at(v)++;
        }
        if(a.at(v)>a.at(u)){
            down.at(u)++;
            up.at(v)++;
        }
    }
    for(lint i=0;i<n;i++){
        if(1<up.at(i)||1<down.at(i)){
            std::cout<<"YES"<<'\n';
            return 0;
        }
    }
    std::cout<<"NO"<<'\n';
}
            
            
            
        