Open utterances-bot opened 2 years ago
https://luyencode.net/problem/HIGHCARD
Đây là lời giải của mình đã AC. Nếu bạn đã cố gắng mà chưa làm được thì có thể tham khảo lời giải của mình.
``` #include using namespace std; int n, t, cnt; bool chk[100003]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for (int i=0; i> t; chk[t] = 1; } for (int i=0; i<=2*n; ++i) { if (!chk[i] && cnt > 0) cnt--; else if (chk[i]) cnt++; else cnt = 0; } cout << n - cnt; return 0; } ```
check=2*n-a[i]-dem-n+i; if(check>0)dem++;
Goku chơi bài - Luyện Code Online
https://luyencode.net/problem/HIGHCARD