编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#5723 #1057. 圆形切割 Accepted 100 61 ms 408 K C++ 17 / 3.3 K s230026152 2024-08-17 14:44:25
显示原始代码
/**
 * @title: ..
 * @desc: ..
 * @tag: IO
 * @url:
 */

#include <bits/stdc++.h>

/*
 *
 *   宏定义模板常量:
 *
 *          使用STD
 *          重复数据读入
 *          int强制转ll
 *          重载工具函数
 *          启用debug输出
 *          关闭输入同步流
 *          使用文件输入流
 *          使用文件输出流
 *
 */

#define USE_STD

#define USE_LL

// #define REAP_READ
#define USE_TOOL

// #define USE_DEBUG
// #define USE_IOS
// #define IN_FILE "data.in"
// #define OUT_FILE "solve.out"

#ifdef USE_STD
using namespace std;
#endif

#ifdef USE_LL
#define int long long

#endif

// 辅助宏
#define rep(i, l, r) for (int i = (l); i < (r); i++)

#define _rep(i, l, r) for (int i = (l); i >= (r); i--)

#define all(x) (x).begin(), x.end()

#define endl '\n'  // 避免刷新缓冲区

#define inf32 0x3f3f3f3f

#define max32 INT_MAX


// 类型别名
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128;
using pii = std::pair<int, int>;

// 常规输出
template <typename T>
void print(const T &t) {
    std::cout << t << endl;
}
template <typename T, typename... Args>
void print(const T &t, const Args... args) {
    std::cout << t << ' ';
    print(args...);
}

// USE_DEBUG 模式下的输出
template <typename T>
void debug(const T &t) {
#ifdef USE_DEBUG
    std::cout << t << "\n\n";
#endif
}
template <typename T, typename... Args>
void debug(const T &t, const Args... args) {
#ifdef USE_DEBUG
    std::cout << t << ' ';
    debug(args...);
#endif
}

#ifdef USE_TOOL
i64 ceilDiv(i64 n, i64 m) {
    if (n >= 0) {
        return (n + m - 1) / m;
    } else {
        return n / m;
    }
}

i64 floorDiv(i64 n, i64 m) {
    if (n >= 0) {
        return n / m;
    } else {
        return (n - m + 1) / m;
    }
}

template <class T>
void chmax(T &a, T b) {
    if (a < b) {
        a = b;
    }
}

i128 gcd(i128 a, i128 b) { return b ? gcd(b, a % b) : a; }
#endif

// 快读快写
int read();
void write(int);

const int N = 5e5 + 5;
const int MOD = 1e9 + 7;

void solve() {
    int n = read();
    int p = 360;
    vector<int> a(n + 2);
    rep(i, 0, n) {
        int b = read();
        a[i + 1] = (a[i] + b % p) % p;
    }
    a[n + 1] = 360;
    int ans = -1;
    sort(a.begin() + 1, a.end());
    rep(i, 0, n + 1) { chmax(ans, a[i + 1] - a[i]); }
    print(ans);
}

signed main() {
    int T = 1;
    debug("hello world");
#ifdef IN_FILE
    freopen(IN_FILE, "r", stdin);
#endif

#ifdef OUT_FILE
    freopen(OUT_FILE, "w", stdout);
#endif

#ifdef REAP_READ
    std::cin >> T;
#endif

#ifdef USE_IOS
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);
#endif

    while (T--) {
        solve();
    }
    return 0;
}

inline int read() {
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}
inline void write(int x) {
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:3 ms
内存:248 KiB

输入文件(1.in

1
71

答案文件(1.out

289

用户输出

289

系统信息

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

输入文件(2.in

2
278 57

答案文件(2.out

278

用户输出

278

系统信息

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

输入文件(3.in

5
103 129 198 329 263

答案文件(3.out

129

用户输出

129

系统信息

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

输入文件(4.in

241
66 286 326 327 357 177 318 291 258 217 132 120 85 304 40 45 146 198 6 36 131 65 324 88 306 163 4
<800 bytes omitted>

答案文件(4.out

8

用户输出

8

系统信息

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

输入文件(5.in

4
239 57 186 108

答案文件(5.out

122

用户输出

122

系统信息

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

输入文件(6.in

3
134 31 159

答案文件(6.out

159

用户输出

159

系统信息

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

输入文件(7.in

5
145 173 12 28 261

答案文件(7.out

145

用户输出

145

系统信息

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

输入文件(8.in

4
45 147 206 93

答案文件(8.out

168

用户输出

168

系统信息

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

输入文件(9.in

5
107 193 159 192 164

答案文件(9.out

184

用户输出

184

系统信息

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

输入文件(10.in

10
242 223 357 43 283 126 307 76 345 264

答案文件(10.out

118

用户输出

118

系统信息

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

输入文件(11.in

4
245 164 353 12

答案文件(11.out

191

用户输出

191

系统信息

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

输入文件(12.in

232
134 72 256 93 39 199 120 343 288 345 358 155 223 104 30 100 269 180 88 203 197 1 71 76 194 312 1
<760 bytes omitted>

答案文件(12.out

10

用户输出

10

系统信息

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

输入文件(13.in

3
187 247 145

答案文件(13.out

141

用户输出

141

系统信息

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

输入文件(14.in

2
201 262

答案文件(14.out

159

用户输出

159

系统信息

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

输入文件(15.in

5
246 6 193 123 348

答案文件(15.out

111

用户输出

111

系统信息

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

输入文件(16.in

5
10 85 25 336 122

答案文件(16.out

142

用户输出

142

系统信息

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

输入文件(17.in

3
240 10 30

答案文件(17.out

240

用户输出

240

系统信息

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

输入文件(18.in

1
154

答案文件(18.out

206

用户输出

206

系统信息

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

输入文件(19.in

3
174 283 128

答案文件(19.out

135

用户输出

135

系统信息

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

输入文件(20.in

2
108 213

答案文件(20.out

213

用户输出

213

系统信息

Exited with return code 0