/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 484.0 KiB
#2 Wrong Answer 2ms 324.0 KiB
#3 Wrong Answer 2ms 488.0 KiB
#4 Wrong Answer 2ms 512.0 KiB
#5 Wrong Answer 2ms 396.0 KiB
#6 Wrong Answer 7ms 604.0 KiB
#7 Wrong Answer 50ms 1.766 MiB
#8 Wrong Answer 49ms 1.648 MiB
#9 Wrong Answer 52ms 1.656 MiB
#10 Accepted 49ms 2.367 MiB
#11 Wrong Answer 50ms 2.176 MiB

Code

#include<bits/stdc++.h>
using namespace std;
#define Raihan ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
/*
vector<ll>v={1,2,3};
    do{

    }while(next_permutation(all(v)));
*/
/*

const int N=1e6+5;
bool f[N];
vector<int>prim;
for(int i=2;i*i<N;i++){
    if(!f[i]){
        for(int j=i*i;j<N;j=j+i){
            f[j]=true;
        }
    }
}
for(int i=2;i<N;i++){
    if(!f[i])prim.pb(i);
}*/

/*round(pow(5, 2))*/
/*
ll l=1,r=n;
    while(l<=r){
        ll mi=(l+r)/(ll)2;//upper bound
        if(a[mi]>dor)r=mi-1;
        else l=mi+1;
    }
*/
/*
memset(a,-1,sizeof a);
it works for 0,-1 and character,and faster than looping*/
/*
int ps=s[i]-'a'+1;
int ps=s[i]-'0'+1;
int ps=s[i]-'A'+1;
char ch='a'-1+i;
char ch='A'-1+i;
*/
/*set<int>st;
   st.insert(3);
   st.insert(4);
   for(auto it=st.begin(); it!=st.end(); it++)cout<<*it<<spc;
   cout<<endl;
   auto fi=st.begin();
   //s1.erase(fi);
   cout<<*fi<<endl;
   auto las=st.end();
   las--;
   cout<<*las<<endl;
   auto it=st.lower_bound(4);
   cout<<*it<<endl;
   it=st.upper_bound(4);
   cout<<*it<<endl;
   */
/*
for(auto it=st.begin(); it!=st.end(); it++)cout<<*it<<spc;
*/
/*
biyog korle ei doroner mod korbe.mod er problem e.
ll ans=fi-sc;
if(ans<0){
ans=ans+mod;
}
ll fact[N];
void ft()
{
	fact[0] = 1;
	for(ll i=1;i<N;i++)
	{
		fact[i] = i * fact[i - 1];
		fact[i] %= mod;
	}
}
ll pwr(long long p, long long q, const ll mod1)
{
	ll ans = (ll)1 % mod1;
	p %= mod1;
	if (p < 0)
		p += mod1;
	while (q)
	{
		if (q & (ll)1)
			ans = ((ans%mod1)*(p%mod1)) % mod1;
		p = ((p%mod1)*(p%mod1)) % mod1;
		q >>= (ll)1;
	}
	return ans;
}

ll ncr(ll n, ll r)
{
	if (n < r)
		return (ll)0;
	ll ans = (ll)1;
	ans *= fact[n];
	ll div = fact[r];
	div *= fact[n - r];
	div %= mod;
	ans *= pwr(div, mod - (ll)2, mod);
	ans %= mod;
	return ans;
}
    ll ck(ll ans){
    if(ans<0)ans=ans+mod;
        return ans%mod;
    }
*/
/*
vector<int>v({1,1,1,2,3,4,4});
    ll z=lower_bound(all(v),4)-v.begin();
    ll z1=upper_bound(all(v),4)-v.begin();
    cout<<z<<spc<<z1;
*/
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define mod 1000000007
#define vec vector<int>
#define print1(pr) for(int i=0;i<pr.size();i++)cout<<pr[i]<<spc;cout<<endl;
#define print2(pr) for(int i=pr.size()-1;i>=0;i--)cout<<pr[i];cout<<endl;
#define pb push_back
#define test int tes ;cin>>tes;while(tes--)
#define pi 2*acos(0.0)
#define all(v) v.begin(),v.end()
#define no cout<<"NO"<<endl
#define yes cout<<"YES"<<endl
#define pii pair<int,int>
#define pII pair<ll,ll>
#define endl '\n'
#define spc " "
#define vl it->first
#define fq it->second
/*
int t;cin>>t;loop(i,1,t) cout<<"Case "<<i<<": ",solution();
*/
#define loop(i,a,b) for(int i=a;i<=b;i++)
#define kajj for(auto it=mp.begin();it!=mp.end();it++)
#define input ll n;cin>>n;ll a[n+1];for(int i=1;i<=n;i++)cin>>a[i];
#define lc (nd<<1)
#define rc ((nd<<1)+1)
void solution()
{
    ll n,k;
    cin>>n>>k;
    ll nw=k/2;
    ll pr=(nw+n-1)/n;
    ll rm=k-pr*n;
    ll ans=rm*pr;
    cout<<ans<<endl;
}
int main()
{
    Raihan;
    test
    solution();
}

Information

Submit By
Type
Submission
Problem
P1092 Bitwise AND
Contest
Brain Booster #5
Language
C++20 (G++ 13.2.0)
Submit At
2024-09-05 17:31:07
Judged At
2024-10-03 13:03:29
Judged By
Score
11
Total Time
52ms
Peak Memory
2.367 MiB