結果

問題 No.3078 Very Simple Traveling Salesman Problem
ユーザー aspiaspi
提出日時 2021-03-09 23:25:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 1,555 ms
コンパイル使用メモリ 169,280 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-04-19 20:24:56
合計ジャッジ時間 2,293 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 60 ms
8,576 KB
testcase_04 AC 7 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 20 ms
5,376 KB
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 48 ms
7,552 KB
testcase_10 AC 72 ms
9,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

/*
今からverifyするよ~
*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N,M,a,b,c;
    cin>>N>>M;
    set<pair<int,int>>se;
    assert(2<=N&&N<=500);
    assert(M==N*(N-1)/2);
    for(int i=0; i<M; i++){
        cin>>a>>b>>c;
        assert(1<=a&&a<=N);
        assert(1<=b&&b<=N);
        assert(a!=b);
        assert(c==1);
        assert(!se.count(make_pair(a,b)));
        se.insert(make_pair(a,b));
    }
    cout<<N<<endl;
}
0