結果

問題 No.1393 Median of Walk
コンテスト
ユーザー chineristAC
提出日時 2021-02-11 23:48:58
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.89.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,094 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,560 ms
コンパイル使用メモリ 274,272 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-06-17 19:34:38
合計ジャッジ時間 8,625 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 39
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include"testlib.h"
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<random>
#include<stdio.h>
using namespace std;

typedef long long ll;
const long long MIN_N = 2;
const long long MAX_N = 1000;
const long long MIN_M = 1;
const long long MAX_M = 2500;
const long long MIN_cost = 1;
const long long MAX_cost = 1000000000;

void validate(){

  set<pair<ll,ll>> S;

  long long N = inf.readLong(MIN_N,MAX_N,"N");
  inf.readSpace();
  long long M = inf.readLong(MIN_M,MAX_M,"M");
  inf.readEoln();
  for (long long i=0;i<M;i++){
    long long u = inf.readLong(1,N,"u");
    inf.readSpace();
    long long v = inf.readLong(1,N,"v");
    inf.readSpace();
    inf.readLong(MIN_cost,MAX_cost);

    if (u==v){
      inf.readEof();
    }

    pair<ll,ll> edge={u,v};

    if (S.find(edge)!=S.end()){
      inf.readEof();
    }
    else{
      S.insert(edge);
    }
    inf.readEoln();
  }
  inf.readEof();
}

int main(int argc, char* argv[]){
  registerValidation(argc,argv);
  validate();
}
0