标签:algorithm end The element ace txt atom nbsp others
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3241 Accepted Submission(s): 1344
1 #include <iostream> 2 #include <stdio.h> 3 #include <math.h> 4 #include <string.h> 5 #include <stdlib.h> 6 #include <string> 7 #include <vector> 8 #include <set> 9 #include <map> 10 #include <queue> 11 #include <algorithm> 12 #include <sstream> 13 #include <stack> 14 using namespace std; 15 #define rep(i,a,n) for (int i=a;i<n;i++) 16 #define per(i,a,n) for (int i=n-1;i>=a;i--) 17 #define pb push_back 18 #define mp make_pair 19 #define all(x) (x).begin(),(x).end() 20 #define fi first 21 #define se second 22 #define SZ(x) ((int)(x).size()) 23 #define FO freopen("in.txt", "r", stdin) 24 #define lowbit(x) (x&-x) 25 #define mem(a,b) memset(a, b, sizeof(a)) 26 typedef vector<int> VI; 27 typedef long long ll; 28 typedef pair<int,int> PII; 29 const ll mod=1000000007; 30 const int inf = 0x3f3f3f3f; 31 ll powmod(ll a,ll b) {ll res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;} 32 ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;} 33 //head 34 35 int _, n; 36 int main() { 37 for(scanf("%d", &_);_;_--) { 38 scanf("%d", &n); 39 if(n%3 == 0) printf("%lld\n", 1ll * n * n * n / 27); 40 else if(n%4 == 0) printf("%lld\n", 1ll * n * n * n / 32); 41 else puts("-1"); 42 } 43 }
HDU6298 Maximum Multiple (多校第一场1001)
标签:algorithm end The element ace txt atom nbsp others
原文地址:https://www.cnblogs.com/ACMerszl/p/9575759.html