結果

問題 No.814 ジジ抜き
ユーザー Lepton_sLepton_s
提出日時 2018-02-21 13:44:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 93 ms / 3,000 ms
コード長 968 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 75,396 KB
実行使用メモリ 8,916 KB
最終ジャッジ日時 2023-10-13 10:56:04
合計ジャッジ時間 4,109 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 88 ms
8,808 KB
testcase_05 AC 89 ms
8,916 KB
testcase_06 AC 93 ms
8,796 KB
testcase_07 AC 50 ms
5,892 KB
testcase_08 AC 93 ms
8,684 KB
testcase_09 AC 71 ms
7,288 KB
testcase_10 AC 92 ms
8,588 KB
testcase_11 AC 93 ms
8,636 KB
testcase_12 AC 49 ms
5,896 KB
testcase_13 AC 48 ms
5,976 KB
testcase_14 AC 70 ms
7,656 KB
testcase_15 AC 37 ms
5,236 KB
testcase_16 AC 37 ms
5,148 KB
testcase_17 AC 77 ms
7,544 KB
testcase_18 AC 66 ms
6,944 KB
testcase_19 AC 93 ms
8,676 KB
testcase_20 AC 48 ms
6,068 KB
testcase_21 AC 54 ms
6,240 KB
testcase_22 AC 79 ms
7,900 KB
testcase_23 AC 40 ms
5,432 KB
testcase_24 AC 71 ms
7,364 KB
testcase_25 AC 57 ms
6,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <iostream>
#include <vector>
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define rep(i,n) REP(i,0,n)
using namespace std;
const ull cycle_per_sec = 2800000000;
ull begin_cycle;
ull get_cycle(){
	unsigned int low, high;
	__asm__ volatile ("rdtsc" : "=a" (low), "=d" (high));
	return ((ull) low) | ((ull) high << 32);
}
double get_time(){
	return (double) (get_cycle() - begin_cycle)/cycle_per_sec;
}

int main(){
	//std::ios::sync_with_stdio(false);std::cin.tie(0);
	int N;
	scanf("%d",&N);
	vector<ll> k(N), l(N);
	vector<int> d(N);
	rep(i, N) scanf("%lld%lld%d",&k[i],&l[i],&d[i]);
	ll x = 0;
	begin_cycle = get_cycle();
	double t = get_time();
	rep(i, N){
		ll K = k[i], L = l[i], D = d[i];
		ll L2 = L>>D;
		while(K>0 && L2%4!=0){
			x ^= L;
			L += 1LL<<D;
			L2++;
			K--;
		}
		while(K%4!=0){
			x ^= L+((K-1)<<D);
			K--;
		}
	}
	cerr<<t<<endl;
	cout<<x<<endl;
	return 0;
}
0