Skip to content

Instantly share code, notes, and snippets.

// eddy1021
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define mod9 1000000009LL
c.c.hsu01@gmail.com からの投稿は拒否されました。
理由: one line mail body
以下が、拒否されたメールの先頭 2048 バイト分です。
[注意]
MIME/multipart は"意図的に"使用しておりません。 あなたのメールリーダ
(MUA)が賢く、自動的に multipart の中身を実行するソフトウエアである場合、
あなたの知らないうちにウィルスに感染する可能性があるためです。
// eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long long ll;
typedef pair<int,int> PII;
#define mod9 1000000009ll
#define mod7 1000000007ll
#define INF 1023456789ll
#define INF16 10000000000000000ll
// eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef long double D;
typedef long long ll;
typedef pair<int,int> PII;
#define mod9 1000000009ll
#define mod7 1000000007ll
#define INF 1023456789ll
#define INF16 10000000000000000ll
// eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long long ll;
typedef pair<int,int> PII;
#define mod9 1000000009ll
#define mod7 1000000007ll
#define INF 1023456789ll
#define INF16 10000000000000000ll
let React = require('react');
let Router = require('react-router');
let RouteHandler = Router.RouteHandler;
let FullWidthSection = require('../../full-width-section.jsx');
let { AppBar,
AppCanvas,
FlatButton,
FontIcon,
IconButton,
#include <bits/stdc++.h>
using namespace std;
typedef int TYPE;
typedef pair<TYPE,TYPE> PT;
#define X first
#define Y second
#define MP make_pair
bool operator^( const PT& p1 , const PT& p2 ){
// true for deletion
return p1.X * p2.Y - p1.Y * p2.X <= 0;
// eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long long ll;
typedef pair<int,int> PII;
#define mod9 1000000009ll
#define mod7 1000000007ll
//#define INF 1023456789ll
#define INF16 10000000000000000ll
colorscheme desert
set guifont=Consolas:h14
"set t_Co=256 " 256色顯示
syntax on " 語法高亮顯示
set nu " 顯示行號
set nocompatible " VIM 不使用和 VI 相容的模式
filetype plugin on " 判斷類型
set shiftwidth=4 " 設定縮排寬度 = 4
set tabstop=4 " tab 的字元數
There are multiply test case .
For each case , first line contains a integer n (3 < = n < = 40000) the number of node is from 0 to n-1.
next line contains n integers a0,a2…an-1 ( 1<= ai <= 100000 ) . Ai is the money of bribery for the solider whose ID is i .
next line contains n-1 integers f1, f2 …fn-1 ( 0 <= fi < n ) . fi is the boss of solider i.
next line contains a integer m (1<= m<=40000).
Next q lines contain 3 integers l ,r ,p (0 < = l < = r r,p < l),
l,r means that AFA bribe soliders whose Id are between l and r.p is ZJiaQ's ID Now.
Output the Ans mod 10000007 of each query.