題單傳送門
為甘孜州等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及甘孜州網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、甘孜州網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!卡片#include#include
#include#includeusing namespace std;
int main(){int cnt[15] = {0};
int num = 0;
while(++num){int t = num;
while(t){ cnt[t % 10]++;
if(cnt[t % 10] >2021){ cout<< num - 1<< endl;
return 0;
}
t /= 10;
}
}
return 0;
}
直線#include#include
#include#include#includeusing namespace std;
typedef pairPDD;
int main() {vectorv;
for (int x1 = 0; x1< 20; ++x1)
for (int y1 = 0; y1< 21; ++y1)
for (int x2 = 0; x2< 20; ++x2)
for (int y2 = 0; y2< 21; ++y2) {if (x1 != x2) {double k = 1.0 * (y2 - y1) / (x2 - x1);
double b = y1 - k * x1;
v.push_back({k, b});
}
}
sort(v.begin(), v.end());
int ans = 1;
for (int i = 1; i< v.size(); ++i) {if (v[i].first - v[i - 1].first >1e-8 || v[i].second - v[i - 1].second >1e-8) { ans++;
}
}
cout<< ans + 20<< endl;
return 0;
}
貨物擺放#include#include
#include#includeusing namespace std;
typedef long long LL;
int main() {LL n = 2021041820210418;
LL ans = 0;
for (LL i = 1; i<= n / i; ++i) {if (n % i != 0) continue;
LL t = n / i;
for (LL j = i; j<= t / j; ++j) { if (t % j != 0) continue;
LL k = t / j;
if (k< j || i >j) continue;
if (i == j && i == k) ans += 1;
else if (i == j || i == k || j == k) ans += 3;
else ans += 6;
}
}
cout<< ans<< endl;
return 0;
}
路徑#include#include
#include#includeusing namespace std;
typedef long long LL;
LL f[3000];
int gcd(int a, int b){return b ? gcd(b, a % b) : a;
}
int main() {memset(f, 0x3f, sizeof f);
f[1] = 0;
for(int i = 2; i<= 2021; ++i){int l = max(1, i - 21);
for(int j = l; j< i; ++j){ f[i] = min(f[i], f[j] + 1ll * (i * j) / gcd(i, j));
}
}
cout<< f[2021]<< endl;
return 0;
}
空間#include#include
#include#includeusing namespace std;
int main() {cout<< 256 * 1024 * 1024 / 4<< endl;
return 0;
}
砝碼稱重#include#include
#include#includeusing namespace std;
typedef long long LL;
const int N = 110, M = 1e5 + 10;
int dp[N][M], w[N];
int main(){int n;
cin >>n;
int sum = 0;
for(int i = 1; i<= n; ++i){cin >>w[i];
sum += w[i];
}
dp[0][0] = 1;
for(int i = 1; i<= n; ++i){for(int j = 0; j<= sum; ++j){ dp[i][j] = dp[i - 1][abs(j - w[i])] + dp[i - 1][j + w[i]] + dp[i - 1][j];
}
}
int ans = 0;
for(int i = 1; i<= sum; ++i){if (dp[n][i] != 0) { ans++;
}
}
cout<< ans<< endl;
return 0;
}
括號(hào)序列#include#include
#include#includeusing namespace std;
typedef long long LL;
const int N = 5e3 + 10, mod = 1e9 + 7;
int f[N][N], n;
string s;
LL get() {memset(f, 0, sizeof(f));
f[0][0] = 1;
for (int i = 1; i<= n; i++) {if (s[i - 1] == '(' ) { for (int j = 1; j<= n; j++)
f[i][j] = f[i - 1][j - 1];
}
else { f[i][0] = (f[i - 1][1] + f[i - 1][0]) % mod;
for (int j = 1; j<= n; j++)
f[i][j] = (f[i - 1][j + 1] + f[i][j - 1]) % mod;
}
}
for (int i = 0; i<= n; i++)
if (f[n][i]) return f[n][i];
return -1;
}
int main(){cin >>s;
n = s.length();
LL x = get();
reverse(s.begin(), s.end());
for (int i = 0; i< n; i++) {if (s[i] == ')') s[i] = '(';
else s[i] = ')';
}
LL y = get();
cout<< (x * y) % mod<< endl;
return 0;
}
時(shí)間顯示#include#include
#include#includeusing namespace std;
int main(){long long n;
int t;
cin >>t;
for(int i = 1; i<= t; i++)
{cin >>n;
n /= 1000;
n %= 24 * 60 * 60;
printf("%02d:%02d:%02d\n", n / 60 / 60, n / 60 % 60, n % 60);
}
return 0;
}
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購,新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧