Submission #787260

#TimeUsernameProblemLanguageResultExecution timeMemory
787260Username4132Mensza (COI22_mensza)C++17
34 / 100
2279 ms165284 KiB
#include<iostream> using namespace std; #define forn(i, n) for(int i=0; i<(int)n; ++i) char s[10]; inline int encode(int a, int b, int c, int d){ return (a<<8) + (b<<2) + (c<<1) + d; } void solve(){ scanf("%s", s); if(s[0]=='c'){ int m, a; scanf("%d", &m); forn(i, m) scanf("%d", &a); printf("%c\n", (a==1? 'B' : 'A')); } else{ int num; scanf("%d", &num); string ret("19"); forn(i, 19){ int dig = !(num & (1<<i)); ret.append(" "); ret.append(to_string(encode(num&((1<<24) - (1<<(i+1))), i, dig^(s[0]=='a'), dig|(s[0]=='a')))); } printf("%s\n", ret.c_str()); } } int main(){ int a, t; scanf("%d %d", &a, &t); while(t--) solve(); }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%s", s);
      |     ~~~~~^~~~~~~~~
Main.cpp:14:24: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         int m, a; scanf("%d", &m);
      |                   ~~~~~^~~~~~~~~~
Main.cpp:15:25: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         forn(i, m) scanf("%d", &a);
      |                    ~~~~~^~~~~~~~~~
Main.cpp:19:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |         int num; scanf("%d", &num);
      |                  ~~~~~^~~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:31:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |     int a, t; scanf("%d %d", &a, &t);
      |               ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...