QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#792694 | #2051. Count The Ones | Gourab_Biswas# | AC ✓ | 0ms | 3740kb | C++20 | 2.2kb | 2024-11-29 13:03:56 | 2024-11-29 13:03:57 |
Judging History
answer
///jai sri krishna
///jai maa kali
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<
ll,
null_type,
less_equal<ll>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define db double
#define pii pair< pair<ll,ll>, ll >
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b,c) for(ll i=a;i<b;i+=c)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define fri(i,a,b,c) for(ll i=a;i>=b;i-=c)
#define pb push_back
#define ss second
#define ff first
#define in insert
#define sq(x) (x*x)
#define all(a) a.begin(),a.end()
#define nl "\n"
#define mnpq priority_queue <pii, vector<pii>, greater<pii> >
ll gcd(ll a,ll b){
if(b==0)return a;
return gcd(b,a%b);
}
int getRandom(int L,int R)
{
return rng()%(R-L+1) + L;
}
ll lcm(ll a,ll b){
return ((a)/gcd(a,b))*b;
}
ll bigmod(ll a,ll n,ll md){
if(n==0){
return 1;
}
if(n==1){
return a%md;
}
ll d= bigmod(a,n/2,md);
if(n%2==0){
return (d*d)%md;
}
else{
return ( ((d*d)%md) * (a%md) )%md;
}
}
bool sortbysec(const pair<int,int> &a,
const pair<int,int> &b)
{
if(a.first==b.first){
return (a.second > b.second);
}
return (a.first< b.first);
}
const ll N = 103000;
const ll mod = 998244353;
const ll neginf= -1e18;
const ll inf = 1e9;
const ld eps= 1e-9;
/// Solve part by part
/// Think small case
/// Think reverse order
/// test against atleast 10 cases
/// give 10 min before submission
/// wrong submission 20 min penalty
/// use binary search for maximum minimum problem
/// use broute force to check test case in another solution
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll a,b,c;
cin>>a>>b>>c;
cout<<(b-c+1);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3720kb
input:
3 2 1
output:
2
result:
ok answer is '2'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
10 9 1
output:
9
result:
ok answer is '9'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1000000000 999999999 1
output:
999999999
result:
ok answer is '999999999'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
6 3 2
output:
2
result:
ok answer is '2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
100 10 5
output:
6
result:
ok answer is '6'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
100 99 98
output:
2
result:
ok answer is '2'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1000000000 999999999 999999998
output:
2
result:
ok answer is '2'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
15 10 5
output:
6
result:
ok answer is '6'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
1000 500 100
output:
401
result:
ok answer is '401'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1000000000 999999999 100
output:
999999900
result:
ok answer is '999999900'