結果

問題 No.469 区間加算と一致検索の問題
ユーザー PulmnPulmn
提出日時 2018-07-16 17:42:00
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,044 bytes
コンパイル時間 2,377 ms
コンパイル使用メモリ 153,276 KB
実行使用メモリ 16,812 KB
最終ジャッジ日時 2023-08-11 06:01:04
合計ジャッジ時間 9,663 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
11,152 KB
testcase_01 AC 10 ms
11,136 KB
testcase_02 AC 10 ms
11,212 KB
testcase_03 WA -
testcase_04 AC 15 ms
11,456 KB
testcase_05 AC 16 ms
11,500 KB
testcase_06 AC 18 ms
11,456 KB
testcase_07 AC 18 ms
11,696 KB
testcase_08 WA -
testcase_09 AC 14 ms
11,448 KB
testcase_10 WA -
testcase_11 AC 12 ms
11,264 KB
testcase_12 WA -
testcase_13 AC 15 ms
11,428 KB
testcase_14 AC 11 ms
11,232 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 17 ms
11,520 KB
testcase_18 AC 18 ms
11,564 KB
testcase_19 AC 11 ms
11,284 KB
testcase_20 WA -
testcase_21 AC 12 ms
11,156 KB
testcase_22 AC 10 ms
11,044 KB
testcase_23 AC 73 ms
13,904 KB
testcase_24 AC 72 ms
14,092 KB
testcase_25 AC 72 ms
13,940 KB
testcase_26 AC 72 ms
13,840 KB
testcase_27 AC 72 ms
14,024 KB
testcase_28 AC 73 ms
13,908 KB
testcase_29 AC 73 ms
13,932 KB
testcase_30 AC 73 ms
13,916 KB
testcase_31 AC 72 ms
13,844 KB
testcase_32 AC 72 ms
13,928 KB
testcase_33 AC 169 ms
16,744 KB
testcase_34 AC 170 ms
16,812 KB
testcase_35 AC 171 ms
16,652 KB
testcase_36 AC 175 ms
16,736 KB
testcase_37 AC 172 ms
16,636 KB
testcase_38 AC 156 ms
15,224 KB
testcase_39 AC 155 ms
15,312 KB
testcase_40 AC 154 ms
15,504 KB
testcase_41 AC 152 ms
15,248 KB
testcase_42 AC 155 ms
15,244 KB
testcase_43 AC 152 ms
15,504 KB
testcase_44 AC 153 ms
15,356 KB
testcase_45 AC 159 ms
15,492 KB
testcase_46 AC 175 ms
15,248 KB
testcase_47 AC 158 ms
15,252 KB
testcase_48 WA -
testcase_49 AC 10 ms
11,040 KB
testcase_50 AC 158 ms
15,444 KB
testcase_51 AC 167 ms
15,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ull mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

const int M=1000005;
int n,q;
ull a[M];

int main(){
	cin>>n>>q;
	ull H=0;
	a[1]=1;
	map<ull,int> m;
	m[0]=0;
	for(int i=2;i<M;i++) a[i]=a[i-1]*mod;
	for(int i=1;i<M;i++) a[i]+=a[i-1];
	for(int i=0;i<q;i++){
		char c;
		cin>>c;
		if(c=='!'){
			ull l,r,k;
			cin>>l>>r>>k;
			H+=(a[r-1]-a[l-1])*k;
			if(m.find(H)==m.end()) m[H]=i+1;
		}
		else cout<<m[H]<<endl;
	}
}
0