problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02701
Python
Time Limit Exceeded
N = int(input()) S = [] for i in range(N): s = input() if s not in S: S.append(s) print(len(S))
N = int(input()) S = [] for i in range(N): s = input() S.append(s) ans = len(S) S.sort() for i in range(1, N): if S[i] == S[i - 1]: ans -= 1 print(ans)
replace
4
7
4
11
TLE
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> prise(N); for (int i = 0; i < N; i++) { cin >> prise.at(i); } int minus = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (prise.at(i) == prise.at(j)) { prise.at(j) = j; ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> prise(N); for (int i = 0; i < N; i++) { cin >> prise.at(i); } int minus = 0; sort(prise.begin(), prise.end()); for (int i = 1; i < N; i++) { if (prise.at(i - 1) == prise.at(i)) { minus++; } } ...
replace
11
17
11
15
TLE
p02701
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); int cnt = 0; rep(i, n) { if (s[i - 1] != s[i]) cnt++; } cout << cnt << endl...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); int cnt = 1; for (int i = 1; i < n; i++) { if (s[i - 1] != s[i]) cnt++; } c...
replace
11
13
11
13
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define vl vector<ll> #define pii pair<int, int> #define vvi vector<vi> #define vvl vector<vl> #define all(x) x.begin(), x.end() #define contains(con, x) con.find(x) != con.end() #define fastread ios_base::sync_with_stdio(0), ci...
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define vl vector<ll> #define pii pair<int, int> #define vvi vector<vi> #define vvl vector<vl> #define all(x) x.begin(), x.end() #define contains(con, x) con.find(x) != con.end() #define fastread ios_base::sync_with_stdio(0), ci...
replace
24
25
24
25
-11
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { int i, t; cin >> t; string val; vector<string> name; for (i = 0; i < t; i++) { cin >> val; name.push_back(val); } sort(name.begin(), name.end()); for (i = 0; i < t; i++) { name.erase(unique(name.begin(), ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { int i, t; cin >> t; string val; vector<string> name; for (i = 0; i < t; i++) { cin >> val; name.push_back(val); } sort(name.begin(), name.end()); name.erase(unique(name.begin(), name.end()), name.end()); ...
replace
16
19
16
18
TLE
p02701
C++
Time Limit Exceeded
/* * WelcomeToAtCoder.cpp * * Created on: 2020/02/19 * Author: black */ #include <algorithm> #include <iostream> #include <unordered_set> #include <vector> using namespace std; int main() { int N; unordered_set<string> strList; string tmp; cin >> N; int count = 0; for (int i = 0; i < N; ++i) { ...
/* * WelcomeToAtCoder.cpp * * Created on: 2020/02/19 * Author: black */ #include <algorithm> #include <iostream> #include <unordered_set> #include <vector> using namespace std; int main() { int N; unordered_set<string> strList; string tmp; cin >> N; int count = 0; for (int i = 0; i < N; ++i) { ...
replace
21
22
21
22
TLE
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); int ans = 1; string prev = s[1]; for (int i = 1; i < n; i++) if (prev != s[i]) { ans++; prev = s[i]; } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); int ans = 1; string prev = s[0]; for (int i = 1; i < n; i++) if (prev != s[i]) { ans++; prev = s[i]; } cout << ans; }
replace
14
15
14
15
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define NewNode (TreeNode *)malloc(sizeof(TreeNode)) #define Mem(a, b) memset(a, b, sizeof(a)) const int N = 5e5 + 5; const int INF = 0x3f3f3f3f; const double EPS = 1e-10; const unsigned long long mod = 19999999999999997; const int II = 3.1415926535; typedef long long ll; t...
#include <bits/stdc++.h> using namespace std; #define NewNode (TreeNode *)malloc(sizeof(TreeNode)) #define Mem(a, b) memset(a, b, sizeof(a)) const int N = 5e5 + 5; const int INF = 0x3f3f3f3f; const double EPS = 1e-10; const unsigned long long mod = 19999999999999997; const int II = 3.1415926535; typedef long long ll; t...
replace
11
13
11
13
0
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main(void) { // Your code here! int n; cin >> n; vector<string> s(n); for (int i = 0; i < n; i++) cin >> s[i]; int ct = 0; for (int i = 0; i < n; i++) { ct++; for (int j = i + 1; j < n; j++) { if (s[i] == s[j]) { ct--; b...
#include <bits/stdc++.h> using namespace std; int main(void) { // Your code here! int n; cin >> n; vector<string> s(n); for (int i = 0; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); s.erase(unique(s.begin(), s.end()), s.end()); cout << s.size() << endl; }
replace
11
22
11
15
TLE
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> k(N); for (int i = 0; i < N; i++) { cin >> k.at(i); } sort(k.begin(), k.end()); cout << k.at(1) << endl; k.erase(unique(k.begin(), k.end())); cout << k.at(1) << endl; cout << k.size() << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> k(N); for (int i = 0; i < N; i++) { cin >> k.at(i); } sort(k.begin(), k.end()); k.erase(unique(k.begin(), k.end()), k.end()); cout << k.size() << endl; }
replace
11
14
11
12
0
p02701
C++
Runtime Error
#include <algorithm> #include <iostream> #include <stdio.h> #include <string> using namespace std; long long inp_c, i1, out_n; string inp_a[100005]; long long readNumber() { long long temp_func; scanf("%lld", &temp_func); return temp_func; }; long long printNumber(long long temp_func) { printf("%lld", temp_...
#include <algorithm> #include <iostream> #include <stdio.h> #include <string> using namespace std; long long inp_c, i1, out_n; string inp_a[200005]; long long readNumber() { long long temp_func; scanf("%lld", &temp_func); return temp_func; }; long long printNumber(long long temp_func) { printf("%lld", temp_...
replace
9
10
9
10
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n; cin >> n; vector<string> v(n); for (ll i = 0; i < n; i++) { cin >> v[i]; } sort(v.begin(), v.end()); ll ans = 0; for (ll i = 0; i < n; i++) { if (v[i] != v[i - 1]) ans++; } cout << ans << endl; r...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n; cin >> n; vector<string> v(n); for (ll i = 0; i < n; i++) { cin >> v[i]; } sort(v.begin(), v.end()); ll ans = 1; for (ll i = 1; i < n; i++) { if (v[i] != v[i - 1]) ans++; } cout << ans << endl; r...
replace
12
14
12
14
0
p02701
C++
Runtime Error
#include <iostream> #include <set> using namespace std; int main() { int N; int i, num; string S[1000]; cin >> N; set<string> gift; for (i = 0; i < N; i++) { cin >> S[i]; } for (i = 0; i < N; i++) { gift.insert(S[i]); } num = gift.size(); cout << num << endl; }
#include <iostream> #include <set> using namespace std; int main() { int N; int i, num; N >= 1; N <= 200000; string S[200000]; cin >> N; set<string> gift; for (i = 0; i < N; i++) { cin >> S[i]; } for (i = 0; i < N; i++) { gift.insert(S[i]); } num = gift.size(); cout << num << endl; }
replace
7
8
7
10
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> str(n); rep(i, n) cin >> str[i]; sort(str.begin(), str.end()); int cnt = 1; rep(i, n - 1) { if (str[i - 1] != str[i]) cnt++; } cou...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> str(n); rep(i, n) cin >> str[i]; sort(str.begin(), str.end()); int cnt = 1; for (int i = 1; i < n; i++) { if (str[i - 1] != str[i]) cn...
replace
12
13
12
13
0
p02701
C++
Runtime Error
#include <iostream> #include <set> using namespace std; int main() { int N; int i, num; N >= 1; N <= 20000; string S[20000]; cin >> N; set<string> gift; for (i = 0; i < N; i++) { cin >> S[i]; } for (i = 0; i < N; i++) { gift.insert(S[i]); } num = gift.size(); cout << num << endl; }
#include <iostream> #include <set> using namespace std; int main() { int N; int i, num; N >= 1; N <= 200000; string S[200000]; cin >> N; set<string> gift; for (i = 0; i < N; i++) { cin >> S[i]; } for (i = 0; i < N; i++) { gift.insert(S[i]); } num = gift.size(); cout << num << endl; }
replace
8
10
8
10
0
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; int count = n; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (s[i] != "A" && s[i] == s[j]) { count--; s[j] = "A"; } ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; int count = n; sort(s, s + n); for (int i = 1; i < n; i++) { if (s[i - 1] == s[i]) { count--; } } cout << count << endl; }
replace
10
16
10
14
TLE
p02701
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { ...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { ...
replace
80
89
80
84
TLE
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> v; while (n--) { string s; cin >> s; v.push_back(s); } vector<string>::iterator ip; ip = unique(v.begin(), v.begin() + n); v.resize(distance(v.begin(), ip)); cout << v.size() << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> v; while (n--) { string s; cin >> s; v.push_back(s); } unordered_set<string> s; int distinct = 0; for (int i = 0; i < v.size(); i++) { if (s.find(v[i]) == s.end()) { s.insert(v[i]); ...
replace
15
19
15
24
-11
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repp(i, n) for (int i = 1; i <= (int)(n); i++) #define co(x) cout << x << endl typedef long long int lint; int main() { int N; cin >> N; vector<string> S(0); string si; bool flg = true; for (int i = ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repp(i, n) for (int i = 1; i <= (int)(n); i++) #define co(x) cout << x << endl typedef long long int lint; int main() { int N; cin >> N; vector<string> S(N); rep(i, N) { cin >> S.at(i); } sort(S.begin()...
replace
10
27
10
14
TLE
p02701
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define REP(i, s, n) for (int i = s; i < (n); ++i) #define ALL(n) begin(n), end(n) using ll = long long; const ll INF = 1e18; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define REP(i, s, n) for (int i = s; i < (n); ++i) #define ALL(n) begin(n), end(n) using ll = long long; const ll INF = 1e18; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <...
replace
28
50
28
54
TLE
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i <= (n); ++i) #define Sort(Array) sort(Array.begin(), Array.end()) #define Reverse(a) reverse(a.begin(), a.end()) #define out(ans) cout << ans << endl; int main() ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i <= (n); ++i) #define Sort(Array) sort(Array.begin(), Array.end()) #define Reverse(a) reverse(a.begin(), a.end()) #define out(ans) cout << ans << endl; int main() ...
replace
12
27
12
22
TLE
p02701
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <string> using namespace std; int main(void) { int i, cnt, n; string a[100000]; scanf("%d", &n); for (i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); cnt = 1; for (i = 1; i < n; i++) { if (a[i] != a[i - 1]) ...
#include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <string> using namespace std; int main(void) { int i, cnt, n; string a[200000]; scanf("%d", &n); for (i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); cnt = 1; for (i = 1; i < n; i++) { if (a[i] != a[i - 1]) ...
replace
8
9
8
9
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; string s[100010]; map<string, int> mp; int n; int main() { cin >> n; // for(register int i = 1; i <= n; i++) cin >> s[i]; for (register int i = 1; i <= n; i++) { cin >> s[i]; mp[s[i]]++; } int jsq = 0; map<string, int>::iterator iter; for (iter = mp...
#include <bits/stdc++.h> using namespace std; string s[300010]; map<string, int> mp; int n; int main() { cin >> n; // for(register int i = 1; i <= n; i++) cin >> s[i]; for (register int i = 1; i <= n; i++) { cin >> s[i]; mp[s[i]]++; } int jsq = 0; map<string, int>::iterator iter; for (iter = mp...
replace
4
5
4
5
0
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> arr(N); for (int i = 0; i < N; i++) { cin >> arr[i]; } int flag = true; vector<string> kind; for (int i = 0; i < N; i++) { flag = true; for (int j = 0; j < kind.size(); j++) { if (arr[i] == ki...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> arr(N); for (int i = 0; i < N; i++) { cin >> arr[i]; } sort(arr.begin(), arr.end()); arr.erase(unique(arr.begin(), arr.end()), arr.end()); cout << arr.size() << endl; }
replace
12
26
12
15
TLE
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 100005; string s[N]; set<string> st; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; st.insert(s[i]); } cout << st.size() << endl; }
#include <bits/stdc++.h> using namespace std; const int N = 200005; string s[N]; set<string> st; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; st.insert(s[i]); } cout << st.size() << endl; }
replace
2
3
2
3
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define pb push_back #define sz(s) (int)s.size() #define all(v) v.begin(), v.end() #define show(a) cerr << #a << " -> " << a << "\n" ll mn = 1000000, mx = -1000000000; ll cnt, cnt2, sum, x, y; int n; string s[10000]; int main(...
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define pb push_back #define sz(s) (int)s.size() #define all(v) v.begin(), v.end() #define show(a) cerr << #a << " -> " << a << "\n" ll mn = 1000000, mx = -1000000000; ll cnt, cnt2, sum, x, y; int n; string s[300001]; int main...
replace
14
15
14
15
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); int cnt = 0; rep(i, n) { if (s[i] != s[i - 1]) cnt++; } cout << cnt << endl...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); int cnt = 1; for (int i = 1; i < n; i++) { if (s[i] != s[i - 1]) cnt++; } c...
replace
11
13
11
13
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); int count = N; for (int i = 0; i < N; i++) { if (S.at(i) == S.at(i + 1)) { count--; } } cout << count << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); int count = N; for (int i = 1; i < N; i++) { if (S.at(i - 1) == S.at(i)) { count--; } } cout << count << endl; ...
replace
11
13
11
13
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02701
C++
Runtime Error
#include <iostream> #include <string> #include <unordered_map> using namespace std; int main() { int N; cin >> N; string S[20010]; for (int i = 0; i < N; i++) { cin >> S[i]; } unordered_map<string, int> map; for (int i = 0; i < N; i++) { map[S[i]] = 1; } cout << map.size() << endl; }
#include <iostream> #include <string> #include <unordered_map> using namespace std; int main() { int N; cin >> N; string S[200010]; for (int i = 0; i < N; i++) { cin >> S[i]; } unordered_map<string, int> map; for (int i = 0; i < N; i++) { map[S[i]] = 1; } cout << map.size() << endl; }
replace
9
10
9
10
0
p02701
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; const int N = 1e5 + 10; string s[N]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); cout << (unique(s, s + n) - s) << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> using namespace std; const int N = 2e5 + 10; string s[N]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); cout << (unique(s, s + n) - s) << endl; return 0; }
replace
5
6
5
6
0
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, k; k = 1; cin >> N; vector<string> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (vec.at(i) == vec.at(j)) { break; } else { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, k; k = 1; cin >> N; vector<string> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } sort(vec.begin(), vec.end()); for (int i = 0; i < N - 1; i++) { if (vec.at(i) != vec.at(i + 1)) { k = k + 1; } } cout << k...
replace
11
20
11
15
TLE
p02701
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <map> //map<int, int> x; #include <numeric> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i <= (int)(n); i++) #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) using ll = long long; using name...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <map> //map<int, int> x; #include <numeric> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i <= (int)(n); i++) #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) using ll = long long; using name...
replace
18
19
18
19
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s.at(i); sort(s.begin(), s.end()); int ans = n; rep(i, n) { if (s[i] == s[i - 1]) ans--; } cout << ans << e...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s.at(i); sort(s.begin(), s.end()); int ans = n; for (int j = 1; j < n; j++) { if (s[j] == s[j - 1]) ans--; } ...
replace
12
14
12
14
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); vector<string> vec(20001); int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> vec[i]; } sort(vec.begin(), vec.end()); vec.erase(unique(vec.begin(), vec.end()), vec.end()); cout << vec.size() -...
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); vector<string> vec(200002); int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> vec[i]; } sort(vec.begin(), vec.end()); vec.erase(unique(vec.begin(), vec.end()), vec.end()); cout << vec.size() ...
replace
6
7
6
7
0
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int N; vector<string> s; int main() { cin >> N; s.resize(N); for (int i = 0; i < N; i++) cin >> s[i]; int cnt = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (s[i] == s[j]) break; if (j == N - 1) cnt++;...
#include <bits/stdc++.h> using namespace std; int N; vector<string> s; int main() { cin >> N; s.resize(N); for (int i = 0; i < N; i++) cin >> s[i]; sort(s.begin(), s.end()); int cnt = 1; for (int i = 0; i < N - 1; i++) { if (s[i] != s[i + 1]) cnt++; } cout << cnt << endl; return 0; }
replace
11
20
11
15
TLE
p02701
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <stdio.h> #include <vector> using namespace std; void solve(long long N, std::vector<std::string> S) { long long ans = 0; std::vector<std::string> tmp; std::vector<std::string>::iterator sIter; for (long long i = 0; i < N; i++) { sIter = std::find(tmp.be...
#include <algorithm> #include <iostream> #include <stdio.h> #include <vector> using namespace std; void solve(long long N, std::vector<std::string> S) { std::sort(S.begin(), S.end()); S.erase(std::unique(S.begin(), S.end()), S.end()); cout << S.size() << endl; return; } // Generated by 1.1.6 https://github.c...
replace
8
22
8
11
TLE
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } vector<string> s; int answer = 0; for (int i = 0; i < N; i++) { if (find(s.begin(), s.end(), S.at(i)) == s.end()) { answer++; s.emplace_ba...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); S.erase(unique(S.begin(), S.end()), S.end()); cout << S.size() << endl; }
replace
10
19
10
13
TLE
p02701
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; const int N = 2e5 + 5; int a[N][26]; int cnt[N], idx, ans; void ins(char str[]) { int p = 0; for (int i = 0; str[i]; i++) { int u = str[i] - 'a'; if (!a[p][u]) a[p][u] = ++idx; p = ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; const int N = 2e6 + 5; int a[N][26]; int cnt[N], idx, ans; void ins(char str[]) { int p = 0; for (int i = 0; str[i]; i++) { int u = str[i] - 'a'; if (!a[p][u]) a[p][u] = ++idx; p = ...
replace
6
7
6
7
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); int ans = 0; for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); for (int i = 0; i < N; i++) { bool memo = true; if (S.at(i) == S.at(i + 1)) { memo = false; } ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); int ans = 0; for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); for (int i = 0; i < N; i++) { bool memo = true; if (i != N - 1) { if (S.at(i) == S.at(i + 1)) { ...
replace
14
16
14
18
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define REP(i, d, n) for (int i = (d); i < (n); ++i) #define all(v) v.begin(), v.end() using ll = long long; int main() { ll n; cin >> n; ll ans = n; ll ka = 0; vector<string> a(n); rep(i, n) { cin >> a.at(i)...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define REP(i, d, n) for (int i = (d); i < (n); ++i) #define all(v) v.begin(), v.end() using ll = long long; int main() { ll n; cin >> n; ll ans = n; ll ka = 0; vector<string> a(n); rep(i, n) { cin >> a.at(i); } ...
replace
14
22
14
20
TLE
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int i, j, n; int flag = 0; int count = 0; cin >> n; vector<string> s(n); for (i = 0; i < n; i++) { cin >> s.at(i); } for (i = 0; i < n; i++) { flag = 0; for (j = 0; j < i; j++) { if (s.at(i) == s.at(j)) { flag = 1; ...
#include <bits/stdc++.h> using namespace std; int main() { int i, j, n; int flag = 0; int count = 0; cin >> n; vector<string> s(n); for (i = 0; i < n; i++) { cin >> s.at(i); } sort(s.begin(), s.end()); s.erase(unique(s.begin(), s.end()), s.end()); for (i = 0; i < s.size(); i++) { count++...
replace
14
24
14
19
TLE
p02701
C++
Time Limit Exceeded
// gacha #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> s(n); for (int i = 0; i < n; i++) { cin >> s[i]; } vector<string> v; v.push_back(s[0]); for (int i = 1; i < n; i++) { v.push_back(s[i]); sort(v.begin(), v.end()); v.erase(unique(v.begin()...
// gacha #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> s(n); for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s.begin(), s.end()); s.erase(unique(s.begin(), s.end()), s.end()); cout << s.size() << endl; return 0; }
replace
11
19
11
16
TLE
p02701
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S[i]; } vector<string> prize; for (int i = 0; i < N; i++) { if (find(prize.begin(), prize.end(), S[i]) == prize.end()) { prize.push_back(S[i]); } } ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S[i]; } sort(S.begin(), S.end()); S.erase(unique(S.begin(), S.end()), S.end()); // vector<string> prize; // for (int i = 0; i < N; i++) { // if (find(prize.beg...
replace
11
18
11
20
TLE
p02701
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; string s[10005]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> s[i]; } sort(s + 1, s + 1 + n); int cnt = 1; for (int i = 2; i <= n; i++) { if (s[i] != s[i - 1]) { cnt++; } } cout << ...
#include <algorithm> #include <iostream> #include <string> using namespace std; string s[200005]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> s[i]; } sort(s + 1, s + 1 + n); int cnt = 1; for (int i = 2; i <= n; i++) { if (s[i] != s[i - 1]) { cnt++; } } cout <<...
replace
4
5
4
5
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s[100005]; long n, i; map<string, long> mp; while (cin >> n) { for (i = 0; i < n; i++) { cin >> s[i]; mp[s[i]] = i; } cout << mp.size() << endl; mp.clear(); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s[200005]; long n, i; map<string, long> mp; while (cin >> n) { for (i = 0; i < n; i++) { cin >> s[i]; mp[s[i]] = i; } cout << mp.size() << endl; mp.clear(); } return 0; }
replace
3
4
3
4
0
p02701
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; string s[100000]; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s, s + n); int ans = 1; for (int i = 1; i < n; i++) { if (s[i] != s[i - 1]) { ans++; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; string s[200000]; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s, s + n); int ans = 1; for (int i = 1; i < n; i++) { if (s[i] != s[i - 1]) { ans++; } } cout << ans << endl; }
replace
4
5
4
5
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
replace
557
559
557
558
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int mod = 1000000007; #define ll long long string s; int tens[220000] = {0}; int temp[220000] = {0}; void pre() { tens[0] = 1; rep(i, 210000) { tens[i + 1] = (tens[i] * 10) % 2019; } } int solve() { temp[0] = s[s.size() ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int mod = 1000000007; #define ll long long string s; int tens[220000] = {0}; int temp[220000] = {0}; void pre() { tens[0] = 1; rep(i, 210000) { tens[i + 1] = (tens[i] * 10) % 2019; } } void solve() { temp[0] = s[s.size()...
replace
14
15
14
15
0
p02702
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long int ll; typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; const ll mod = 1e9 + 7;...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long int ll; typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; const ll mod = 1e9 + 7;...
delete
22
23
22
22
TLE
p02702
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <tuple> #include <vector> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<...
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <tuple> #include <vector> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<...
replace
87
101
87
100
TLE
p02702
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { string s; cin >> s; ll ans = 0; int n = s.size(); vector<vector<ll>> dp(n, vector<ll>(n)); vector<ll> v(2020); rep(i, n) { int now = (int)...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { string s; cin >> s; ll ans = 0; int n = s.size(); vector<ll> v(2020); rep(i, n) { int now = (int)(s[i] - '0'); vector<ll> n = v; rep...
delete
11
12
11
11
TLE
p02702
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; int F[200000][2019] = {}; int main() { string S; cin >> S; int i, r, s, N = S.size(), R[10][2019] = {}; for (r = 0; r < 2019; r++) { for (i = 1; i < 10; i++) { for (s = 0; s < 2019; s++) { if ((10 * s + i) % 2019 == r) { R[i][r] = s; ...
#include <bits/stdc++.h> using namespace std; unsigned short F[200000][2019] = {}; int main() { string S; cin >> S; int i, r, s, N = S.size(), R[10][2019] = {}; for (r = 0; r < 2019; r++) { for (i = 1; i < 10; i++) { for (s = 0; s < 2019; s++) { if ((10 * s + i) % 2019 == r) { R[i][r...
replace
2
3
2
3
MLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll INF = 100000000; #define rep1(i, n) for (ll i = 0; i < (n); i++) #define rep2(i, k, n) for (ll i = k; i < (n); i++) // 累積和的なものを考えると良いらしい int main() { string s; cin >> s; ll n = s.size(); vector<ll> a(2019, 0); ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll INF = 100000000; #define rep1(i, n) for (ll i = 0; i < (n); i++) #define rep2(i, k, n) for (ll i = k; i < (n); i++) // 累積和的なものを考えると良いらしい int main() { string s; cin >> s; ll n = s.size(); vector<ll> a(2019, 0); ...
replace
24
25
24
25
0
p02702
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rng(i, a, b) for (int i = int(a); i < int(b); i++) #define rep(i, b) rng(i, 0, b) #define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--) #define per(i, b) gnr(i, 0, b) #define bg begin() #define ed end() #define all(x) x.bg, x.ed #define pb push_back #def...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rng(i, a, b) for (int i = int(a); i < int(b); i++) #define rep(i, b) rng(i, 0, b) #define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--) #define per(i, b) gnr(i, 0, b) #define bg begin() #define ed end() #define all(x) x.bg, x.ed #define pb push_back #def...
replace
37
44
37
45
TLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll MOD = 2019; int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); string s; cin >> s; ll n = s.size(); vector<ll> ab(n + 1, 0); ll tmp = 0; ll mod = 1; for (int i = 0; i < n; i++) { tmp += (ll(s[n - 1 - i] ...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll MOD = 2019; int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); string s; cin >> s; ll n = s.size(); vector<ll> ab(n + 1, 0); ll tmp = 0; ll mod = 1; for (int i = 0; i < n; i++) { tmp += (ll(s[n - 1 - i] ...
replace
22
23
22
23
0
p02702
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; for (int i = 0; i < s.length(); i++) { int num = (s[i] - '0'); for (int j = i + 1; j < s.length(); j++) { num = 10 * num + (s[j] - '0'); if (num % 2019 == 0) count++; num %= 2019; ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long dp[2][2019]; for (int i = 0; i < 2019; i++) { dp[0][i] = 0; dp[1][i] = 0; } long long count = 0; for (long long i = 0; i < s.length(); i++) { int d = s[i] - '0'; for (int j = 0; j < 2019; j++) ...
replace
8
17
8
25
TLE
p02702
C++
Runtime Error
// by Isaunoya #include <bits/stdc++.h> #define int long long using namespace std; struct io { char buf[1 << 25 | 3], *s; int f; io() { f = 0, buf[fread(s = buf, 1, 1 << 25, stdin)] = '\n'; } io &operator>>(int &x) { for (x = f = 0; !isdigit(*s); ++s) f |= *s == '-'; while (isdigit(*s)) x = ...
// by Isaunoya #include <bits/stdc++.h> #define int long long using namespace std; struct io { char buf[1 << 25 | 3], *s; int f; io() { f = 0, buf[fread(s = buf, 1, 1 << 25, stdin)] = '\n'; } io &operator>>(int &x) { for (x = f = 0; !isdigit(*s); ++s) f |= *s == '-'; while (isdigit(*s)) x = ...
replace
17
18
17
18
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); int ten = 1, sum = 0, cnt[2019] = {}; long long ans = 0; for (int i = 0; i < s.size(); i++) { cnt[sum]++; sum += ((s[i] - '0') * ten) % 2019; ans += cnt[sum]; ten = (ten * 10) % 2019...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); int ten = 1, sum = 0, cnt[2019] = {}; long long ans = 0; for (int i = 0; i < s.size(); i++) { cnt[sum]++; sum += (s[i] - '0') * ten; sum %= 2019; ans += cnt[sum]; ten = (ten * 10...
replace
12
13
12
14
-11
p02702
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fst first #define snd second #define all(cont) cont.begin(), cont.end() #define foreach(it, l) for (auto it = l.begin(); it != l.end(); it++) #define fore(i, a, b) for (int i = a, almo5t = b; i < almo5t; ++i) #define SZ(x) ((int)x.size()) #defin...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fst first #define snd second #define all(cont) cont.begin(), cont.end() #define foreach(it, l) for (auto it = l.begin(); it != l.end(); it++) #define fore(i, a, b) for (int i = a, almo5t = b; i < almo5t; ++i) #define SZ(x) ((int)x.size()) #defin...
replace
28
30
28
30
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i,...
replace
39
40
39
40
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gnu_cxx; #define ll long long #define ii pair<ll, ll> #define iii pair<ii, ll> #define fi first #define se second #define endl '\n...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gnu_cxx; #define ll long long #define ii pair<ll, ll> #define iii pair<ii, ll> #define fi first #define se second #define endl '\n...
replace
46
47
46
47
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int modpow(int a, int n, int mod) { int res = 1; while (n > 0) { if (n & 1) res *= a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { const static int mod = 2019; int cnt_bin[2019] = {}; string S; cin >> S; int size = S.siz...
#include <bits/stdc++.h> using namespace std; int modpow(int a, int n, int mod) { int res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { const static int mod = 2019; int cnt_bin[2019] = {}; string S; cin >> S; int size = ...
replace
7
8
7
8
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int A[123456]; signed main() { string s; cin >> s; reverse(s.begin(), s.end()); for (int i = 0, t = 1; i < s.size(); i++) { int a = s[i] - '0'; A[i + 1] = (A[i] + a * t) % 2019; (t *= 10) %= 2019; } map<int, int> m; for (int...
#include <bits/stdc++.h> using namespace std; #define int long long int A[223456]; signed main() { string s; cin >> s; reverse(s.begin(), s.end()); for (int i = 0, t = 1; i < s.size(); i++) { int a = s[i] - '0'; A[i + 1] = (A[i] + a * t) % 2019; (t *= 10) %= 2019; } map<int, int> m; for (int...
replace
4
5
4
5
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll mod = 1e9 + 7; ll cnt[2050]; ll to[2050]; ll a[2050]; ll ans; void shift() { ll cntt[2050] = {}; for (int i = 0; i < 2019; i++) { cntt[to[i]] = cnt[i]; } for (int i = 0; i < 2019; i++) { cnt[i] = cntt[i]; } } int main() { stri...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll mod = 1e9 + 7; ll cnt[2050]; ll to[2050]; ll a[200050]; ll ans; void shift() { ll cntt[2050] = {}; for (int i = 0; i < 2019; i++) { cntt[to[i]] = cnt[i]; } for (int i = 0; i < 2019; i++) { cnt[i] = cntt[i]; } } int main() { st...
replace
7
8
7
8
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> #include <climits> #include <sstream> using namespace std; int main() { string S; cin >> S; map<long long, long long> mp; mp[0] = 1; for (int i = 1; i <= S.size(); i++) { string s = S.substr(S.size() - i, i); // cout << s << endl; long long n = stoll(s); mp[n % 2019]...
#include <bits/stdc++.h> #include <climits> #include <sstream> using namespace std; int main() { string S; cin >> S; map<long long, long long> mp; mp[0] = 1; long long now = 0, ten = 1; for (int i = S.size() - 1; i >= 0; i--) { now = (now + (S[i] - '0') * ten) % 2019; ten *= 10; ten %= 2019; ...
replace
10
16
10
16
0
p02702
Python
Time Limit Exceeded
S = input() N = len(S) cnt = 0 for i in range(N - 3): for j in range(i + 4, N + 1): if int(S[i:j]) % 2019 == 0: # print(i, j) cnt += 1 print(cnt)
S = input() N = len(S) num = [0] * 2019 num[0] = 1 now, ans = 0, 0 _10 = 1 for i in range(N - 1, -1, -1): now = (now + int(S[i]) * _10) % 2019 _10 *= 10 _10 %= 2019 ans += num[now] num[now] += 1 print(ans)
replace
3
10
3
16
TLE
p02702
Python
Time Limit Exceeded
from collections import defaultdict S = input() n = len(S) mod = 2019 d = defaultdict(int) d[0] = 1 num = 0 for i in reversed(range(n)): num += int(S[i]) * 10 ** (n - i - 1) num %= mod d[num] += 1 ans = 0 for v in d.values(): ans += v * (v - 1) // 2 print(ans)
from collections import defaultdict S = input() n = len(S) mod = 2019 d = defaultdict(int) d[0] = 1 num = 0 for i in reversed(range(n)): num += int(S[i]) * pow(10, n - i - 1, mod) num %= mod d[num] += 1 ans = 0 for v in d.values(): ans += v * (v - 1) // 2 print(ans)
replace
10
11
10
11
TLE
p02702
Python
Time Limit Exceeded
S = input() N = len(S) map_ = [-1] * 2019 map_[0] = 0 ans = 0 now = 0 for i in range(0, N + 1): now += (int(S[N - i - 1]) * (10**i)) % 2019 map_[now % 2019] += 1 ans += map_[now % 2019] print(ans)
S = input() N = len(S) map_ = [-1] * 2019 map_[0] = 0 ans = 0 now = 0 for i in range(0, N): now = (now + int(S[N - i - 1]) * pow(10, i, 2019)) % 2019 map_[now] += 1 ans += map_[now] print(ans)
replace
7
11
7
11
TLE
p02702
Python
Time Limit Exceeded
S = str(input()) # 余りのリスト counts = [0] * 2019 n, d = 0, 1 for s in S[::-1]: n += int(s) * d d *= 10 n %= 2019 counts[n] += 1 ans = counts[0] for count in counts: ans += count * (count - 1) // 2 print(ans)
S = str(input()) # 余りのリスト counts = [0] * 2019 n, d = 0, 1 for s in S[::-1]: n += int(s) * d d *= 10 n %= 2019 d %= 2019 counts[n] += 1 ans = counts[0] for count in counts: ans += count * (count - 1) // 2 print(ans)
insert
9
9
9
10
TLE
p02702
Python
Time Limit Exceeded
from collections import Counter S = input() N = len(S) L = [0] * (N + 1) s = 0 for i in range(N): s += int(S[N - 1 - i]) * pow(10, i) L[i + 1] = s % 2019 C = Counter(L) cnt = 0 for key in list(C.keys()): k = C[key] cnt += (k * (k - 1)) // 2 print(cnt)
from collections import Counter S = input() N = len(S) L = [0] * (N + 1) s = 0 for i in range(N): s += int(S[N - 1 - i]) * pow(10, i, 2019) L[i + 1] = s % 2019 C = Counter(L) cnt = 0 for key in list(C.keys()): k = C[key] cnt += (k * (k - 1)) // 2 print(cnt)
replace
9
10
9
10
TLE
p02702
Python
Time Limit Exceeded
import sys sys.setrecursionlimit(10**7) read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = list(input()) L = len(S) c = 0 t = 0 md = [0] * 2019 md[0] += 1 for i in range(L - 1, -1, -1): t += int(S[i]) * pow(10, c) c += 1 md[t % 2019] += 1 ans = ...
import sys sys.setrecursionlimit(10**7) read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = list(input()) L = len(S) c = 0 t = 0 md = [0] * 2019 md[0] += 1 for i in range(L - 1, -1, -1): t += int(S[i]) * pow(10, c, 2019) c += 1 md[t % 2019] += 1 ...
replace
16
17
16
17
TLE
p02702
Python
Time Limit Exceeded
from collections import defaultdict S = input() ans = 0 N = len(S) mod = 2019 dp = defaultdict(int) cur = 0 for i in range(N, -1, -1): if i == N: dp[0] += 1 else: cur += ((10 ** (N - i - 1)) * int(S[i])) % mod cur %= mod dp[cur] += 1 for v in dp.values(): if v > 1: a...
from collections import defaultdict def solve(input_s: str): ans = 0 n = len(input_s) mod = 2019 dp = defaultdict(int) cur = 0 for i in range(n, -1, -1): if i == n: dp[0] += 1 else: # cur += ((10 ** (n - i - 1)) * int(input_s[i])) % mod これはnがでかくなるとめちゃめちゃ...
replace
2
19
2
26
TLE
p02702
Python
Time Limit Exceeded
def main(): s = input() rem = [0] * 2019 # the count of the each remainder: 0 ~ 2018 rem[0] = 1 # why? can't understand. temp = 0 digit = 1 for i, c in enumerate(s[::-1]): # No time to pow. temp += int(c) * digit rem[temp % 2019] += 1 digit *= 10 return su...
def main(): s = input() rem = [0] * 2019 # the count of the each remainder: 0 ~ 2018 rem[0] = 1 # why? can't understand. temp = 0 digit = 1 for i, c in enumerate(s[::-1]): # No time to pow. temp += int(c) * digit rem[temp % 2019] += 1 digit *= 10 digit ...
insert
12
12
12
13
TLE
p02702
Python
Time Limit Exceeded
s = list(input()) s.reverse() n = len(s) now = 0 mods = [0] * 2019 mods[0] += 1 for i in range(n): now += pow(10, i) * int(s[i]) now %= 2019 mods[now] += 1 ans = 0 for i in mods: ans += (i * (i - 1)) // 2 print(ans)
if __name__ == "__main__": s = list(input()) s.reverse() n = len(s) now = 0 mods = [0] * 2019 mods[0] += 1 ten = 1 for i in range(n): now += ten * int(s[i]) now %= 2019 ten *= 10 ten %= 2019 mods[now] += 1 ans = 0 for i in mods: ans...
replace
0
14
0
18
TLE
p02702
Python
Time Limit Exceeded
def main(): s = input() mod = 2019 n = 0 R = [0] * mod R[0] += 1 for i in range(len(s)): n += int(s[-i - 1]) * (10**i) % mod R[n % mod] += 1 print(sum([r * (r - 1) // 2 for r in R])) if __name__ == "__main__": main()
def main(): s = input() mod = 2019 n = 0 R = [0] * mod R[0] += 1 for i in range(len(s)): n += int(s[-i - 1]) * pow(10, i, mod) R[n % mod] += 1 print(sum([r * (r - 1) // 2 for r in R])) if __name__ == "__main__": main()
replace
8
9
8
9
TLE
p02702
Python
Time Limit Exceeded
def main(): s = list(input()) s.reverse() MOD = 2019 tot = 0 ans = 0 d = [0 for _ in range(MOD)] for i in range(len(s)): d[tot] += 1 x = (10**i) % MOD p = int(s[i]) * x p %= MOD tot = (tot + p) % MOD ans += d[tot] return ans if __name__ =...
def main(): s = list(input()) s.reverse() MOD = 2019 tot = 0 ans = 0 d = [0 for _ in range(MOD)] for i in range(len(s)): d[tot] += 1 x = pow(10, i, MOD) p = int(s[i]) * x p %= MOD tot = (tot + p) % MOD ans += d[tot] return ans if __name__...
replace
9
10
9
10
TLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> #define LLI long long int #define pii pair<int, int> #define fst first #define sec second #define ULTRA 2134567890 #define de(x) if (x != 0 && MODE == x) #define MODE 0 using namespace std; char S[107]; int cnt[2019] = {}; int main() { int i, j; scanf("%s", S); int N = strlen(S); L...
#include <bits/stdc++.h> #define LLI long long int #define pii pair<int, int> #define fst first #define sec second #define ULTRA 2134567890 #define de(x) if (x != 0 && MODE == x) #define MODE 0 using namespace std; char S[200007]; int cnt[2019] = {}; int main() { int i, j; scanf("%s", S); int N = strlen(S); ...
replace
10
11
10
11
0
p02702
Python
Time Limit Exceeded
S = input() cnt = 0 for i in range(len(S)): for j in range(i + 4, len(S)): if int(S[i : j + 1]) % 2019 == 0: cnt += 1 print(cnt)
import bisect, collections, copy, heapq, itertools, math, string import sys def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readlin...
replace
0
7
0
50
TLE
p02702
Python
Runtime Error
S = list(map(int, list(input()))) mod = 2019 ss = [0] tmp = 0 for i, s in enumerate(S[::-1]): tmp += s * pow(10, i, mod) tmp %= mod ss.append(tmp) cnts = [0] * 2018 ans = 0 for s in ss: ans += cnts[s] cnts[s] += 1 print(ans)
S = list(map(int, list(input()))) mod = 2019 ss = [0] tmp = 0 for i, s in enumerate(S[::-1]): tmp += s * pow(10, i, mod) tmp %= mod ss.append(tmp) cnts = [0] * 2019 ans = 0 for s in ss: ans += cnts[s] cnts[s] += 1 print(ans)
replace
10
11
10
11
0
p02702
Python
Time Limit Exceeded
def main(): A = input()[::-1] A = "0" + A # lis_num = [int(s) for s in A] # print(lis_num) # S = [0] * len(lis_num) S = [0] * len(A) cnt = [0] * 2019 cnt[0] = 1 for i in range(len(A) - 1): S[i + 1] = (S[i] + int(A[i + 1]) * pow(10, i)) % 2019 cnt[S[i + 1] % 2019] +...
def main(): A = input()[::-1] A = "0" + A # lis_num = [int(s) for s in A] # print(lis_num) # S = [0] * len(lis_num) S = [0] * len(A) cnt = [0] * 2019 cnt[0] = 1 for i in range(len(A) - 1): S[i + 1] = (S[i] + int(A[i + 1]) * pow(10, i, 2019)) % 2019 cnt[S[i + 1] % 2...
replace
13
14
13
14
TLE
p02702
Python
Time Limit Exceeded
from collections import Counter # forを逆から回して下から素直にmodを取るとTLEだった # 累積和的な計算で高速化、やりやすくするためにreverse S = input()[::-1] # ex. 1817181712114 → 4112171817181 # print(S) # 0桁目までのMODを0とすることで、 # 1桁目を含む数が2019の倍数の時に都合が良くなる X = [0] # 4,14,114,2114,12114,...のmod2019を計算 for i, s in enumerate(S): X.append((X[-1] + int(s) * 10**...
from collections import Counter # forを逆から回して下から素直にmodを取るとTLEだった # 累積和的な計算で高速化、やりやすくするためにreverse S = input()[::-1] # ex. 1817181712114 → 4112171817181 # print(S) # 0桁目までのMODを0とすることで、 # 1桁目を含む数が2019の倍数の時に都合が良くなる X = [0] # 4,14,114,2114,12114,...のmod2019を計算 for i, s in enumerate(S): X.append((X[-1] + int(s) * pow(...
replace
15
16
15
16
TLE
p02702
Python
Time Limit Exceeded
s = str(input()) num = [int(s[-1])] for i in range(1, len(s)): num.append(num[-1] + pow(10, i) * int(s[-i - 1])) mod = [1] + [0] * 2018 ans = 0 for i in num: m = i % 2019 ans += mod[m] mod[m] += 1 print(ans)
s = str(input()) num = [int(s[-1])] for i in range(1, len(s)): tmp = num[-1] + pow(10, i, 2019) * int(s[-i - 1]) num.append(tmp % 2019) mod = [1] + [0] * 2018 ans = 0 for i in num: m = i % 2019 ans += mod[m] mod[m] += 1 print(ans)
replace
4
5
4
6
TLE
p02702
Python
Time Limit Exceeded
def solve(s): dp = [0] * 2019 dp[0] = 1 r = 0 for i in range(1, len(s) + 1): r += int(s[-i]) * (10 ** (i - 1)) r %= 2019 dp[r] += 1 res = 0 for r in range(2019): res += dp[r] * (dp[r] - 1) // 2 return res def main(): s = input() res = solve(s) pr...
def solve(s): dp = [0] * 2019 dp[0] = 1 r = 0 for i in range(1, len(s) + 1): r += int(s[-i]) * pow(10, i - 1, 2019) r %= 2019 dp[r] += 1 res = 0 for r in range(2019): res += dp[r] * (dp[r] - 1) // 2 return res def main(): s = input() res = solve(s) ...
replace
5
6
5
6
TLE
p02702
Python
Time Limit Exceeded
import sys from collections import Counter input = sys.stdin.readline sys.setrecursionlimit(2 * 10**6) def inpl(): return list(map(int, input().split())) def main(): S = input().strip()[::-1] MOD = 2019 T = [0, int(S[0])] for d, s in enumerate(S): if d == 0: continue ...
import sys from collections import Counter input = sys.stdin.readline sys.setrecursionlimit(2 * 10**6) def inpl(): return list(map(int, input().split())) def main(): S = input().strip()[::-1] MOD = 2019 T = [0, int(S[0])] t10 = 1 for s in S[1:]: t10 *= 10 t10 %= MOD ...
replace
15
20
15
20
TLE
p02702
Python
Time Limit Exceeded
S = input() M = 2019 dp = [0] * M dp[0] = 1 t = 0 for i, s in enumerate(S[::-1]): t = (t + int(s) * (10**i)) % M dp[t] += 1 r = 0 for d in dp: r += d * (d - 1) // 2 print(r)
S = input() M = 2019 dp = [0] * M dp[0] = 1 t = 0 for i, s in enumerate(S[::-1]): t = (t + int(s) * (pow(10, i, M))) % M dp[t] += 1 r = 0 for d in dp: r += d * (d - 1) // 2 print(r)
replace
6
7
6
7
TLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
replace
114
115
114
115
0
p02702
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pii; typedef tuple<ll, ll, ll> ti; ll mod = 1E9 + 7; #define REP(a, b, c) for (ll a = (b); a < (c); a++) #define PER(a, b, c) for (ll a = (b); a >= (c); a--) ll ii() { ll...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pii; typedef tuple<ll, ll, ll> ti; ll mod = 1E9 + 7; #define REP(a, b, c) for (ll a = (b); a < (c); a++) #define PER(a, b, c) for (ll a = (b); a >= (c); a--) ll ii() { ll...
replace
45
46
45
46
MLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() ll cnt[3000]; int main() { string s; cin >> s; reverse(all(s)); for (int i = 1; i <= s.size(); i++) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() ll cnt[3000]; int main() { string s; cin >> s; int tot = 0; int p = 1; int n = s.size(); for (int i =...
replace
14
22
14
21
0
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long N; string S; int P; long long solve() { vector<long long> val(P, 0); long long tenfactor = 1; long long cur = 0; val[cur]++; for (int i = 0; i < N; ++i) { cur = (cur + (S[N - i - 1] - '0') * tenfactor) % P; tenfactor = (tenfactor * 10) % P; ...
#include <bits/stdc++.h> using namespace std; long long N; string S; int P; long long solve() { vector<long long> val(P, 0); long long tenfactor = 1; long long cur = 0; val[cur]++; for (int i = 0; i < N; ++i) { cur = (cur + (S[N - i - 1] - '0') * tenfactor) % P; tenfactor = (tenfactor * 10) % P; ...
replace
24
25
24
26
-11
p02702
C++
Memory Limit Exceeded
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cou...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cou...
delete
49
51
49
49
MLE
p02702
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; vector<int> mods(2019, 0); mods[0] = 1; for (int i = 0; i < (int)S.size(); i++) { mods[stoll(S.substr(i)) % 2019]++; } int result = 0; for (int j : mods) { if (j >= 2) { result +...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; vector<int> mods(2019, 0); mods[0] = 1; int current = 0; int keta = 1; for (int i = (int)S.size() - 1; i >= 0; i--) { current = (stoi(S.substr(i, 1)) * keta + current) % 2019; mods[curre...
replace
11
13
11
17
0
p02702
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int L = S.size(); vector<int> M(L + 1); M.at(L) = 0; M.at(L - 1) = (S.at(L - 1) - '0') % 2019; int Mod = 1; for (int i = 0; i < L - 1; i++) { Mod = (Mod * 10) % 2019; M.at(L - 2 - i) = (S.at(L - 2 - i) - '0') * Mod +...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int L = S.size(); vector<int> M(L + 1); M.at(L) = 0; M.at(L - 1) = (S.at(L - 1) - '0') % 2019; int Mod = 1; for (int i = 0; i < L - 1; i++) { Mod = (Mod * 10) % 2019; M.at(L - 2 - i) = (S.at(L - 2 - i) - '0') * Mod +...
replace
17
23
17
23
TLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back const int maxn = 10000; const int INF32 = 1'050'000'000; const long long INF64 = 4'000'000'000'000'000'000; const int MOD7 = 1'000'000'007; const int MOD9 = 1'000'000'009; const int m...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back const int maxn = 10000; const int INF32 = 1'050'000'000; const long long INF64 = 4'000'000'000'000'000'000; const int MOD7 = 1'000'000'007; const int MOD9 = 1'000'000'009; const int m...
replace
34
35
34
35
0
p02702
C++
Memory Limit Exceeded
#include "bits/stdc++.h" #define REP(i, num) for (int i = 0; i < (num); ++i) #define LOOP(i) while (i--) #define ALL(c) c.begin(), c.end() #define PRINTALL(c) \ for (auto pitr = c.begin(); pitr != c.end(); ++pitr) { \ cout << *pitr;...
#include "bits/stdc++.h" #define REP(i, num) for (int i = 0; i < (num); ++i) #define LOOP(i) while (i--) #define ALL(c) c.begin(), c.end() #define PRINTALL(c) \ for (auto pitr = c.begin(); pitr != c.end(); ++pitr) { \ cout << *pitr;...
replace
52
53
52
53
MLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define mod 1000000007 #define MOD = 998244353; #define int long long int #define double long double #define inf (int)(1e15) #define all(x) (x).begin(), (x).end() #define Yes cout << "Yes" << endl #define No cout << "No" << endl #de...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define mod 1000000007 #define MOD = 998244353; #define int long long int #define double long double #define inf (int)(1e15) #define all(x) (x).begin(), (x).end() #define Yes cout << "Yes" << endl #define No cout << "No" << endl #de...
replace
47
48
47
48
0
p02702
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; int dp[200009][2020]; int main() { string s; cin >> s; memset(dp, 0, sizeof(dp)); dp[0][s[0] - '0']++; for (int i = 1; i < s.length(); i++) { dp[i][s[i] - '0']++; for (int j = 0; j < 2019; j++) { dp[i][(j * 10 + s[i] - '0') % 2019] += dp[i - 1][j];...
#include <bits/stdc++.h> using namespace std; short dp[200009][2020]; int main() { string s; cin >> s; memset(dp, 0, sizeof(dp)); dp[0][s[0] - '0']++; for (int i = 1; i < s.length(); i++) { dp[i][s[i] - '0']++; for (int j = 0; j < 2019; j++) { dp[i][(j * 10 + s[i] - '0') % 2019] += dp[i - 1][j...
replace
4
5
4
5
MLE
p02702
C++
Runtime Error
#include <bits/stdc++.h> #define mod 1e+7 #define int long long #define garou \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); using namespace std; int dp[2019]; signed main() { garou; string s; cin...
#include <bits/stdc++.h> #define mod 1e+7 #define int long long #define garou \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); using namespace std; int dp[2019]; signed main() { garou; string s; cin...
replace
19
20
19
20
0
p02702
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> typedef long long ll; typedef unsigned long long ull; typedef long double LD; using namespace std; const int INF = 2147483647...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> typedef long long ll; typedef unsigned long long ull; typedef long double LD; using namespace std; const int INF = 2147483647...
replace
33
34
33
34
0
p02702
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; ll ten(ll x) { if (x == 0) { return 1; } else { ll res = 1; for (int i = 0; i < x; i++) { res *= 10; res %= 2019; } return res; } } int main() { string S; cin >> S; ll lon = (ll)(S.length()); ll Am[2019] ...
#include <bits/stdc++.h> using namespace std; using ll = long long; ll ten(ll x) { if (x == 0) { return 1; } else { x %= 672; ll res = 1; for (int i = 0; i < x; i++) { res *= 10; res %= 2019; } return res; } } int main() { string S; cin >> S; ll lon = (ll)(S.length()); ...
insert
8
8
8
9
TLE
p02702
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fi first #define se second using namespace std; const ll INF = 1LL << 60; const int inf = 1 << 30; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } const int maxn = 2e5 + 5; char s[maxn]; int f[maxn][2020]; in...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fi first #define se second using namespace std; const ll INF = 1LL << 60; const int inf = 1 << 30; inline void fastio() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); } const int maxn = 2e5 + 5; char s[maxn]; unsigned short f[maxn...
replace
15
16
15
16
MLE