Skip to content

Commit c5b62fc

Browse files
authored
Update show.h
1 parent 14fab59 commit c5b62fc

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

0000.test_project/show.h

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,34 @@ void show(set<T> answer)
128128
cout << *p << endl;
129129
cout << "----" << endl;
130130
}
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+
}
131160

132-
#endif
161+
#endif

0 commit comments

Comments
 (0)