結果

問題 No.670 log は定数
ユーザー ferinferin
提出日時 2018-03-24 00:08:44
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 2,476 bytes
コンパイル時間 1,276 ms
コンパイル使用メモリ 149,256 KB
実行使用メモリ 208,208 KB
最終ジャッジ日時 2023-09-07 05:41:17
合計ジャッジ時間 11,840 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
// #define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'[';
  REP(i, a.size()) {out<<a[i];if(i!=a.size()-1)out<<',';}
  out<<']';
  return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

using ull = unsigned long long;

ull seed;
int next() {
  seed = seed ^ (seed << 13);
  seed = seed ^ (seed >> 7);
  seed = seed ^ (seed << 17);
  return (seed >> 33);
}

signed main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n, q;
  cin >> n >> q >> seed;
  for (int i = 0; i < 10000; i++) next();

  vector<int> a(n), x(q);
  for (int i = 0; i < n; i++) a[i] = next();
  REP(i, q) x[i] = next();

  sort(ALL(a));

  ll ret = 0;
  FOR(i, 1, q) {
    ll itr = lower_bound(ALL(a), x[i]) - a.begin();
    ret ^= itr*i;
  }
  cout << ret << endl;
  return 0;
  // // cout << a << endl;
  // cout << "a" << endl;
  //
  // map<int, int> mp;
  // VI cnt(n+q+5);
  // aa.PB(-1); sort(ALL(aa));
  // cout << "d" << endl;
  // // cout << aa << endl;
  // REP(i, n) {
  //   a[i] = lower_bound(ALL(aa), a[i]) - aa.begin();
  //   // cout << i << " " << a[i] << " " << aaa[i] << endl;
  //   mp[aaa[i]] = a[i];
  //   cnt[a[i]]++;
  // }
  // cout << "c" << endl;
  // REP(i, q) {
  //   mp[x[i]] = lower_bound(ALL(aa), x[i]) - aa.begin();
  // }
  //
  // cout << "b" << endl;
  // // cout << a << endl;
  //
  // FOR(i, 1, n+q) cnt[i] += cnt[i-1];

  // cout << cnt << endl;
  //
  // ll ret = 0;
  // REP(i, q) {
  //   // xより小さいものの個数を求める
  //   ret ^= ll(cnt[mp[x[i]]-1])*i;
  //   // cout << i << " " << ret << endl;
  // }
  // cout << ret << endl;
  //
  // return 0;
}
0