제출 #984134

#제출 시각아이디문제언어결과실행 시간메모리
984134andrei_iorgulescuIsland Hopping (JOI24_island)C++17
100 / 100
7 ms1632 KiB
#include "island.h" #include <bits/stdc++.h> using namespace std; int a[305][305]; vector<int>fii[305]; bool known[305]; int f(int i,int j) { if (a[i][j] != 0) return a[i][j]; a[i][j] = query(i,j); return a[i][j]; } void solve(int N, int L) { known[1] = true; for (int i = 1; i < N; i++) { int x = f(1,i); if (known[x] == true) continue; for (int j = 1; j < N; j++) { if (known[f(x,j)] == true) { fii[a[x][j]].push_back(x); break; } else { fii[x].push_back(a[x][j]); known[a[x][j]] = true; } } known[x] = true; } for (int i = 1; i <= N; i++) for (auto it : fii[i]) answer(i,it); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...