Submission #60759899
Source Code Expand
Copy
#include<iostream>#include<vector>#include<algorithm>#include<iomanip>using namespace std;#define OVERLOAD_REP(_1, _2, _3, name, ...) name#define REP1(i, n) for (auto i = std::decay_t<decltype(n)>{}; (i) != (n); ++(i))#define REP2(i, l, r) for (auto i = (l); (i) != (r); ++(i))#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__)#define REP(i, l, r) rep(i, l, r+1)#define all(x) (x).begin(),(x).end()using ll = long long;using P = pair<int,int>;int main() {// 高速化ios::sync_with_stdio(false);cin.tie(nullptr);// 小数点の出力桁数を指定cout << fixed << setprecision(10);
#include<iostream> #include<vector> #include<algorithm> #include<iomanip> using namespace std; #define OVERLOAD_REP(_1, _2, _3, name, ...) name #define REP1(i, n) for (auto i = std::decay_t<decltype(n)>{}; (i) != (n); ++(i)) #define REP2(i, l, r) for (auto i = (l); (i) != (r); ++(i)) #define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__) #define REP(i, l, r) rep(i, l, r+1) #define all(x) (x).begin(),(x).end() using ll = long long; using P = pair<int,int>; int main() { // 高速化 ios::sync_with_stdio(false); cin.tie(nullptr); // 小数点の出力桁数を指定 cout << fixed << setprecision(10); // メイン int N; ll sum = 0, A[200005]; ll S; cin >> N >> S; rep(i, 0, N) { cin >> A[i]; sum += A[i]; } ll amari = S % sum; int ruiseki[200005]; ruiseki[0] = A[0]; rep(i, 1, N) ruiseki[i] = ruiseki[i-1] + A[i]; int start = ruiseki[0], end = ruiseki[N-1]; rep(i, 0, N) { if(ruiseki[i]-start == amari || end-ruiseki[i] == amari) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Repeated Sequence |
User | tombo_ |
Language | C++ 17 (gcc 12.2) |
Score | 0 |
Code Size | 1221 Byte |
Status | WA |
Exec Time | 13 ms |
Memory | 5976 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 01_random_32.txt, 01_random_33.txt, 01_random_34.txt, 01_random_35.txt, 01_random_36.txt, 01_random_37.txt, 01_random_38.txt, 01_random_39.txt, 01_random_40.txt, 01_random_41.txt, 01_random_42.txt, 01_random_43.txt, 01_random_44.txt, 01_random_45.txt, 02_handmade_46.txt, 02_handmade_47.txt, 02_handmade_48.txt, 02_handmade_49.txt, 02_handmade_50.txt, 02_handmade_51.txt, 02_handmade_52.txt, 02_handmade_53.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 2 ms | 5844 KB |
00_sample_01.txt | AC | 2 ms | 5712 KB |
00_sample_02.txt | AC | 2 ms | 5744 KB |
00_sample_03.txt | AC | 2 ms | 5844 KB |
01_random_04.txt | WA | 12 ms | 5916 KB |
01_random_05.txt | AC | 12 ms | 5852 KB |
01_random_06.txt | WA | 12 ms | 5836 KB |
01_random_07.txt | AC | 12 ms | 5776 KB |
01_random_08.txt | WA | 12 ms | 5916 KB |
01_random_09.txt | AC | 12 ms | 5752 KB |
01_random_10.txt | AC | 12 ms | 5852 KB |
01_random_11.txt | AC | 12 ms | 5776 KB |
01_random_12.txt | WA | 12 ms | 5856 KB |
01_random_13.txt | WA | 13 ms | 5756 KB |
01_random_14.txt | WA | 12 ms | 5788 KB |
01_random_15.txt | AC | 12 ms | 5852 KB |
01_random_16.txt | WA | 11 ms | 5772 KB |
01_random_17.txt | AC | 11 ms | 5852 KB |
01_random_18.txt | WA | 11 ms | 5852 KB |
01_random_19.txt | AC | 11 ms | 5784 KB |
01_random_20.txt | AC | 11 ms | 5852 KB |
01_random_21.txt | WA | 11 ms | 5856 KB |
01_random_22.txt | AC | 11 ms | 5852 KB |
01_random_23.txt | AC | 12 ms | 5852 KB |
01_random_24.txt | AC | 11 ms | 5848 KB |
01_random_25.txt | WA | 11 ms | 5748 KB |
01_random_26.txt | WA | 11 ms | 5972 KB |
01_random_27.txt | WA | 11 ms | 5752 KB |
01_random_28.txt | WA | 7 ms | 5856 KB |
01_random_29.txt | AC | 2 ms | 5816 KB |
01_random_30.txt | AC | 2 ms | 5832 KB |
01_random_31.txt | WA | 5 ms | 5848 KB |
01_random_32.txt | AC | 9 ms | 5912 KB |
01_random_33.txt | WA | 2 ms | 5920 KB |
01_random_34.txt | WA | 5 ms | 5916 KB |
01_random_35.txt | AC | 3 ms | 5748 KB |
01_random_36.txt | WA | 3 ms | 5848 KB |
01_random_37.txt | WA | 8 ms | 5852 KB |
01_random_38.txt | AC | 5 ms | 5916 KB |
01_random_39.txt | AC | 3 ms | 5756 KB |
01_random_40.txt | AC | 11 ms | 5844 KB |
01_random_41.txt | WA | 11 ms | 5852 KB |
01_random_42.txt | WA | 11 ms | 5856 KB |
01_random_43.txt | AC | 4 ms | 5820 KB |
01_random_44.txt | AC | 6 ms | 5776 KB |
01_random_45.txt | AC | 2 ms | 5976 KB |
02_handmade_46.txt | AC | 7 ms | 5752 KB |
02_handmade_47.txt | AC | 2 ms | 5768 KB |
02_handmade_48.txt | AC | 7 ms | 5752 KB |
02_handmade_49.txt | AC | 2 ms | 5852 KB |
02_handmade_50.txt | AC | 12 ms | 5836 KB |
02_handmade_51.txt | WA | 12 ms | 5920 KB |
02_handmade_52.txt | WA | 9 ms | 5856 KB |
02_handmade_53.txt | WA | 8 ms | 5976 KB |