QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#85630#2051. Count The OnesZuqa#AC ✓2ms3592kbC++171.4kb2023-03-07 23:21:222023-03-07 23:21:27

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-07 23:21:27]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3592kb
  • [2023-03-07 23:21:22]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define el '\n'
#define FIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;
typedef unsigned long long ull;

template<typename T, typename X>
using hashTable = gp_hash_table<T, X>;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

// mt19937_64 for long long
mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());

void doWork()
{
    int a, b, c;
    cin >> a >> b >> c;

    cout << 1LL * b - c + 1;

}

signed main()
{
    FIO
//    for(int c = 1; c <= 10; c++)
//    {
//        for(int b = c + 1; b <= 10; b++)
//        {
//            for(int a = b + 1; a <= 10; a++)
//            {
//                cout << a << ' ' << b << ' ' << c << ": ";
//                int x = (1 << a) + (1 << b) - (1 << c);
//                cout << __builtin_popcount(x) << ' ' << b - c + 1 << '\n';
//            }
//        }
//    }
    int T = 1;
//    cin >> T;
    for(int i = 1; i <= T; i++)
        doWork();
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3352kb

input:

3 2 1

output:

2

result:

ok answer is '2'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3344kb

input:

10 9 1

output:

9

result:

ok answer is '9'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3588kb

input:

1000000000 999999999 1

output:

999999999

result:

ok answer is '999999999'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

6 3 2

output:

2

result:

ok answer is '2'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3588kb

input:

100 10 5

output:

6

result:

ok answer is '6'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3464kb

input:

100 99 98

output:

2

result:

ok answer is '2'

Test #7:

score: 0
Accepted
time: 2ms
memory: 3340kb

input:

1000000000 999999999 999999998

output:

2

result:

ok answer is '2'

Test #8:

score: 0
Accepted
time: 2ms
memory: 3352kb

input:

15 10 5

output:

6

result:

ok answer is '6'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

1000 500 100

output:

401

result:

ok answer is '401'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3592kb

input:

1000000000 999999999 100

output:

999999900

result:

ok answer is '999999900'