# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
932794 | 2024-02-24T08:54:53 Z | Captain_Georgia | Football (info1cup20_football) | C++17 | 2000 ms | 3688 KB |
#include <bits/stdc++.h> using namespace std; /// toto -> 1 #define pb push_back #define pii pair<int,int> #define pll pair<ll,ll> #define io \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define all(a) a.begin(),a.end() #define rep(k,i,n) for(int k=i;k<n;k++) #define repp(k,i,n) for(int k=n-1;k>=i;k--) #define rech(k) for(char k='a';k<='z';k++) #define SZ(a) (int)a.size() #define MX(a) *max_element(all(a)) #define MN(a) *min_element(all(a)) #define SM(a) accumulate(all(a),0LL) #define vi vector<int> #define vl vector<long long> #define vvl vector<vector<long long>> #define vvi vector<vector<int>> #define fii first #define see second template <typename T> inline bool umin(T &a, const T &b) { if(a > b) { a = b; return 1; } return 0; } template <typename T> inline bool umax(T &a, const T &b) { if(a < b) { a = b; return 1; } return 0; } /// toto -> long long mod = 1e9 + 7 , modd = 998244353; typedef long long ll; void F1(bool res) { if(res) { cout << "Yes" << endl; } else { cout << "No" << endl; } } void open (string s, string f) { freopen((s + ".txt").c_str(), "r", stdin); freopen((f + ".txt").c_str(), "w", stdout); } void openn (string s, string f) { freopen(s.c_str(), "r", stdin); freopen(f.c_str(), "w", stdout); } struct mint{ ll val; mint(int64_t v = 0) { v %= mod; if (v < 0) v += mod; val = v; } mint& operator+=(const mint& other) { val += other.val; if (val >= mod) val -= mod; return *this; } mint& operator-=(const mint& other) { val += mod - other.val; if (val >= mod) val -= mod; return *this; } mint& operator*=(const mint& other) { val = (int64_t)val * other.val % mod; return *this; } mint& operator/=(const mint& other) { return *this *= other.inv(); } friend mint operator+(mint a, const mint& b) { return a += b; } friend mint operator-(mint a, const mint& b) { return a -= b; } friend mint operator*(mint a, const mint& b) { return a *= b; } friend mint operator/(mint a, const mint& b) { return a /= b; } mint pow(int64_t exp) const { mint a = *this, res = 1; while (exp > 0) { if (exp & 1) res *= a; a *= a; exp >>= 1; } return res; } mint inv() const { assert(val != 0); return pow(mod - 2); } friend ostream& operator<<(ostream& os, const mint& m) { return os << m.val; } }; ll bp(ll n,ll m){ if(m == 0){ return 1; } if(m == 1){ return n%mod; } if(m%2==0){ return bp(n*n%mod,m/2)%mod; } return n*bp(n,m-1)%mod; } /// toto -> 3 const int N = 3e5 + 2, M = 1e6 + 434, inf = 1e9 + 1; const ll inff = 1e18; void solve(){ int n , k; cin >> n >> k; vi a(n); rep (i,0,n) { cin >> a[i]; } rep (bit,0,30) { if ((1 << bit) > k) { continue; } vi v = a; int ind = 0 , x = bit; rep (i,0,n) { while (v[i] > 0) { if (v[i] >= (1 << x)) { v[i] -= (1 << x); } else { while (v[i] < (1 << x)) { x --; } v[i] -= (1 << x); } ind = (1 - ind); } if (ind == 0) { cout << "1"; return; } } } cout << "0"; } int32_t main () { io; ll t = 1; cin >> t; rep (_,1,t+1) { cerr << "Start of test case " << _ << "\n"; ///cout<<"Case #"<<_<<": "; solve(); cerr << "\n"; cerr << "\n"; } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2053 ms | 1564 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 70 ms | 860 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 619 ms | 3688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2063 ms | 344 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2024 ms | 1584 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2008 ms | 1448 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2037 ms | 1576 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |