結果
問題 | No.814 ジジ抜き |
ユーザー | Lepton_s |
提出日時 | 2018-01-23 03:02:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 285 ms / 3,000 ms |
コード長 | 2,002 bytes |
コンパイル時間 | 794 ms |
コンパイル使用メモリ | 98,576 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 03:00:31 |
合計ジャッジ時間 | 6,896 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <sstream> #include <functional> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <bitset> #include <string> #include <cstring> #include <vector> #include <queue> #include <stack> #include <deque> #include <list> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll,ll> P; typedef pair<P,ll> PPI; typedef pair<ll,P> PIP; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<P> vp; #define PQ(T) priority_queue<T,vector<T>,greater<T>> #define PQ2(T) priority_queue<T> const double PI = 3.14159265358979323846; const double EPS = 1e-12; const ll INF = 1LL<<29; const ll mod = 1e9+7; #define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i)) #define rep(i,n) REP(i,0,n) #define rep1(i,n) REP(i,1,n+1) #define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d)) #define all(v) (v).begin(), (v).end() #define pb(x) push_back(x) #define mp(x,y) make_pair((x),(y)) #define mset(m,v) memset((m),(v),sizeof(m)) #define chmin(x,y) ((x)=min((x),(y))) #define chmax(x,y) ((x)=max((x),(y))) #define fst first #define snd second #define UNIQUE(x) (x).erase(unique(all(x)),(x).end()) #define DEBUG(x) cerr<<"line ("<<__LINE__<<") "<<#x<<": "<<x<<endl; template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;} int main(){ ll N; cin>>N; if(N<0 || N>1e6){ cerr<<"invalid N: "<<N<<endl; return 0; } ll x = 0; rep(i, N){ ll K, L, D; cin>>K>>L>>D; /*if(K<1||L<0||L>1e18||K>1e18||(L+((K-1)<<D))>1e18||K-1>(((ll)(1e18-L)>>D)+10)){ cout<<"invalide K L D: "<<K<<" "<<L<<" "<<D<<endl; return 0; }*/ 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--; } } cout<<x<<endl; return 0; }