結果
問題 | No.469 区間加算と一致検索の問題 |
ユーザー | Pulmn |
提出日時 | 2018-07-16 17:43:24 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,070 bytes |
コンパイル時間 | 1,717 ms |
コンパイル使用メモリ | 153,740 KB |
実行使用メモリ | 16,816 KB |
最終ジャッジ日時 | 2023-08-11 06:07:37 |
合計ジャッジ時間 | 8,019 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 10 ms
11,076 KB |
testcase_01 | AC | 10 ms
11,196 KB |
testcase_02 | AC | 10 ms
11,084 KB |
testcase_03 | WA | - |
testcase_04 | AC | 16 ms
11,548 KB |
testcase_05 | AC | 17 ms
11,584 KB |
testcase_06 | AC | 18 ms
11,808 KB |
testcase_07 | AC | 18 ms
11,652 KB |
testcase_08 | WA | - |
testcase_09 | AC | 13 ms
11,340 KB |
testcase_10 | WA | - |
testcase_11 | AC | 12 ms
11,340 KB |
testcase_12 | WA | - |
testcase_13 | AC | 15 ms
11,648 KB |
testcase_14 | AC | 11 ms
11,244 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 17 ms
11,608 KB |
testcase_18 | AC | 17 ms
11,596 KB |
testcase_19 | AC | 11 ms
11,204 KB |
testcase_20 | WA | - |
testcase_21 | AC | 12 ms
11,448 KB |
testcase_22 | AC | 11 ms
11,100 KB |
testcase_23 | AC | 75 ms
13,924 KB |
testcase_24 | AC | 75 ms
14,004 KB |
testcase_25 | AC | 74 ms
14,032 KB |
testcase_26 | AC | 73 ms
14,008 KB |
testcase_27 | AC | 72 ms
14,032 KB |
testcase_28 | AC | 72 ms
14,028 KB |
testcase_29 | AC | 74 ms
14,000 KB |
testcase_30 | AC | 74 ms
13,980 KB |
testcase_31 | AC | 74 ms
14,012 KB |
testcase_32 | AC | 74 ms
13,872 KB |
testcase_33 | AC | 173 ms
16,680 KB |
testcase_34 | AC | 170 ms
16,748 KB |
testcase_35 | AC | 169 ms
16,816 KB |
testcase_36 | AC | 173 ms
16,760 KB |
testcase_37 | AC | 173 ms
16,676 KB |
testcase_38 | AC | 159 ms
15,252 KB |
testcase_39 | AC | 159 ms
15,356 KB |
testcase_40 | AC | 158 ms
15,388 KB |
testcase_41 | AC | 160 ms
15,344 KB |
testcase_42 | AC | 156 ms
15,364 KB |
testcase_43 | AC | 157 ms
15,392 KB |
testcase_44 | AC | 158 ms
15,272 KB |
testcase_45 | AC | 154 ms
15,308 KB |
testcase_46 | AC | 160 ms
15,320 KB |
testcase_47 | AC | 155 ms
15,272 KB |
testcase_48 | WA | - |
testcase_49 | AC | 10 ms
11,152 KB |
testcase_50 | AC | 163 ms
15,408 KB |
testcase_51 | AC | 160 ms
15,256 KB |
ソースコード
#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 ll mod=1e9+7; const ull mod=998244353; 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; } }