提出 #49633317


ソースコード 拡げる

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
#define rep(i,a,n) for (ll i=a;i<(ll)(n);i++)
ll read(){ll r;scanf("%lld",&r);return r;}

int main(void){
  int n=read();
  int m=read();
  atcoder::mf_graph<int> g(2*n+2);
  int a=read();
  int b=read();
  int c=read();
  int S=0;
  int T=2*n+1;
  auto f{[](int v){return v*2-1;}}; // 点入口
  auto t{[](int v){return v*2;}};// 点出口
  g.add_edge(S, t(b), 2);
  g.add_edge(t(a), T, 1);
  g.add_edge(t(c), T, 1);
  rep(i,1,n+1) g.add_edge(f(i),t(i),1);
  rep(i,0,m) {
    int u=read();
    int v=read();
    g.add_edge(t(u), f(v), 1);
    g.add_edge(t(v), f(u), 1);
  }
  printf("%s\n",(g.flow(S,T,2)==2)?"Yes":"No");
  return 0;
}

提出情報

提出日時
問題 G - Typical Path Problem
ユーザ cromarmot
言語 C++ 20 (gcc 12.2)
得点 575
コード長 730 Byte
結果 AC
実行時間 242 ms
メモリ 106952 KiB

コンパイルエラー

Main.cpp: In function ‘ll read()’:
Main.cpp:6:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 | ll read(){ll r;scanf("%lld",&r);return r;}
      |                ~~~~~^~~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 575 / 575
結果
AC × 3
AC × 93
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand2_00.txt, hand2_01.txt, hand2_02.txt, hand2_03.txt, hand2_04.txt, hand2_05.txt, hand2_06.txt, hand2_07.txt, hand2_08.txt, hand2_09.txt, hand2_10.txt, hand2_11.txt, hand2_12.txt, hand2_13.txt, hand2_14.txt, hand2_15.txt, hand2_16.txt, hand2_17.txt, hand2_18.txt, hand2_19.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, random2_00.txt, random2_01.txt, random2_02.txt, random2_03.txt, random2_04.txt, random2_05.txt, random2_06.txt, random2_07.txt, random2_08.txt, random2_09.txt, random2_10.txt, random2_11.txt, random2_12.txt, random2_13.txt, random2_14.txt, random2_15.txt, random2_16.txt, random2_17.txt, random2_18.txt, random2_19.txt, random2_20.txt, random2_21.txt, random2_22.txt, random2_23.txt, random2_24.txt, random3_00.txt, random3_01.txt, random3_02.txt, random3_03.txt, random3_04.txt, random3_05.txt, random3_06.txt, random3_07.txt, random3_08.txt, random3_09.txt, random3_10.txt, random3_11.txt, random3_12.txt, random3_13.txt, random3_14.txt, random3_15.txt, random3_16.txt, random3_17.txt, random3_18.txt, random3_19.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 1 ms 3664 KiB
example_01.txt AC 1 ms 3656 KiB
example_02.txt AC 1 ms 3540 KiB
hand2_00.txt AC 110 ms 45612 KiB
hand2_01.txt AC 119 ms 49180 KiB
hand2_02.txt AC 109 ms 44948 KiB
hand2_03.txt AC 168 ms 72804 KiB
hand2_04.txt AC 154 ms 67340 KiB
hand2_05.txt AC 102 ms 43664 KiB
hand2_06.txt AC 100 ms 44164 KiB
hand2_07.txt AC 134 ms 50776 KiB
hand2_08.txt AC 117 ms 47080 KiB
hand2_09.txt AC 115 ms 47476 KiB
hand2_10.txt AC 82 ms 33284 KiB
hand2_11.txt AC 168 ms 73884 KiB
hand2_12.txt AC 20 ms 11524 KiB
hand2_13.txt AC 23 ms 11004 KiB
hand2_14.txt AC 31 ms 12784 KiB
hand2_15.txt AC 28 ms 13124 KiB
hand2_16.txt AC 64 ms 23996 KiB
hand2_17.txt AC 79 ms 26628 KiB
hand2_18.txt AC 110 ms 41796 KiB
hand2_19.txt AC 91 ms 34064 KiB
hand_00.txt AC 1 ms 3740 KiB
hand_01.txt AC 174 ms 68920 KiB
hand_02.txt AC 177 ms 68780 KiB
hand_03.txt AC 38 ms 21376 KiB
hand_04.txt AC 38 ms 21260 KiB
hand_05.txt AC 219 ms 78792 KiB
hand_06.txt AC 230 ms 78680 KiB
hand_07.txt AC 242 ms 106952 KiB
hand_08.txt AC 235 ms 106788 KiB
hand_09.txt AC 232 ms 106788 KiB
random2_00.txt AC 7 ms 5644 KiB
random2_01.txt AC 22 ms 11980 KiB
random2_02.txt AC 11 ms 7632 KiB
random2_03.txt AC 30 ms 15448 KiB
random2_04.txt AC 22 ms 11316 KiB
random2_05.txt AC 17 ms 9040 KiB
random2_06.txt AC 53 ms 21136 KiB
random2_07.txt AC 27 ms 13092 KiB
random2_08.txt AC 58 ms 21544 KiB
random2_09.txt AC 37 ms 18708 KiB
random2_10.txt AC 30 ms 14248 KiB
random2_11.txt AC 36 ms 14076 KiB
random2_12.txt AC 46 ms 18348 KiB
random2_13.txt AC 42 ms 16184 KiB
random2_14.txt AC 36 ms 14632 KiB
random2_15.txt AC 68 ms 26928 KiB
random2_16.txt AC 55 ms 22944 KiB
random2_17.txt AC 76 ms 25540 KiB
random2_18.txt AC 60 ms 24228 KiB
random2_19.txt AC 44 ms 21108 KiB
random2_20.txt AC 107 ms 36856 KiB
random2_21.txt AC 90 ms 31524 KiB
random2_22.txt AC 122 ms 44724 KiB
random2_23.txt AC 107 ms 39888 KiB
random2_24.txt AC 102 ms 37132 KiB
random3_00.txt AC 206 ms 76420 KiB
random3_01.txt AC 133 ms 53392 KiB
random3_02.txt AC 147 ms 56468 KiB
random3_03.txt AC 88 ms 39184 KiB
random3_04.txt AC 125 ms 51456 KiB
random3_05.txt AC 159 ms 65424 KiB
random3_06.txt AC 90 ms 42424 KiB
random3_07.txt AC 135 ms 56404 KiB
random3_08.txt AC 139 ms 58556 KiB
random3_09.txt AC 108 ms 47148 KiB
random3_10.txt AC 159 ms 62836 KiB
random3_11.txt AC 188 ms 75220 KiB
random3_12.txt AC 102 ms 46652 KiB
random3_13.txt AC 128 ms 54072 KiB
random3_14.txt AC 132 ms 54692 KiB
random3_15.txt AC 115 ms 51436 KiB
random3_16.txt AC 120 ms 52108 KiB
random3_17.txt AC 69 ms 31964 KiB
random3_18.txt AC 89 ms 40604 KiB
random3_19.txt AC 166 ms 66928 KiB
random_00.txt AC 2 ms 4236 KiB
random_01.txt AC 2 ms 4388 KiB
random_02.txt AC 2 ms 4500 KiB
random_03.txt AC 2 ms 4364 KiB
random_04.txt AC 2 ms 4228 KiB
random_05.txt AC 2 ms 4264 KiB
random_06.txt AC 2 ms 4416 KiB
random_07.txt AC 2 ms 4476 KiB
random_08.txt AC 2 ms 4428 KiB
random_09.txt AC 2 ms 4260 KiB
random_10.txt AC 2 ms 4408 KiB
random_11.txt AC 2 ms 4372 KiB
random_12.txt AC 2 ms 4428 KiB
random_13.txt AC 2 ms 4352 KiB
random_14.txt AC 2 ms 4280 KiB