标签:现在 turn cst put cin putchar typedef print scanf
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
int main() {
char ch;
scanf("%c", &ch);
if (ch >= ‘a‘ && ch <= ‘z‘) puts("a");
else puts("A");
return 0;
}
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#define MAXN 1001
int n ,k, ans, a[MAXN];
int main() {
scanf("%d %d", &n, &k);
for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
std::sort(a + 1, a + n + 1);
for (int i = 1; i <= k; ++i) {
ans += a[i];
}
printf("%d\n", ans);
return 0;
}
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
long long n;
void solve(long long x) {
if (x != 0) {
int d = x % 26;
if (d == 0) solve (x / 26 - 1);
else solve(x / 26);
if(d == 0) putchar(‘z‘);
else putchar(d+‘a‘-1);
}
}
int main() {
scanf("%lld", &n);
solve(n);
return 0;
}
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#define MAXN 100001
int n, q, times[MAXN];
long long ans;
int main() {
scanf("%d", &n);
for (int i = 1, x; i <= n; ++i) {
scanf("%d", &x);
ans += x;
++times[x];
}
scanf("%d", &q);
for (int i = 1, b, c; i <= q; ++i) {
scanf("%d %d", &b, &c);
ans -= 1ll * times[b] * b;
ans += 1ll * times[b] * c;
printf("%lld\n", ans);
times[c] += times[b];
times[b] = 0;
}
return 0;
}
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#define MAXN 200001
typedef long long ll;
ll n, a[MAXN], ans;
int main() {
scanf("%lld", &n);
for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
for (int i = 2; i <= n; ++i) {
ans ^= a[i] ^ a[1];
}
for (int i = 1; i <= n; ++i) {
printf("%lld ", ans ^ a[i]);
}
return 0;
}
【比赛】 AtCoder Beginner Contest 171
标签:现在 turn cst put cin putchar typedef print scanf
原文地址:https://www.cnblogs.com/poi-bolg-poi/p/13174254.html