Submission #747065

#TimeUsernameProblemLanguageResultExecution timeMemory
747065model_codeMensza (COI22_mensza)C++17
100 / 100
2695 ms137712 KiB
#include <bits/stdc++.h> using namespace std; int l, q; void alojzije() { int a; scanf("%d", &a); vector<int> ret; int curr = 0; for (int i = 18; i >= 0; --i) { if (a & (1 << i)) { curr |= 1 << i; ret.emplace_back(curr); } } printf("%d", (int)ret.size()); for (int x : ret) printf(" %d", x); printf("\n"); } void benjamin() { int b; scanf("%d", &b); vector<int> ret; int curr = 0; for (int i = 18; i >= 0; --i) { if (b & (1 << i)) curr |= 1 << i; else ret.emplace_back(curr | (1 << i)); } printf("%d", (int)ret.size()); for (int x : ret) printf(" %d", x); printf("\n"); } void cecilija() { int l, x; scanf("%d", &l); for (int i = 0; i < l; ++i) scanf("%d", &x); if (x != 1) printf("A\n"); else printf("B\n"); } int main(void) { scanf("%d%d", &l, &q); while (q--) { char t[10]; scanf("%s", t); if (t[0] == 'a') alojzije(); if (t[0] == 'b') benjamin(); if (t[0] == 'c') cecilija(); } return 0; }

Compilation message (stderr)

Main.cpp: In function 'void alojzije()':
Main.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   scanf("%d", &a);
      |   ~~~~~^~~~~~~~~~
Main.cpp: In function 'void benjamin()':
Main.cpp:27:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |   scanf("%d", &b);
      |   ~~~~~^~~~~~~~~~
Main.cpp: In function 'void cecilija()':
Main.cpp:45:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |   scanf("%d", &l);
      |   ~~~~~^~~~~~~~~~
Main.cpp:47:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   47 |     scanf("%d", &x);
      |     ~~~~~^~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:55:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   55 |   scanf("%d%d", &l, &q);
      |   ~~~~~^~~~~~~~~~~~~~~~
Main.cpp:58:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   58 |     scanf("%s", t);
      |     ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...