A
#include
using namespace std;
typedef long long ll;
typedef pair pll;
templateinline void rd(T &x){x=0;
char o,f=1;
while(o=getchar(),o<48)if(o==45)f=-f;
do x=(x<<3)+(x<<1)+(o^48);
while(o=getchar(),o>47);
x*=f;
}
const int inf=~0u>>2;
//1073741823
const ll INF=~0ull>>2;
//4611686018427387903
const int maxn=1e3+10;
ll n;
void solve()
{
rd(n);
printf("%lld\n",n);
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("stdin.in","r",stdin);
//freopen("stdout.out","w",stdout);
#endif ll T;
rd(T);
while(T--) solve();
return 0;
}
B
#include
using namespace std;
typedef long long ll;
typedef pair pll;
templateinline void rd(T &x){x=0;
char o,f=1;
while(o=getchar(),o<48)if(o==45)f=-f;
do x=(x<<3)+(x<<1)+(o^48);
while(o=getchar(),o>47);
x*=f;
}
const int inf=~0u>>2;
//1073741823
const ll INF=~0ull>>2;
//4611686018427387903
const int maxn=1e5+10;
ll n,a[maxn];
void solve()
{
vectorans;
rd(n);
for(ll i=1;
i<=n;
i++) rd(a[i]);
sort(a+1,a+1+n);
if(n%2==1)
{
ans.push_back(a[(n+1)/2]);
ll temp=(n+1)/2;
for(ll i=1;
i+temp1;
i--) ans.push_back(a[n+1-i]),ans.push_back(a[i]);
ans.push_back(a[n]),ans.push_back(a[1]);
}
for(ll i=0;
i
【补题|Codeforces Round #633 (Div. 2)】C
#include
using namespace std;
typedef long long ll;
typedef pair pll;
templateinline void rd(T &x){x=0;
char o,f=1;
while(o=getchar(),o<48)if(o==45)f=-f;
do x=(x<<3)+(x<<1)+(o^48);
while(o=getchar(),o>47);
x*=f;
}
const int inf=~0u>>2;
//1073741823
const ll INF=~0ull>>2;
//4611686018427387903
const int maxn=1e5+10;
ll n,a[maxn];
void solve()
{
rd(n);
ll maxx=-INF,ans=0,cha=0;
for(ll i=0;
i0)
{
ans++;
cha-=t;
t*=2;
}
printf("%lld\n",ans);
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("stdin.in","r",stdin);
//freopen("stdout.out","w",stdout);
#endif ll T;
rd(T);
while(T--) solve();
return 0;
}
推荐阅读
- 补题|Educational Codeforces Round 85 (Rated for Div. 2)
- everyday|Codeforces Round #634 (Div. 3)
- 补题|Codeforces Round #635 (Div. 2)
- Codeforces Round #623
- 补题|Omkar and Bed Wars
- Codeforces Round #609 (Div. 2)
- 牛妹爱数列