编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#49000 #1256. 200的倍数 Accepted 100 91 ms 1664 K C++ 11 / 3.4 K feicheng 2021-05-20 1:13:47
显示原始代码
/*
If you are full of hope,you will be invincible.
Writer:feicheng
Problem Number:
*/
#include <cstdio>
#include <ctime>
#include <algorithm>
#include <cstring>
#include <iostream>
#include <random>
#include <unordered_map>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/hash_policy.hpp>
std::mt19937 rnd(time(nullptr) + (unsigned long long)(new char)+20051107);
std::mt19937_64 Rnd(time(nullptr) + (unsigned long long)(new char)+20060923);
constexpr char endl = '\n';
namespace hpy {
constexpr int HL = 1 << 19;
char buf[HL], buff[HL], *t1 = buf, *t2 = buf, *T = buff;
#ifdef feicheng
#define getc() getchar()
#else
#define getc() (t1 == t2 && (t2 = (t1 = buf) + fread(buf, 1, HL, stdin), t1 == t2) ? EOF : *t1++)
#endif
inline void flush() { fwrite(buff, 1, T - buff, stdout), T = buff; }
inline void putc(const char ch) { T == buff + HL ? flush(), *T++ = ch : *T++ = ch; }
struct Read {
    template <typename Tp>
    inline Read &operator>>(Tp &x) {
        char ch = getc();
        int f = 0;
        for (; ch < '0' || ch > '9'; ch = getc()) f = (ch == '-') ? 1 : 0;
        x = 0;
        for (; ch >= '0' && ch <= '9'; ch = getc()) x = (x << 3) + (x << 1) + (ch ^ 48);
        return x = f ? -x : x, *this;
    }
    inline Read &operator>>(char &c) {
        for (c = getc(); c == ' ' || c == '\n'; c = getc())
            ;
        return *this;
    }
    inline Read &operator>>(char *str) {
        int len = 0;
        char ch = getc();
        while (ch == ' ' || ch == '\n') ch = getc();
        while (ch != ' ' && ch != '\n' && ch != '\r' && ch != EOF) str[len++] = ch, ch = getc();
        return str[len] = '\0', *this;
    }
} cin;
struct Write {
    template <typename Tp>
    inline Write &operator<<(Tp x) {
        if (!x)
            return putc('0'), *this;
        if (x < 0)
            putc('-'), x = -x;
        int stk[19], top = 0;
        while (x) stk[++top] = x % 10, x /= 10;
        while (top) putc(stk[top--] + '0');
        return *this;
    }
    inline Write &operator<<(const char ch) { return putc(ch), *this; }
    inline Write &operator<<(char *str) {
        int cur = 0;
        while (str[cur]) putc(str[cur++]);
        return *this;
    }
    inline Write &operator<<(const char *str) {
        int cur = 0;
        while (str[cur]) putc(str[cur++]);
        return *this;
    }
} cout;
template <typename Tp>
inline Tp max(const Tp &a, const Tp &b) {
    return a > b ? a : b;
}
template <typename Tp, typename... Rst>
Tp max(const Tp &a, const Rst... rst) {
    return max(a, max(rst...));
}
template <typename Tp>
inline Tp min(const Tp &a, const Tp &b) {
    return a < b ? a : b;
}
template <typename Tp, typename... Rst>
Tp min(const Tp &a, const Rst... rst) {
    return min(a, min(rst...));
}
}  // namespace hpy
using hpy::cin;
using hpy::cout;
using hpy::max;
using hpy::min;

constexpr int N = 2e5 + 10;

int n;
long long ans;
int a[N], cnt[205];

namespace hl {

inline void fc() {
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i], ++cnt[a[i] % 200];
    for (int i = 0; i < 200; ++i) ans += 1ll * cnt[i] * (cnt[i] - 1) / 2;
    cout << ans << endl;
}

}  // namespace hl

int main(int argc, const char **argv) {
#ifdef feicheng
    freopen("wild.in", "r", stdin);
    freopen("wild.out", "w", stdout);
#endif
    hl::fc();
#ifdef feicheng
    std::cout << "your program costs " << (double)clock() / CLOCKS_PER_SEC << " s" << std::endl;
#endif
    return hpy::flush(), 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:9 ms
内存:1564 KiB

输入文件(1.in

200000
697299172 717335728 886698790 788633118 338380054 658189362 318413416 421063238 391867470 24
<1974165 bytes omitted>

答案文件(1.out

99986022

用户输出

99986022

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:9 ms
内存:1652 KiB

输入文件(2.in

200000
83682743 482125053 618392125 101207256 118502872 887790373 341125255 325529258 953724886 346
<1974054 bytes omitted>

答案文件(2.out

99992685

用户输出

99992685

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:10 ms
内存:1600 KiB

输入文件(3.in

200000
495151484 556049701 335050199 398291879 83168103 445632741 906958208 928057778 890219895 324
<1974312 bytes omitted>

答案文件(3.out

99999338

用户输出

99999338

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:9 ms
内存:1652 KiB

输入文件(4.in

200000
264997735 511027750 237030956 516685855 407031075 24224959 170014875 964725939 884552540 487
<1973901 bytes omitted>

答案文件(4.out

100005398

用户输出

100005398

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:9 ms
内存:1652 KiB

输入文件(5.in

200000
62409279 913524997 914964027 713926908 197508890 273479156 755634901 399695938 254695139 392
<1973999 bytes omitted>

答案文件(5.out

99988025

用户输出

99988025

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:9 ms
内存:1664 KiB

输入文件(6.in

200000
242910353 364217454 978179711 312683769 565850228 405932645 441338085 803273601 796258031 56
<1974055 bytes omitted>

答案文件(6.out

99982591

用户输出

99982591

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:9 ms
内存:1652 KiB

输入文件(7.in

200000
870582931 457126162 404306703 122019221 887706396 970755941 835189807 244460829 879347655 15
<1974165 bytes omitted>

答案文件(7.out

99985604

用户输出

99985604

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:9 ms
内存:1592 KiB

输入文件(8.in

200000
914506175 206515749 865306688 952944916 83757259 550802052 818788398 598879030 196471132 146
<1974248 bytes omitted>

答案文件(8.out

99989906

用户输出

99989906

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:9 ms
内存:1652 KiB

输入文件(9.in

200000
198272215 227911917 102725927 298039233 652672970 32325750 229435920 790388950 875081549 205
<1974261 bytes omitted>

答案文件(9.out

100003292

用户输出

100003292

系统信息

Exited with return code 0
测试点 #10
Accepted
得分:100
用时:9 ms
内存:1600 KiB

输入文件(10.in

200000
786861273 596625522 157019070 677881170 643118481 404042372 23389272 507717276 152052372 261
<1974035 bytes omitted>

答案文件(10.out

100000148

用户输出

100000148

系统信息

Exited with return code 0