이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
//~ #ifndef ONLINE_JUDGE
//~ #include "debug.h"
//~ #else
//~ #define debug(...)
//~ #define debugArr(...)
//~ #endif
#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; }
const int inf = 2e18;
const int mod = 1e9 + 7;
const int N = 2e5 + 1;
void solve(){
int n,k;
cin >> n >> k;
vector<int> a(n + 1);
int mx = 0;
for(int i = 1;i <= n;i++) cin >> a[i],mx = max(mx,a[i]);
int M = min(mx,k);
vector<vector<int>> dp(mx + 1,vector<int> (M + 1));
cout << "SUI" << endl;
return;
//~ sort(all(a));
set<int> MEX;
for(int i = 0;i <= M + 1;i++) {
MEX.insert(i);
}
int X = 0;
for(int i = 1;i <= mx;i++) {
set<int> v = MEX;
for(int j = 1;j <= min(i,k);j++) {
if(v.find(dp[i - j][j]) != v.end())
v.erase(dp[i - j][j]);
dp[i][j] = *v.begin();
}
}
for(int i = 1;i <= n;i++) {
X = X ^ dp[a[i]][k];
}
if(X) cout << 1;
else cout << 0;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);cout.tie(nullptr);
int T = 1;
cin >> T;
while(T--) {
solve();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |