# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1157735 | arkanefury | Shopping (JOI21_shopping) | C++20 | 0 ms | 0 KiB |
#include "Anna.h"
#include <vector>
namespace {
int N, L, R;
int a[105];
int count = 0, ans = 0, sum = 0, k = 0;
} // namespace
void InitA(int N, int L, int R) {
::N = N;
::L = L;
::R = R;
for(int i = 0; i < 8; i ++){
a[i] = ((L >> i) & 1);
}
count = 0;
}
void ReceiveA(bool x){
if(x)sum += (1 << count);
count ++;
if(count == 10)a[k] = sum, k ++, count = 0;
if(k == N){
int ans = 1e9;
for(int i = L; i <= R; i ++)ans = std::min(ans, a[i]);
}
}