Submission #975339

#TimeUsernameProblemLanguageResultExecution timeMemory
975339IsamPaths (BOI18_paths)C++17
23 / 100
3076 ms11528 KiB
#include<bits/stdc++.h> using namespace std; #define eb emplace_back constexpr int sz = 2e5 + 5; int n, m, k, ans, c[sz]; vector<int> g[sz]; array<bool, 5> vis; inline void dfs(int node){ vis[c[node]] = 1; for(auto &to : g[node]){ if(vis[c[to]]) continue; ++ans; dfs(to); } vis[c[node]] = 0; return; } signed main(){ cin >> n >> m >> k; for(register int i = 1; i <= n; ++i){ cin >> c[i]; } for(register int i = 1, u, v; i <= m; ++i){ cin >> u >> v; g[u].eb(v), g[v].eb(u); } for(register int i = 1; i <= n; ++i){ dfs(i); } cout << ans << '\n'; return 0; }

Compilation message (stderr)

paths.cpp: In function 'int main()':
paths.cpp:34:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |  for(register int i = 1; i <= n; ++i){
      |                   ^
paths.cpp:38:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   38 |  for(register int i = 1, u, v; i <= m; ++i){
      |                   ^
paths.cpp:38:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   38 |  for(register int i = 1, u, v; i <= m; ++i){
      |                          ^
paths.cpp:38:29: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   38 |  for(register int i = 1, u, v; i <= m; ++i){
      |                             ^
paths.cpp:43:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   43 |  for(register int i = 1; i <= n; ++i){
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...