Submission #748854

# Submission time Handle Problem Language Result Execution time Memory
748854 2023-05-27T05:28:59 Z 반딧불(#9966) Mensza (COI22_mensza) C++17
11 / 100
5000 ms 393960 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int L, st;
int q;
char str[15];

int main(){
    scanf("%d", &L);
    st = (L==200 ? 1 : L==110 ? 2 : 3);
    scanf("%d", &q);
    while(q--){
        scanf("%s", str);
        if(str[0] == 'a'){
            int x;
            scanf("%d", &x);
            printf("%d ", x*2);
            for(int i=1; i<=x*2; i++) printf("1 ");
            puts("");
            fflush(stdout);
        }
        else if(str[0] == 'b'){
            int x;
            scanf("%d", &x);
            printf("%d ", x*2-1);
            for(int i=1; i<=x*2-1; i++) printf("2 ");
            puts("");
            fflush(stdout);
        }
        else{
            int len;
            scanf("%d", &len);
            vector<int> v(len);
            for(int i=0; i<len; i++) scanf("%d", &v[i]);
            if(v[0]%2) swap(v[0], v[1]);
            printf("%c\n", v[0]/2 < (v[1]+1)/2 ? 'B' : 'A');
            fflush(stdout);
        }
    }
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d", &L);
      |     ~~~~~^~~~~~~~~~
Main.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d", &q);
      |     ~~~~~^~~~~~~~~~
Main.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%s", str);
      |         ~~~~~^~~~~~~~~~~
Main.cpp:19:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |             scanf("%d", &x);
      |             ~~~~~^~~~~~~~~~
Main.cpp:27:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |             scanf("%d", &x);
      |             ~~~~~^~~~~~~~~~
Main.cpp:35:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |             scanf("%d", &len);
      |             ~~~~~^~~~~~~~~~~~
Main.cpp:37:43: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |             for(int i=0; i<len; i++) scanf("%d", &v[i]);
      |                                      ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 18 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 56 ms 4292 KB Integer parameter [name=l_111] equals to 112, violates the range [0, 110]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5023 ms 393960 KB Time limit exceeded
2 Halted 0 ms 0 KB -