제출 #571479

#제출 시각아이디문제언어결과실행 시간메모리
571479ntttXOR (IZhO12_xor)C++14
0 / 100
2 ms340 KiB
#include<bits/stdc++.h> using namespace std; #define MASK(i) (1LL << (i)) #define BIT(x, i) ((x >> (i)) & 1) #define fi first #define se second #define ll long long #define task "C" const int oo = 1e9 + 7; const ll loo = (ll)1e18 + 7; const int MOD = 1e9 + 7; const int N = 2e6 + 3; const int BASE = 10; template <typename T1, typename T2> bool minimize(T1 &a, T2 b) { if (a > b) {a = b; return true;} return false; } template <typename T1, typename T2> bool maximize(T1 &a, T2 b) { if (a < b) {a = b; return true;} return false; } ll n, x; ll a[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen(task".in" , "r" , stdin); freopen(task".out" , "w" , stdout); cin >> n >> x; for (int i = 1; i <= n; i++) cin >> a[i]; pair<int, int> ans; for (int i = 1; i <= n; i++) { ll s = 0; for (int k = i; k <= n; k++) { s ^= a[k]; if(s >= x && k - i > ans.se - ans.fi ) ans = make_pair(i, k); } } cout << ans.fi << " " << ans.se - ans.fi + 1; return 0; }

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

xor.cpp: In function 'int main()':
xor.cpp:30:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     freopen(task".in" , "r" , stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
xor.cpp:31:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |     freopen(task".out" , "w" , stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...