結果
問題 | No.670 log は定数 |
ユーザー |
![]() |
提出日時 | 2018-03-23 23:32:18 |
言語 | Java (openjdk 23) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,333 bytes |
コンパイル時間 | 3,989 ms |
コンパイル使用メモリ | 83,716 KB |
実行使用メモリ | 853,728 KB |
最終ジャッジ日時 | 2024-06-24 22:57:54 |
合計ジャッジ時間 | 9,956 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | MLE * 1 -- * 9 |
ソースコード
import java.util.ArrayList;import java.util.Arrays;import java.util.Collections;import java.util.LinkedList;import java.util.Scanner;import java.util.TreeSet;public class Main {public static final long MOD = 1000000007;static long seed;static int next() {seed = seed ^ (seed << 13);seed = seed ^ (seed >>> 7);seed = seed ^ (seed << 17);return (int)(seed >>> 33);}public static class Pair implements Comparable<Pair> {int q;long value;public Pair(int q, long value){this.q = q;this.value = value;}@Overridepublic int compareTo(Pair o) {return Long.compare(this.value, o.value);}}public static void main(String[] args) {Scanner sc = new Scanner(System.in);final int N = sc.nextInt();final int Q = sc.nextInt();seed = sc.nextLong();for (int i = 0; i < 10000; i++){ next();}int[] array = new int[N];for(int i = 0; i < N; i++){ array[i] = next(); }Arrays.sort(array);Pair[] query = new Pair[Q];for(int q = 0; q < Q; q++){query[q] = new Pair(q, next());}Arrays.sort(query);long answer = 0;int count = 0;for(final Pair q : query){while(count < N && array[count] < q.value){ count++; }final long q_answer = count;answer ^= q_answer * q.q;}System.out.println(answer);}}