标签:show rip each ict ret ems blank fine main
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7358 Accepted Submission(s): 5415
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <vector> #include <queue> #include <cstdlib> #include <iomanip> #include <cmath> #include <ctime> #include <map> #include <set> using namespace std; #define lowbit(x) (x&(-x)) #define max(x,y) (x>y?x:y) #define min(x,y) (x<y?x:y) #define MAX 100000000000000000 #define MOD 1000000007 #define pi acos(-1.0) #define ei exp(1) #define PI 3.141592653589793238462 #define INF 0x3f3f3f3f3f #define mem(a) (memset(a,0,sizeof(a))) typedef long long ll; int main() { for(int i=2992;i<=9999;i++) { int n=i; int k=i; int m=i; int ans=0,pos=0,cnt=0; while(n) { ans+=n%10; n/=10; } while(m>=12) { cnt+=m%12; m/=12; } cnt+=m; while(k>=16) { pos+=k%16; k/=16; } pos+=k; if(pos==ans && ans==cnt) printf("%d\n",i); } return 0; }
HDU 1197 Specialized Four-Digit Numbers
标签:show rip each ict ret ems blank fine main
原文地址:http://www.cnblogs.com/shinianhuanniyijuhaojiubujian/p/7253878.html