From fc466886d6584909a678559dbb31b17bdaf4243f Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Wed, 23 Mar 2022 19:52:45 -0500 Subject: 2022 feb gold problem 1 --- 21.5/feb/gold/gifts.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 21.5/feb/gold/gifts.cpp diff --git a/21.5/feb/gold/gifts.cpp b/21.5/feb/gold/gifts.cpp new file mode 100644 index 0000000..023ce6b --- /dev/null +++ b/21.5/feb/gold/gifts.cpp @@ -0,0 +1,58 @@ +#include +#define f first +#define s second +using namespace std; +using ll = long long; +using ii = pair; +const int MX = 18; + +int A[MX][MX]; +ll B[1<sync_with_stdio(0); + int N; cin >> N; + for (int i = 0; i < N; ++i) { + for (int j = 0; j < N; ++j) { + int x; cin >> x; + A[i][x-1] = j; + } + } + for (int i = 0; i < N; ++i) + for (int j = 0; j < N; ++j) if (i != j && A[j][i] <= A[j][j]) + cnt[1<> Q; + while (Q--) { + string S; cin >> S; + int m = 0; + for (int i = 0; i < N; ++i) if (S[i] == 'H') + m |= 1<out + diff out p/{$i}.out + echo $i OK +end +*/ \ No newline at end of file -- cgit v1.2.3-70-g09d2