File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -128,5 +128,34 @@ void show(set<T> answer)
128
128
cout << *p << endl;
129
129
cout << " ----" << endl;
130
130
}
131
+ template <typename K,typename V>
132
+ void show (multimap<K,V> answer)
133
+ {
134
+ cout << " ----" << endl;
135
+ cout << " size=" << answer.size () << endl
136
+ << " ~~~~" << endl;
137
+ for (auto p=answer.begin ();p!=answer.end ();++p)
138
+ cout << p->first << ' ' << p->second << endl;
139
+ cout << " ----" << endl;
140
+ }
141
+
142
+
143
+ int base=1e9 +7 ;
144
+ int quick_pow (int a,int n)
145
+ {
146
+ // a^n
147
+ if (a==0 )
148
+ return 0 ;
149
+ if (n==0 )
150
+ return 1 ;
151
+ a%=base;
152
+ if ((n&1 )==1 )
153
+ return a*quick_pow (a,n-1 )%base;
154
+ else
155
+ {
156
+ int half=quick_pow (a,n/2 );
157
+ return (long long )half*half%base;
158
+ }
159
+ }
131
160
132
- #endif
161
+ #endif
You can’t perform that action at this time.
0 commit comments