This commit is contained in:
Zengtudor 2024-10-08 20:10:22 +08:00
parent 4e5fbbf126
commit 13df10d599

View File

@ -1,5 +1,7 @@
#include <cctype>
#include <iostream>
#include <algorithm>
#include <type_traits>
using ull = unsigned long long;
@ -24,14 +26,38 @@ static void init(){
#define NV(v)#v<<" : "<<(v)
template<class T>
struct ReadNumber{
ReadNumber& operator>>(T &num){
c=0,w=1,n=0;
while(!isdigit(c)){
if constexpr (!std::is_unsigned_v<T>){
if(c=='-')w=-1;
}
c=getchar();
}
while(isdigit(c)){
n=n*10+(c-'0');
c=getchar();
}
num = w*n;
return *this;
}
private:
char c;
T w,n;
};
ReadNumber<ull> readull;
int main(){
std::cin>>t>>k;
readull>>t>>k;
// std::cout<<NV(t)<<'\n'<<NV(k)<<'\n';
init();
for(ull i {0};i<t;i++){
// std::cout<<NV(t)<<'\n'<<NV(k)<<'\n';
std::cin>>n>>m;
std::cout<<"test\n";
readull>>n>>m;
// std::cout<<"test\n";
m = std::min(m,n);
std::cout<<(prefix[n][m])<<'\n';
}