Submission #864688

# Submission time Handle Problem Language Result Execution time Memory
864688 2023-10-23T12:31:19 Z Trisanu_Das Mensza (COI22_mensza) C++17
34 / 100
3377 ms 165256 KB
#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;
}

int main(){
    int a, t; scanf("%d %d", &a, &t);
    while(t--) {
      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');
          fflush(stdout);
      }
      else{
          int num; scanf("%d", &num);
          printf("19");
          forn(i, 19){
              int dig = !(num & (1<<i));
              printf(" %d", encode(num&((1<<24) - (1<<(i+1))), i, dig^(s[0]=='a'), dig|(s[0]=='a')));
          }
          printf("\n");
          fflush(stdout);
      }
    }
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:12:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     int a, t; scanf("%d %d", &a, &t);
      |               ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:14:12: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |       scanf("%s", s);
      |       ~~~~~^~~~~~~~~
Main.cpp:16:26: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |           int m, a; scanf("%d", &m);
      |                     ~~~~~^~~~~~~~~~
Main.cpp:17:27: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |           forn(i, m) scanf("%d", &a);
      |                      ~~~~~^~~~~~~~~~
Main.cpp:22:25: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |           int num; scanf("%d", &num);
      |                    ~~~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 36 ms 804 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3377 ms 3168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Failed 2875 ms 165256 KB Input processor failed - contact admins or jury
2 Halted 0 ms 0 KB -