Submission #832321

#TimeUsernameProblemLanguageResultExecution timeMemory
832321radaiosm7Inside information (BOI21_servers)C++98
2.50 / 100
188 ms524288 KiB
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int n, k, i, a, b;
char quer;
bitset<120005> bts[120005];

int main() {
  scanf("%d%d", &n, &k);
  for (i=1; i <= n; ++i) bts[i].set(i);

  for (i=1; i <= n+k-1; ++i) {
    scanf("\n%c", &quer);

    if (quer == 'S') {
      scanf("%d%d", &a, &b);
      bts[a] = bts[a]|bts[b];
      bts[b] = bts[a];
    }

    else if (quer == 'Q') {
      scanf("%d%d", &a, &b);
      if (bts[a][b]) printf("yes\n");
      else printf("no\n");
    }

    else {
      scanf("%d", &a);
      printf("0\n");
    }
  }
}

Compilation message (stderr)

servers.cpp: In function 'int main()':
servers.cpp:10:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |   scanf("%d%d", &n, &k);
      |   ~~~~~^~~~~~~~~~~~~~~~
servers.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("\n%c", &quer);
      |     ~~~~~^~~~~~~~~~~~~~~
servers.cpp:17:12: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |       scanf("%d%d", &a, &b);
      |       ~~~~~^~~~~~~~~~~~~~~~
servers.cpp:23:12: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |       scanf("%d%d", &a, &b);
      |       ~~~~~^~~~~~~~~~~~~~~~
servers.cpp:29:12: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |       scanf("%d", &a);
      |       ~~~~~^~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...