Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
42048 jiabokai 森林之王 C++ 编译错误 0 MS 0 KB 570 2024-02-24 09:47:34

Tests(0/0):


#include<bits/stdc++.h> using namespace std; char d[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; vector<char>c[5000]; int m=0; void t(int n,int k){ int r; r=n%k; n=n/k; if(n!=0) t(n,k); c[m].push_back(d[r]); } bool reverse(char s[]){ int i=0; int j=strlen(s); while(i>=j){ if(s[i]!=s[j]){ return false; } i++; j--; } return true; } int main() { int l,r,cnt=0; cin>>l>>r; for(int i=l;i<=r;i++){ t(c[i],9); m++; if(reverse(c[i])){ cnt++; } } cout<<cnt; return 0; }


测评信息: