제출 #1134481

#제출 시각아이디문제언어결과실행 시간메모리
1134481NurislamCOVID tests (CEOI24_covid)C++17
0 / 100
1 ms320 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define ff first #define ss second #define pb push_back template<class T, class U> inline bool chmin(T& a, const U& b) { if (a > b) { a = b; return true; } return false; } template<class T, class U> inline bool chmax(T& a, const U& b) { if (a < b) { a = b; return true; } return false; } //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //#define rnd(l, r) uniform_int_distribution <int> (l, r)(rng) const int inf = 1e10; double P; int n; void solve(bool sub1){ if(sub1){ string mask_str(n, '1'); printf("Q %s\n", mask_str.c_str()); fflush(stdout); char answer; scanf(" %c", &answer); if(answer == 'P'){ printf("A %s\n", mask_str.c_str()); fflush(stdout); }else{ string mask_str(n, '0'); printf("A %s\n", mask_str.c_str()); fflush(stdout); } }else{ } } signed main() { //ios_base::sync_with_stdio(false); //cin.tie(nullptr);cout.tie(nullptr); int tt = 1; cin >> tt >> P >> n; bool sub1 = (tt == 1); while(tt--){ solve(sub1); char verdict; scanf(" %c", &verdict); if (verdict == 'W') exit(0); }; }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'void solve(bool)':
Main.cpp:27:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |                 scanf(" %c", &answer);
      |                 ~~~~~^~~~~~~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:51:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |                 scanf(" %c", &verdict);
      |                 ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...