Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
9 values
p03017
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> // #define cerr if(false)cerr #define watch(x) cerr << "> " << #x << ": " << x << "\n"; using namespace std; template <typename T> std::ostream &operator<<(std::ostream &out, vector<T> &v) { for (typename vector<T>::size_type i = 0; i < v.size(); ++i) out << v[i] << " "; out << "\n"; return out; } template <typename T, typename N> std::ostream &operator<<(std::ostream &out, vector<pair<T, N>> &v) { for (size_t i = 0; i < v.size(); ++i) out << "(" << v[i].first << ", " << v[i].second << ") "; out << "\n"; return out; } template <typename T> std::ostream &operator<<(std::ostream &out, vector<vector<T>> &v) { for (size_t i = 0; i < v.size(); ++i) { for (size_t j = 0; j < v[i].size(); ++j) { out << v[i][j] << " "; } out << "\n"; } return out; } int main() { std::ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; if (c == d) { cout << "No\n"; return 0; } for (int i = a - 1; i < c; ++i) { if (s[i] == s[i + 1] && s[i] == '#') { cout << "No\n"; return 0; } } for (int i = b - 1; i < d; ++i) { if (s[i] == s[i + 1] && s[i] == '#') { cout << "No\n"; return 0; } } if (d > c) { cout << "Yes\n"; } else { while (b < d) { if (s[b] != '#' && s[b - 1] != '#' && s[b + 1] != '#') { cout << "Yes\n"; return 0; } ++b; } cout << "No\n"; } return 0; }
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> // #define cerr if(false)cerr #define watch(x) cerr << "> " << #x << ": " << x << "\n"; using namespace std; template <typename T> std::ostream &operator<<(std::ostream &out, vector<T> &v) { for (typename vector<T>::size_type i = 0; i < v.size(); ++i) out << v[i] << " "; out << "\n"; return out; } template <typename T, typename N> std::ostream &operator<<(std::ostream &out, vector<pair<T, N>> &v) { for (size_t i = 0; i < v.size(); ++i) out << "(" << v[i].first << ", " << v[i].second << ") "; out << "\n"; return out; } template <typename T> std::ostream &operator<<(std::ostream &out, vector<vector<T>> &v) { for (size_t i = 0; i < v.size(); ++i) { for (size_t j = 0; j < v[i].size(); ++j) { out << v[i][j] << " "; } out << "\n"; } return out; } int main() { std::ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; if (c == d) { cout << "No\n"; return 0; } for (int i = a - 1; i < c; ++i) { if (s[i] == s[i + 1] && s[i] == '#') { cout << "No\n"; return 0; } } for (int i = b - 1; i < d; ++i) { if (s[i] == s[i + 1] && s[i] == '#') { cout << "No\n"; return 0; } } if (d > c) { cout << "Yes\n"; } else { --b; while (b < d) { if (s[b] != '#' && s[b - 1] != '#' && s[b + 1] != '#') { cout << "Yes\n"; return 0; } ++b; } cout << "No\n"; } return 0; }
[ "expression.unary.arithmetic.add" ]
839,958
839,959
u314543767
cpp
p03017
// Kenken Race #include <bits/stdc++.h> using namespace std; using ll = long long; #define int long long #define rep(i, x, y) for (ll i = x; i < y; i++) #define irep(i, a) for (auto i = a.begin(); i != a.end(); ++i) #define nvarep(n, a) \ ll n; \ cin >> n; \ vector<ll> a(n); \ rep(i, 0, n) cin >> a[i] #define vecrep(n, a) \ vector<ll> a(n); \ rep(i, 0, n) cin >> a[i] #define gcd(a, b) __gcd(a, b) #define lcm(a, b) (a / __gcd(a, b) * b) #define range(a) (a).begin(), (a).end() #define pb push_back #define mp make_pair #define nnn "\n" #define spa " " #define cout15(a) printf("%.15f\n", a) template <class T> inline bool chmin(T &a, T b, bool f) { if (f == 1) { if (a > b) { a = b; return true; } return false; } else if (f == 0) { if (a < b) { a = b; return true; } return false; } return false; } typedef pair<ll, string> p; using g = vector<vector<ll>>; const int inf = 2147483647; // 2*10^9 const ll INF = 9223372036854775807; // 9*10^18 signed main() { int n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; a--; b--; c--; d--; bool flag = true; if (c > d) { rep(i, a + 1, c + 1) { if (s[i] == '#' && s[i - 1] == '#') flag = false; } if (!flag) { cout << "No" << nnn; return 0; } bool miti = false; rep(i, b + 1, d - 1) { if (s[i] == '.' && s[i - 1] == '.' && s[i + 1] == '.') miti = true; } if (!miti) { cout << "No" << nnn; return 0; } } else { rep(i, a + 1, d + 1) { if (s[i] == '#' && s[i - 1] == '#') flag = false; if (!flag) { cout << "No" << nnn; return 0; } } } cout << "Yes" << nnn; return 0; }
// Kenken Race #include <bits/stdc++.h> using namespace std; using ll = long long; #define int long long #define rep(i, x, y) for (ll i = x; i < y; i++) #define irep(i, a) for (auto i = a.begin(); i != a.end(); ++i) #define nvarep(n, a) \ ll n; \ cin >> n; \ vector<ll> a(n); \ rep(i, 0, n) cin >> a[i] #define vecrep(n, a) \ vector<ll> a(n); \ rep(i, 0, n) cin >> a[i] #define gcd(a, b) __gcd(a, b) #define lcm(a, b) (a / __gcd(a, b) * b) #define range(a) (a).begin(), (a).end() #define pb push_back #define mp make_pair #define nnn "\n" #define spa " " #define cout15(a) printf("%.15f\n", a) template <class T> inline bool chmin(T &a, T b, bool f) { if (f == 1) { if (a > b) { a = b; return true; } return false; } else if (f == 0) { if (a < b) { a = b; return true; } return false; } return false; } typedef pair<ll, string> p; using g = vector<vector<ll>>; const int inf = 2147483647; // 2*10^9 const ll INF = 9223372036854775807; // 9*10^18 signed main() { int n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; a--; b--; c--; d--; bool flag = true; if (c > d) { rep(i, a + 1, c + 1) { if (s[i] == '#' && s[i - 1] == '#') flag = false; } if (!flag) { cout << "No" << nnn; return 0; } bool miti = false; rep(i, b, d + 1) { if (s[i] == '.' && s[i - 1] == '.' && s[i + 1] == '.') miti = true; } if (!miti) { cout << "No" << nnn; return 0; } } else { rep(i, a + 1, d + 1) { if (s[i] == '#' && s[i - 1] == '#') flag = false; if (!flag) { cout << "No" << nnn; return 0; } } } cout << "Yes" << nnn; return 0; }
[ "expression.operation.binary.remove", "misc.opposites", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change" ]
839,960
839,961
u663842230
cpp
p03017
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; string s; bool can_reach(int l, int r) { for (int i = l; i < r; i++) { if (s[i] == s[i + 1] && s[i] == '#') { return false; } } return true; } void solve() { int n, a, b, c, d; cin >> n >> a >> b >> c >> d >> s; a--; b--; c--; d--; // 1. a b c d: b -> d 間に岩が2個並んでいるところがない かつ、 a -> c ... // 2. a c b d: .. // 3. a b d c: a が b を追い越すことができる. 3連続の空きがあり、かつ、右端がb // じゃない if (!can_reach(a, c) || !can_reach(b, d)) { cout << "No" << endl; return; } if (c > d) { int ok = 0; for (int i = b - 1; i <= d; i++) { if (s[i - 1] == s[i] && s[i] == s[i + 1] && s[i] == '.') { ok = 1; } if (ok) break; } if (!ok) { cout << "No" << endl; return; } } cout << "Yes" << endl; } int main() { solve(); return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; string s; bool can_reach(int l, int r) { for (int i = l; i < r; i++) { if (s[i] == s[i + 1] && s[i] == '#') { return false; } } return true; } void solve() { int n, a, b, c, d; cin >> n >> a >> b >> c >> d >> s; a--; b--; c--; d--; // 1. a b c d: b -> d 間に岩が2個並んでいるところがない かつ、 a -> c ... // 2. a c b d: .. // 3. a b d c: a が b を追い越すことができる. 3連続の空きがあり、かつ、右端がb // じゃない if (!can_reach(a, c) || !can_reach(b, d)) { cout << "No" << endl; return; } if (c > d) { int ok = 0; for (int i = b; i <= d; i++) { if (s[i - 1] == s[i] && s[i] == s[i + 1] && s[i] == '.') { ok = 1; } if (ok) break; } if (!ok) { cout << "No" << endl; return; } } cout << "Yes" << endl; } int main() { solve(); return 0; }
[ "control_flow.loop.for.initializer.change", "expression.operation.binary.remove" ]
839,968
839,969
u796269639
cpp
p03017
#define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rep2(i, s, n) for (int i = s; i < (int)n; i++) #define ll long long #define all(v) v.begin(), v.end() using namespace std; const ll inf = 1000000007; int main() { ll n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; if (c < d) { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, a - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } cout << "Yes" << endl; } else { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, a - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a - 1, d - 1) { if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') { cout << "Yes" << endl; return 0; } } cout << "No" << endl; } }
#define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rep2(i, s, n) for (int i = s; i < (int)n; i++) #define ll long long #define all(v) v.begin(), v.end() using namespace std; const ll inf = 1000000007; int main() { ll n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; if (c < d) { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, c - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } cout << "Yes" << endl; } else { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, a - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, b - 2, d - 1) { if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') { cout << "Yes" << endl; return 0; } } cout << "No" << endl; } }
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "literal.number.change" ]
839,972
839,971
u942085302
cpp
p03017
#define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rep2(i, s, n) for (int i = s; i < (int)n; i++) #define ll long long #define all(v) v.begin(), v.end() using namespace std; const ll inf = 1000000007; int main() { ll n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; if (c < d) { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, a - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } cout << "Yes" << endl; } else { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, a - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a - 1, d - 2) { if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') { cout << "Yes" << endl; return 0; } } cout << "No" << endl; } }
#define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rep2(i, s, n) for (int i = s; i < (int)n; i++) #define ll long long #define all(v) v.begin(), v.end() using namespace std; const ll inf = 1000000007; int main() { ll n, a, b, c, d; cin >> n >> a >> b >> c >> d; string s; cin >> s; if (c < d) { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, c - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } cout << "Yes" << endl; } else { rep2(i, b, d - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, a, a - 2) { if (s[i] == '#' && s[i + 1] == '#') { cout << "No" << endl; return 0; } } rep2(i, b - 2, d - 1) { if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') { cout << "Yes" << endl; return 0; } } cout << "No" << endl; } }
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "literal.number.change" ]
839,973
839,971
u942085302
cpp
p03017
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll gcd(ll x, ll y) { return (x % y) ? gcd(y, x % y) : y; } int main() { ll N, A, B, C, D; string S; cin >> N >> A >> B >> C >> D >> S; A--; B--; C--; D--; ll streak_p = 1; bool flag_swap = false; bool flag_A = true; bool flag_B = true; for (int i = B; i <= D; i++) { if (S[i] == S[i + 1] && S[i] == '.') { streak_p++; if (streak_p >= 3) flag_swap = true; } else { streak_p = 1; } } for (int i = A; i < C; i++) { if (S[i] == S[i + 1] && S[i] == '#') { flag_A = false; } } for (int i = B; i < D; i++) { if (S[i] == S[i + 1] && S[i] == '#') { flag_B = false; } } if (flag_A == false || flag_B == false) { cout << "No" << endl; return 0; } if (D < C && flag_swap) { cout << "Yes" << endl; return 0; } else if (C < D) { cout << "Yes" << endl; return 0; } else { cout << "No" << endl; return 0; } }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll gcd(ll x, ll y) { return (x % y) ? gcd(y, x % y) : y; } int main() { ll N, A, B, C, D; string S; cin >> N >> A >> B >> C >> D >> S; A--; B--; C--; D--; ll streak_p = 1; bool flag_swap = false; bool flag_A = true; bool flag_B = true; for (int i = B - 1; i <= D; i++) { if (S[i] == S[i + 1] && S[i] == '.') { streak_p++; if (streak_p >= 3) flag_swap = true; } else { streak_p = 1; } } for (int i = A; i < C; i++) { if (S[i] == S[i + 1] && S[i] == '#') { flag_A = false; } } for (int i = B; i < D; i++) { if (S[i] == S[i + 1] && S[i] == '#') { flag_B = false; } } if (flag_A == false || flag_B == false) { cout << "No" << endl; return 0; } if (D < C && flag_swap) { cout << "Yes" << endl; return 0; } else if (C < D) { cout << "Yes" << endl; return 0; } else { cout << "No" << endl; return 0; } }
[ "control_flow.loop.for.initializer.change" ]
840,000
840,001
u000217193
cpp
p03017
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(), (a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int, int> #define priq priority_queue<int> #define disup(A, key) distance(A.begin(), upper_bound(ALL(A), (int)(key))) #define dislow(A, key) distance(A.begin(), lower_bound(ALL(A), (int)(key))) #define tii tuple<int, int, int> signed main() { int N, A, B, C, D; cin >> N >> A >> B >> C >> D; string S; cin >> S; A--; B--; C--; D--; if (A > B) { swap(A, B); swap(C, D); } string ans = "Yes"; REP(i, A + 2, C) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } if (ans == "Yes") { if (C < D) { REP(i, B + 2, D) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } } else { ans = "No"; REP(i, B + 1, D) { if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') { ans = "Yes"; break; } } } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(), (a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int, int> #define priq priority_queue<int> #define disup(A, key) distance(A.begin(), upper_bound(ALL(A), (int)(key))) #define dislow(A, key) distance(A.begin(), lower_bound(ALL(A), (int)(key))) #define tii tuple<int, int, int> signed main() { int N, A, B, C, D; cin >> N >> A >> B >> C >> D; string S; cin >> S; A--; B--; C--; D--; if (A > B) { swap(A, B); swap(C, D); } string ans = "Yes"; REP(i, A + 2, C) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } if (ans == "Yes") { if (C < D) { REP(i, B + 2, D) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } } else { ans = "No"; REP(i, B + 1, D + 1) { if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') { ans = "Yes"; break; } } } } cout << ans << endl; }
[ "expression.operation.binary.add" ]
840,003
840,004
u347057617
cpp
p03017
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(), (a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int, int> #define priq priority_queue<int> #define disup(A, key) distance(A.begin(), upper_bound(ALL(A), (int)(key))) #define dislow(A, key) distance(A.begin(), lower_bound(ALL(A), (int)(key))) #define tii tuple<int, int, int> signed main() { int N, A, B, C, D; cin >> N >> A >> B >> C >> D; string S; cin >> S; A--; B--; C--; D--; if (A > B) { swap(A, B); swap(C, D); } string ans = "Yes"; REP(i, A + 2, C) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } if (ans == "Yes") { if (C < D) { REP(i, B + 2, D) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } } else { ans = "No"; REP(i, B + 2, D) { if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') { ans = "Yes"; break; } } } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(), (a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int, int> #define priq priority_queue<int> #define disup(A, key) distance(A.begin(), upper_bound(ALL(A), (int)(key))) #define dislow(A, key) distance(A.begin(), lower_bound(ALL(A), (int)(key))) #define tii tuple<int, int, int> signed main() { int N, A, B, C, D; cin >> N >> A >> B >> C >> D; string S; cin >> S; A--; B--; C--; D--; if (A > B) { swap(A, B); swap(C, D); } string ans = "Yes"; REP(i, A + 2, C) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } if (ans == "Yes") { if (C < D) { REP(i, B + 2, D) { if (S[i] == '#' && S[i - 1] == '#') { ans = "No"; break; } } } else { ans = "No"; REP(i, B + 1, D + 1) { if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') { ans = "Yes"; break; } } } } cout << ans << endl; }
[ "literal.number.change", "call.arguments.change", "expression.operation.binary.change" ]
840,005
840,004
u347057617
cpp
p03017
#pragma GCC optimize("Ofast") #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; using ll = long long; using ull = unsigned long long; using pii = pair<int, int>; using pll = pair<long long, long long>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() constexpr char ln = '\n'; constexpr long long MOD = 1000000007LL; // constexpr long long MOD = 998244353LL; template <class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true; } return false; } template <class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true; } return false; } void print() { cout << "\n"; } template <class T, class... Args> void print(const T &x, const Args &...args) { cout << x << " "; print(args...); } //////////////////////////////////////////////////////////////////////////////////////////////////////////// int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, A, B, C, D; cin >> N >> A >> B >> C >> D; --A; --B; --C; --D; string S; cin >> S; auto check = [&](int s, int t) { for (int i = s; i < t; i++) { if (S[i] == '#' and S[i + 1] == '#') return false; } return true; }; if (!(check(A, C) and check(B, D))) { cout << "No" << ln; return 0; } if (C < D) { cout << "Yes" << ln; return 0; } bool ok = false; for (int i = B; i <= C; i++) { if (S[i - 1] == '.' and S[i] == '.' and S[i + 1] == '.') ok = true; } cout << (ok ? "Yes" : "No") << ln; }
#pragma GCC optimize("Ofast") #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; using ll = long long; using ull = unsigned long long; using pii = pair<int, int>; using pll = pair<long long, long long>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() constexpr char ln = '\n'; constexpr long long MOD = 1000000007LL; // constexpr long long MOD = 998244353LL; template <class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true; } return false; } template <class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true; } return false; } void print() { cout << "\n"; } template <class T, class... Args> void print(const T &x, const Args &...args) { cout << x << " "; print(args...); } //////////////////////////////////////////////////////////////////////////////////////////////////////////// int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, A, B, C, D; cin >> N >> A >> B >> C >> D; --A; --B; --C; --D; string S; cin >> S; auto check = [&](int s, int t) { for (int i = s; i < t; i++) { if (S[i] == '#' and S[i + 1] == '#') return false; } return true; }; if (!(check(A, C) and check(B, D))) { cout << "No" << ln; return 0; } if (C < D) { cout << "Yes" << ln; return 0; } bool ok = false; for (int i = B; i <= D; i++) { if (S[i - 1] == '.' and S[i] == '.' and S[i + 1] == '.') ok = true; } cout << (ok ? "Yes" : "No") << ln; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
840,012
840,013
u842939260
cpp
p03017
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define EPS (1e-7) #define INF (1e9) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() const double PI = acos(-1); const ll MOD = 1000000007; 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) { if (a > b) { a = b; return true; } return false; } /////////////////////////////////////////////////////////////// int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, A, B, C, D; cin >> N >> A >> B >> C >> D; A--; B--; C--; D--; string S; cin >> S; int K = max(C, D); bool can = true; bool ch = false; for (int i = A; i <= K; i++) { if (i >= B - 1 && i <= K - 2) { if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') ch = true; } if (i <= K - 1) { if (S[i] == '#' && S[i + 1] == '#') { can = false; if (C < B && C < i && i < B) can = true; } } } if (!ch && D < C) can = false; cout << (can ? "Yes" : "No") << endl; }
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define EPS (1e-7) #define INF (1e9) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() const double PI = acos(-1); const ll MOD = 1000000007; 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) { if (a > b) { a = b; return true; } return false; } /////////////////////////////////////////////////////////////// int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, A, B, C, D; cin >> N >> A >> B >> C >> D; A--; B--; C--; D--; string S; cin >> S; int K = max(C, D); bool can = true; bool ch = false; for (int i = A; i <= K; i++) { if (i >= B - 1 && i <= D - 1) { if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') ch = true; } if (i <= K - 1) { if (S[i] == '#' && S[i + 1] == '#') { can = false; if (C < B && C < i && i < B) can = true; } } } if (!ch && D < C) can = false; cout << (can ? "Yes" : "No") << endl; }
[ "identifier.change", "control_flow.branch.if.condition.change", "literal.number.change" ]
840,014
840,015
u842939260
cpp
p03017
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define lb lower_bound #define ub upper_bound #define fi first #define se second #define all(x) (x).begin(), (x).end() #define mod 1000000007 #define pi acos(-1.0) const ll INF = 1LL << 61; ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } ll jou(ll N, ll P) { if (P == 0) return 1; if (P % 2 == 0) { ll t = jou(N, P / 2); return t * t % mod; } return (N * jou(N, P - 1)) % mod; } // jou(n,mod-2)で逆元 // intの最大値2147483647 ≒ 2×10^9 // long longの最大値9223372036854775807 ≒ 9×10^18 //'大文字'+=32; で小文字に // cout << fixed << setprecision (20); 小数点以下20桁まで //実行時間制約2秒では2×10^8回くらいまで計算できる int main() { ll n, a, b, c, d; string s; cin >> n >> a >> b >> c >> d >> s; if (c < d) { bool dame = false; for (int i = b - 1; i < d - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } for (int i = a - 1; i < c - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } cout << (dame ? "No" : "Yes") << endl; } if (c > d) { bool dame = false; for (int i = b - 1; i < d - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } for (int i = a - 1; i < c - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } bool oasis = false; for (int i = b - 1; i <= d - 3; i++) { if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') oasis = true; } if (!oasis) dame = true; cout << (dame ? "No" : "Yes") << endl; } }
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define lb lower_bound #define ub upper_bound #define fi first #define se second #define all(x) (x).begin(), (x).end() #define mod 1000000007 #define pi acos(-1.0) const ll INF = 1LL << 61; ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } ll jou(ll N, ll P) { if (P == 0) return 1; if (P % 2 == 0) { ll t = jou(N, P / 2); return t * t % mod; } return (N * jou(N, P - 1)) % mod; } // jou(n,mod-2)で逆元 // intの最大値2147483647 ≒ 2×10^9 // long longの最大値9223372036854775807 ≒ 9×10^18 //'大文字'+=32; で小文字に // cout << fixed << setprecision (20); 小数点以下20桁まで //実行時間制約2秒では2×10^8回くらいまで計算できる int main() { ll n, a, b, c, d; string s; cin >> n >> a >> b >> c >> d >> s; if (c < d) { bool dame = false; for (int i = b - 1; i < d - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } for (int i = a - 1; i < c - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } cout << (dame ? "No" : "Yes") << endl; } if (c > d) { bool dame = false; for (int i = b - 1; i < d - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } for (int i = a - 1; i < c - 1; i++) { if (s[i] == '#' && s[i + 1] == '#') dame = true; } bool oasis = false; for (int i = b - 2; i <= d - 2; i++) { if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') oasis = true; } if (!oasis) dame = true; cout << (dame ? "No" : "Yes") << endl; } }
[ "literal.number.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operation.binary.change", "control_flow.branch.if.condition.change" ]
840,026
840,027
u604329931
cpp
p03030
#include <algorithm> #include <iostream> #include <tuple> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; tuple<string, int, int> a[n]; rep(i, n) { string s; int p; cin >> s >> p; a[i] = tuple<string, int, int>(s, p, i + 1); } sort(a, a + n); rep(i, n) cout << get<2>(a[i]) << endl; return 0; }
#include <algorithm> #include <iostream> #include <tuple> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; tuple<string, int, int> a[n]; rep(i, n) { string s; int p; cin >> s >> p; a[i] = tuple<string, int, int>(s, -p, i + 1); } sort(a, a + n); rep(i, n) cout << get<2>(a[i]) << endl; return 0; }
[ "expression.operation.unary.add", "call.arguments.change" ]
840,033
840,034
u431047462
cpp
p03030
#include <algorithm> #include <iostream> #include <string> #include <vector> struct restraunt { std::string name; int score; int num; }; int main() { using namespace std; int n; cin >> n; vector<struct restraunt> s; for (int i = 0; i < n; i++) { struct restraunt tmp; cin >> tmp.name >> tmp.score; tmp.num = i + 1; s.push_back(tmp); } sort(s.begin(), s.end(), [](const restraunt &a, const restraunt &b) { return (a.name < b.name) || (a.name == b.name && a.score < b.score); }); for (int i = 0; i < n; i++) { cout << s[i].num << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> struct restraunt { std::string name; int score; int num; }; int main() { using namespace std; int n; cin >> n; vector<struct restraunt> s; for (int i = 0; i < n; i++) { struct restraunt tmp; cin >> tmp.name >> tmp.score; tmp.num = i + 1; s.push_back(tmp); } sort(s.begin(), s.end(), [](const restraunt &a, const restraunt &b) { return (a.name < b.name) || (a.name == b.name && a.score > b.score); }); for (int i = 0; i < n; i++) { cout << s[i].num << endl; } return 0; }
[ "misc.opposites", "expression.operator.compare.change", "call.arguments.change", "function.return_value.change", "expression.operation.binary.change" ]
840,035
840,036
u102334466
cpp
p03030
#include <stdio.h> #include <string.h> struct shop { int p; int index; char s[20]; }; int main(void) { int n, ret; ret = scanf("%d", &n); struct shop shops[n], tmp; for (int i = 0; i < n; i++) { ret = scanf("%s %d", shops[i].s, &shops[i].p); shops[i].index = i; } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (strcmp(shops[i].s, shops[j].s) > 0) { tmp = shops[i]; shops[i] = shops[j]; shops[j] = tmp; } else if (strcmp(shops[i].s, shops[j].s) == 0) { if (shops[i].p < shops[j].p) { tmp = shops[i]; shops[i] = shops[j]; shops[j] = tmp; } } } } for (int i = 0; i < n; i++) { printf("%d\n", shops[i].index); } return 0; }
#include <stdio.h> #include <string.h> struct shop { int p; int index; char s[20]; }; int main(void) { int n, ret; ret = scanf("%d", &n); struct shop shops[n], tmp; for (int i = 0; i < n; i++) { ret = scanf("%s %d", shops[i].s, &shops[i].p); shops[i].index = i + 1; } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (strcmp(shops[i].s, shops[j].s) > 0) { tmp = shops[i]; shops[i] = shops[j]; shops[j] = tmp; } else if (strcmp(shops[i].s, shops[j].s) == 0) { if (shops[i].p < shops[j].p) { tmp = shops[i]; shops[i] = shops[j]; shops[j] = tmp; } } } } for (int i = 0; i < n; i++) { printf("%d\n", shops[i].index); } return 0; }
[ "assignment.change" ]
840,062
840,063
u106524514
cpp
p03030
#include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main() { int n; vector<string> s; vector<int> p, idx; cin >> n; for (int i = 0; i < n; i++) { string tmp1; int tmp2; cin >> tmp1 >> tmp2; s.push_back(tmp1); p.push_back(tmp2); idx.push_back(i + 1); } for (int i = 0; i < n - 2; i++) { for (int j = 0; j < n - 1 - i; j++) { if (s[j] > s[j + 1]) { swap(s[j], s[j + 1]); swap(p[j], p[j + 1]); swap(idx[j], idx[j + 1]); } else if (s[j] == s[j + 1]) { if (p[j] < p[j + 1]) { swap(s[j], s[j + 1]); swap(p[j], p[j + 1]); swap(idx[j], idx[j + 1]); } } } } for (int i = 0; i < n; i++) { cout << idx[i] << endl; } }
#include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main() { int n; vector<string> s; vector<int> p, idx; cin >> n; for (int i = 0; i < n; i++) { string tmp1; int tmp2; cin >> tmp1 >> tmp2; s.push_back(tmp1); p.push_back(tmp2); idx.push_back(i + 1); } for (int i = 0; i < n; i++) { for (int j = 0; j < n - i - 1; j++) { if (s[j] > s[j + 1]) { swap(s[j], s[j + 1]); swap(p[j], p[j + 1]); swap(idx[j], idx[j + 1]); } else if (s[j] == s[j + 1]) { if (p[j] < p[j + 1]) { swap(s[j], s[j + 1]); swap(p[j], p[j + 1]); swap(idx[j], idx[j + 1]); } } } } for (int i = 0; i < n; i++) { cout << idx[i] << endl; } }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "misc.off_by_one" ]
840,073
840,074
u091454649
cpp
p03030
#include <bits/stdc++.h> using namespace std; pair<pair<string, int>, int> p[110]; int main() { int n, score; char name; cin >> n; for (int i = 0; i < n; i++) { cin >> name >> score; p[i] = make_pair(make_pair(name, -score), i); } sort(p, p + n); for (int i = 0; i < n; i++) { cout << p[i].second + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; pair<pair<string, int>, int> p[110]; int main() { int n, score; char name[120]; cin >> n; for (int i = 0; i < n; i++) { cin >> name >> score; p[i] = make_pair(make_pair(name, -score), i); } sort(p, p + n); for (int i = 0; i < n; i++) { cout << p[i].second + 1 << endl; } }
[]
840,115
840,116
u818393512
cpp
p03030
#include <algorithm> #include <iostream> #include <string> #include <utility> using namespace std; int main() { int N; pair<string, pair<int, int>> sp[100]; cin >> N; for (int i = 1; i <= N; i++) { string str; int p; cin >> str >> p; sp[i - 1].first = str; sp[i - 1].second.first = p; sp[i - 1].second.second = i; } sort(sp, sp + N); for (int i = 1; i <= N; i++) { cout << sp[i - 1].second.second << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #include <utility> using namespace std; int main() { int N; pair<string, pair<int, int>> sp[100]; cin >> N; for (int i = 1; i <= N; i++) { string str; int p; cin >> str >> p; sp[i - 1].first = str; sp[i - 1].second.first = -p; sp[i - 1].second.second = i; } sort(sp, sp + N); for (int i = 1; i <= N; i++) { cout << sp[i - 1].second.second << endl; } return 0; }
[ "expression.operation.unary.add" ]
840,135
840,136
u569272329
cpp
p03030
#include <algorithm> #include <iostream> #include <vector> struct Info { int seq; std::string name; int point; Info(int _s, const std::string &_n, int _p) : seq(_s), name(_n), point(_p){}; }; struct Comp { bool operator()(const Info &lhs, const Info &rhs) { if (lhs.name == rhs.name) return lhs.point > rhs.point; else return lhs.name > rhs.name; } }; int main(void) { std::vector<Info> book; int N; std::cin >> N; int i = 1; std::string name; int point; while (N-- > 0) { std::cin >> name >> point; book.emplace_back(Info(i++, name, point)); } std::sort(book.begin(), book.end(), Comp()); for (auto iter = book.begin(); iter != book.end(); ++iter) { std::cout << iter->seq << std::endl; } return 0; }
#include <algorithm> #include <iostream> #include <vector> struct Info { int seq; std::string name; int point; Info(int _s, const std::string &_n, int _p) : seq(_s), name(_n), point(_p){}; }; struct Comp { bool operator()(const Info &lhs, const Info &rhs) { if (lhs.name == rhs.name) return lhs.point > rhs.point; else return lhs.name < rhs.name; } }; int main(void) { std::vector<Info> book; int N; std::cin >> N; int i = 1; std::string name; int point; while (N-- > 0) { std::cin >> name >> point; book.emplace_back(Info(i++, name, point)); } std::sort(book.begin(), book.end(), Comp()); for (auto iter = book.begin(); iter != book.end(); ++iter) { std::cout << iter->seq << std::endl; } return 0; }
[ "misc.opposites", "expression.operator.compare.change", "function.return_value.change", "expression.operation.binary.change" ]
840,138
840,139
u481584122
cpp
p03030
#include <algorithm> #include <iostream> #include <vector> struct Info { int seq; std::string name; int point; Info(int _s, const std::string &_n, int _p) : seq(_s), name(_n), point(_p){}; }; struct Comp { bool operator()(const Info &lhs, const Info &rhs) { if (lhs.name == rhs.name) return lhs.point > rhs.point; else return lhs.name > rhs.name; } }; int main(void) { std::vector<Info> book; int N; std::cin >> N; int i = 1; std::string name; int point; while (N-- > 0) { std::cin >> name >> point; book.emplace_back(Info(i++, name, point)); } std::sort(book.begin(), book.end(), Comp()); for (auto iter = book.begin(); iter != book.end(); ++iter) { std::cout << iter->seq << std::endl; } return 0; }
#include <algorithm> #include <iostream> #include <vector> struct Info { int seq; std::string name; int point; Info(int _s, const std::string &_n, int _p) : seq(_s), name(_n), point(_p){}; }; struct Comp { bool operator()(const Info &lhs, const Info &rhs) { if (lhs.name == rhs.name) return lhs.point > rhs.point; else return lhs.name < rhs.name; } }; int main(void) { std::vector<Info> book; int N; std::cin >> N; int i = 1; std::string name; int point; while (N-- > 0) { std::cin >> name >> point; book.emplace_back(Info(i++, name, point)); } std::sort(book.begin(), book.end(), Comp()); for (auto iter = book.begin(); iter != book.end(); ++iter) { std::cout << iter->seq << std::endl; } return 0; }
[ "misc.opposites", "expression.operator.compare.change", "function.return_value.change", "expression.operation.binary.change" ]
840,140
840,139
u481584122
cpp
p03030
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool pointsort(pair<int, pair<string, int>> a, pair<int, pair<string, int>> b) { if (a.second.first == b.second.first) { return b.second.first < a.second.first; } else { return b.second.first > a.second.first; } } int main() { int N; cin >> N; vector<pair<int, pair<string, int>>> shop(N); for (int i = 0; i < N; i++) { cin >> shop.at(i).second.first >> shop.at(i).second.second; shop.at(i).first = i + 1; } sort(shop.begin(), shop.end(), pointsort); for (int i = 0; i < N; i++) { cout << shop.at(i).first << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool pointsort(pair<int, pair<string, int>> a, pair<int, pair<string, int>> b) { if (a.second.first == b.second.first) { return b.second.second < a.second.second; } else { return b.second.first > a.second.first; } } int main() { int N; cin >> N; vector<pair<int, pair<string, int>>> shop(N); for (int i = 0; i < N; i++) { cin >> shop.at(i).second.first >> shop.at(i).second.second; shop.at(i).first = i + 1; } sort(shop.begin(), shop.end(), pointsort); for (int i = 0; i < N; i++) { cout << shop.at(i).first << endl; } return 0; }
[ "function.return_value.change", "expression.operation.binary.change" ]
840,151
840,152
u366651777
cpp
p03030
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool pointsort(pair<int, pair<string, int>> a, pair<int, pair<string, int>> b) { if (a.second.first == b.second.first) { return b.second.first > a.second.first; } else { return b.second.first < a.second.first; } } int main() { int N; cin >> N; vector<pair<int, pair<string, int>>> shop(N); for (int i = 0; i < N; i++) { cin >> shop.at(i).second.first >> shop.at(i).second.second; shop.at(i).first = i + 1; } sort(shop.begin(), shop.end(), pointsort); for (int i = 0; i < N; i++) { cout << shop.at(i).first << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool pointsort(pair<int, pair<string, int>> a, pair<int, pair<string, int>> b) { if (a.second.first == b.second.first) { return b.second.second < a.second.second; } else { return b.second.first > a.second.first; } } int main() { int N; cin >> N; vector<pair<int, pair<string, int>>> shop(N); for (int i = 0; i < N; i++) { cin >> shop.at(i).second.first >> shop.at(i).second.second; shop.at(i).first = i + 1; } sort(shop.begin(), shop.end(), pointsort); for (int i = 0; i < N; i++) { cout << shop.at(i).first << endl; } return 0; }
[ "control_flow.return.add", "control_flow.branch.else.add" ]
840,153
840,152
u366651777
cpp
p03030
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool pointsort(pair<int, pair<string, int>> a, pair<int, pair<string, int>> b) { if (a.second.first == b.second.first) { return b.second.first > a.second.first; } else { return b.second.first > a.second.first; } } int main() { int N; cin >> N; vector<pair<int, pair<string, int>>> shop(N); for (int i = 0; i < N; i++) { cin >> shop.at(i).second.first >> shop.at(i).second.second; shop.at(i).first = i + 1; } sort(shop.begin(), shop.end(), pointsort); for (int i = 0; i < N; i++) { cout << shop.at(i).first << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool pointsort(pair<int, pair<string, int>> a, pair<int, pair<string, int>> b) { if (a.second.first == b.second.first) { return b.second.second < a.second.second; } else { return b.second.first > a.second.first; } } int main() { int N; cin >> N; vector<pair<int, pair<string, int>>> shop(N); for (int i = 0; i < N; i++) { cin >> shop.at(i).second.first >> shop.at(i).second.second; shop.at(i).first = i + 1; } sort(shop.begin(), shop.end(), pointsort); for (int i = 0; i < N; i++) { cout << shop.at(i).first << endl; } return 0; }
[ "function.return_value.change", "expression.operation.binary.change" ]
840,154
840,152
u366651777
cpp
p03030
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; map<string, set<pair<int, int>>> mp; string s; int p; for (int i = 1; i <= n; ++i) { cin >> s >> p; mp[s].insert(make_pair(p, i)); } for (auto const &kv : mp) { for (auto val : kv.second) { cout << n - val.second + 1 << endl; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; map<string, set<pair<int, int>>> mp; string s; int p; for (int i = 1; i <= n; ++i) { cin >> s >> p; mp[s].insert(make_pair(-p, i)); } for (auto const &kv : mp) { for (auto val : kv.second) { cout << val.second << endl; } } return 0; }
[ "expression.operation.unary.add", "call.arguments.change", "expression.operation.binary.remove" ]
840,160
840,161
u337959231
cpp
p03030
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main(void) { int N; cin >> N; typedef pair<string, int> P; typedef pair<P, int> data; vector<data> v; string S; int p; for (int i = 0; i < N; ++i) { cin >> S >> p; v.push_back(data(P(S, p), i + 1)); } sort(v.begin(), v.end()); for (int i = 0; i < N; ++i) { cout << v[i].second << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main(void) { int N; cin >> N; typedef pair<string, int> P; typedef pair<P, int> data; vector<data> v; string S; int p; for (int i = 0; i < N; ++i) { cin >> S >> p; v.push_back(data(P(S, -p), i + 1)); } sort(v.begin(), v.end()); for (int i = 0; i < N; ++i) { cout << v[i].second << endl; } return 0; }
[ "expression.operation.unary.add", "call.arguments.change" ]
840,167
840,168
u397847744
cpp
p03030
#include <algorithm> #include <iostream> #include <vector> class element { public: int i; std::string s; int p; }; int main() { int N; std::cin >> N; std::vector<element *> resutoran; resutoran.reserve(N); for (int i = 0; i < N; i++) { auto l = new element(); l->i = i + 1; std::cin >> l->s >> l->p; resutoran.push_back(l); } std::sort(resutoran.begin(), resutoran.end(), [](const element *a, const element *b) { return a->p > b->p; }); std::stable_sort( resutoran.begin(), resutoran.end(), [](const element *a, const element *b) { return a->s < b->s; }); for (auto it = resutoran.begin(); it != resutoran.end(); it++) std::cout << (*it)->p << std::endl; return 0; }
#include <algorithm> #include <iostream> #include <vector> class element { public: int i; std::string s; int p; }; int main() { int N; std::cin >> N; std::vector<element *> resutoran; resutoran.reserve(N); for (int i = 0; i < N; i++) { auto l = new element(); l->i = i + 1; std::cin >> l->s >> l->p; resutoran.push_back(l); } std::sort(resutoran.begin(), resutoran.end(), [](const element *a, const element *b) { return a->p > b->p; }); std::stable_sort( resutoran.begin(), resutoran.end(), [](const element *a, const element *b) { return a->s < b->s; }); for (auto it = resutoran.begin(); it != resutoran.end(); it++) std::cout << (*it)->i << std::endl; return 0; }
[ "expression.operation.binary.change" ]
840,177
840,178
u302955938
cpp
p03030
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; pair<pair<string, int>, int> p[110]; string S[110]; int P[110]; for (int i = 1; i <= N; i++) { cin >> S[i]; cin >> P[i]; p[i] = make_pair(make_pair(S[i], -P[i]), i); } sort(p + 1, p + N + 1); for (int i = 1; i <= N; i++) { cout << p[i].second; } }
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; pair<pair<string, int>, int> p[110]; string S[110]; int P[110]; for (int i = 1; i <= N; i++) { cin >> S[i]; cin >> P[i]; p[i] = make_pair(make_pair(S[i], -P[i]), i); } sort(p + 1, p + N + 1); for (int i = 1; i <= N; i++) { cout << p[i].second << "\n"; } }
[ "io.output.change" ]
840,179
840,180
u582357587
cpp
p03030
#include "bits/stdc++.h" using namespace std; #define LL long long #define MP make_pair #define PB push_back int main() { vector<pair<string, pair<int, int>>> v; int N; cin >> N; for (int i = 0; i < N; i++) { string S; int P; cin >> S >> P; v.PB({S, {P, i + 1}}); } sort(v.begin(), v.end()); for (int i = 0; i < N; i++) { cout << v[i].second.second << endl; } return 0; }
#include "bits/stdc++.h" using namespace std; #define LL long long #define MP make_pair #define PB push_back int main() { vector<pair<string, pair<int, int>>> v; int N; cin >> N; for (int i = 0; i < N; i++) { string S; int P; cin >> S >> P; v.PB({S, {-P, i + 1}}); } sort(v.begin(), v.end()); for (int i = 0; i < N; i++) { cout << v[i].second.second << endl; } return 0; }
[ "expression.operation.unary.add", "call.arguments.change" ]
840,190
840,191
u422592877
cpp
p03030
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); vector<int> P(N); for (int i = 0; i < N; i++) { cin >> S.at(i) >> P.at(i); } vector<pair<string, int>> T(N); vector<pair<string, int>> U(N); for (int i = 0; i < N; i++) { T.at(i) = make_pair(S.at(i), -P.at(i)); U.at(i) = T.at(i); } sort(U.begin(), U.end()); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (T.at(i) == U.at(j)) { cout << j + 1 << endl; } } } }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); vector<int> P(N); for (int i = 0; i < N; i++) { cin >> S.at(i) >> P.at(i); } vector<pair<string, int>> T(N); vector<pair<string, int>> U(N); for (int i = 0; i < N; i++) { T.at(i) = make_pair(S.at(i), -P.at(i)); U.at(i) = T.at(i); } sort(T.begin(), T.end()); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (T.at(i) == U.at(j)) { cout << j + 1 << endl; } } } }
[ "identifier.change", "call.arguments.change" ]
840,200
840,201
u096717230
cpp
p03030
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); vector<int> P(N); for (int i = 0; i < N; i++) { cin >> S.at(i) >> P.at(i); } vector<pair<string, int>> T(N); vector<pair<string, int>> U(N); for (int i = 0; i < N; i++) { T.at(i) = make_pair(S.at(i), -P.at(i)); U.at(i) = T.at(i); } sort(T.begin(), T.end()); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (T.at(i) == U.at(i)) { cout << j + 1 << endl; } } } }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); vector<int> P(N); for (int i = 0; i < N; i++) { cin >> S.at(i) >> P.at(i); } vector<pair<string, int>> T(N); vector<pair<string, int>> U(N); for (int i = 0; i < N; i++) { T.at(i) = make_pair(S.at(i), -P.at(i)); U.at(i) = T.at(i); } sort(T.begin(), T.end()); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (T.at(i) == U.at(j)) { cout << j + 1 << endl; } } } }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
840,202
840,201
u096717230
cpp
p03030
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> S(N); vector<int> P(N); for (int i = 0; i < N; i++) { cin >> S.at(i) >> P.at(i); } vector<pair<string, int>> T(N); vector<pair<string, int>> U(N); for (int i = 0; i < N; i++) { T.at(i) = make_pair(S.at(i), -P.at(i)); U.at(i) = T.at(i); } sort(T.begin(), T.end()); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (T.at(i) == U.at(i)) { cout << j + 1 << endl; } } } }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> S(N); vector<int> P(N); for (int i = 0; i < N; i++) { cin >> S.at(i) >> P.at(i); } vector<pair<string, int>> T(N); vector<pair<string, int>> U(N); for (int i = 0; i < N; i++) { T.at(i) = make_pair(S.at(i), -P.at(i)); U.at(i) = T.at(i); } sort(T.begin(), T.end()); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (T.at(i) == U.at(j)) { cout << j + 1 << endl; } } } }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
840,203
840,201
u096717230
cpp
p03030
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<tuple<string, int, int>> a; for (int i = 1; i <= N; i++) { string s; int p; cin >> s; cin >> p; p = -p; a.push_back(tie(s, p, i)); } sort(a.begin(), a.end()); for (int i = 1; i <= N; i++) { cout << get<2>(a[i]) << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<tuple<string, int, int>> a; for (int i = 1; i <= N; i++) { string s; int p; cin >> s >> p; p = -p; a.push_back(tie(s, p, i)); } sort(a.begin(), a.end()); for (int i = 0; i < N; i++) { cout << get<2>(a[i]) << endl; } }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
840,217
840,218
u800100718
cpp
p03030
#include <bits/stdc++.h> #include <string> #include <tuple> using namespace std; /* 2019/05/26 */ int main() { int n; cin >> n; vector<tuple<string, int, int>> a; // what tuple? for (int i = 1; i <= n; i++) { string s; int p; cin >> s >> p; p = -p; //点数が高いほど小さくなる(上に) a.emplace_back(tie(s, p, i)); // tie...? } // sort*tupleのソート sort(a.begin(), a.end()); for (int i = 0; i < n - 1; i++) { cout << get<2>(a[i]) << endl; /* string s; int p; int id; tie(s,p,i)=a[i]; cout<<id<<endl; */ } //実装するなら――構造体を用意して比較関数を使う }
#include <bits/stdc++.h> #include <string> #include <tuple> using namespace std; /* 2019/05/26 */ int main() { int n; cin >> n; vector<tuple<string, int, int>> a; // what tuple? for (int i = 1; i <= n; i++) { string s; int p; cin >> s >> p; p = -p; //点数が高いほど小さくなる(上に) a.emplace_back(tie(s, p, i)); // tie...? } // sort*tupleのソート sort(a.begin(), a.end()); for (int i = 0; i < n; i++) { cout << get<2>(a[i]) << endl; /* string s; int p; int id; tie(s,p,i)=a[i]; cout<<id<<endl; */ } //実装するなら――構造体を用意して比較関数を使う // pairの多重もやるっぽいーたくさん要素があるときはtupleがよいです }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
840,229
840,230
u538853954
cpp
p03030
#include <bits/stdc++.h> #include <string> #include <tuple> using namespace std; /* 2019/05/26 */ int main() { int n; cin >> n; vector<tuple<string, int, int>> a; // what tuple? for (int i = 1; i < n; i++) { string s; int p; cin >> s >> p; p = -p; //点数が高いほど小さくなる(上に) a.emplace_back(tie(s, p, i)); // tie...? } // sort*tupleのソート sort(a.begin(), a.end()); for (int i = 0; i < n; i++) { cout << get<2>(a[i]) << endl; /* string s; int p; int id; tie(s,p,i)=a[i]; cout<<id<<endl; */ } //実装するなら――構造体を用意して比較関数を使う }
#include <bits/stdc++.h> #include <string> #include <tuple> using namespace std; /* 2019/05/26 */ int main() { int n; cin >> n; vector<tuple<string, int, int>> a; // what tuple? for (int i = 1; i <= n; i++) { string s; int p; cin >> s >> p; p = -p; //点数が高いほど小さくなる(上に) a.emplace_back(tie(s, p, i)); // tie...? } // sort*tupleのソート sort(a.begin(), a.end()); for (int i = 0; i < n; i++) { cout << get<2>(a[i]) << endl; /* string s; int p; int id; tie(s,p,i)=a[i]; cout<<id<<endl; */ } //実装するなら――構造体を用意して比較関数を使う // pairの多重もやるっぽいーたくさん要素があるときはtupleがよいです }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
840,231
840,230
u538853954
cpp
p03030
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ███████████ // ██╬╬╬╬╬████╬╬████╬╬╬╬╬██ // █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██ // ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██ // ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██ // ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████ // █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ // ██████████████ // ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████ // ███████ █████ // ███████████████████ #include "bits/stdc++.h" using namespace std; #define MOD 1000000007 const double EPS = 1e-9; #define INF (1LL << 60) #define fs first #define sc second #define D double #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, 0, n) #define ITR(itr, mp) for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr, mp) for (auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #define debug(x) cout << #x << " = " << (x) << endl; #define SP << " " << typedef pair<int, int> P; typedef vector<vector<P>> Graph; typedef vector<int> vec; typedef vector<vector<int>> mat; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vec x(n); vector<string> s(n); REP(i, n) cin >> s[i] >> x[i]; auto f = [&](int a, int b) { if (s[a] != s[b]) return s[a] < s[b]; else return x[a] >= x[b]; }; vec ans(n); REP(i, n) ans[i] = i; sort(ans.begin(), ans.end(), f); REP(i, n) cout << ans[i] << endl; return 0; }
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ███████████ // ██╬╬╬╬╬████╬╬████╬╬╬╬╬██ // █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██ // ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██ // ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██ // ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████ // █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ // ██████████████ // ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████ // ███████ █████ // ███████████████████ #include "bits/stdc++.h" using namespace std; #define MOD 1000000007 const double EPS = 1e-9; #define INF (1LL << 60) #define fs first #define sc second #define D double #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, 0, n) #define ITR(itr, mp) for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr, mp) for (auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #define debug(x) cout << #x << " = " << (x) << endl; #define SP << " " << typedef pair<int, int> P; typedef vector<vector<P>> Graph; typedef vector<int> vec; typedef vector<vector<int>> mat; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vec x(n); vector<string> s(n); REP(i, n) cin >> s[i] >> x[i]; auto f = [&](int a, int b) { if (s[a] != s[b]) return s[a] < s[b]; else return x[a] >= x[b]; }; vec ans(n); REP(i, n) ans[i] = i; sort(ans.begin(), ans.end(), f); REP(i, n) cout << ans[i] + 1 << endl; return 0; }
[ "expression.operation.binary.add" ]
840,232
840,233
u239493918
cpp
p03030
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ███████████ // ██╬╬╬╬╬████╬╬████╬╬╬╬╬██ // █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██ // ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██ // ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██ // ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████ // █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ // ██████████████ // ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████ // ███████ █████ // ███████████████████ #include "bits/stdc++.h" using namespace std; #define MOD 1000000007 const double EPS = 1e-9; #define INF (1LL << 60) #define fs first #define sc second #define D double #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, 0, n) #define ITR(itr, mp) for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr, mp) for (auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #define debug(x) cout << #x << " = " << (x) << endl; #define SP << " " << typedef pair<int, int> P; typedef vector<vector<P>> Graph; typedef vector<int> vec; typedef vector<vector<int>> mat; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vec x(n); vector<string> s(n); REP(i, n) cin >> s[i] >> x[i]; auto f = [&](int a, int b) { if (s[a] != s[b]) return s[a] < s[b]; else return x[a] <= x[b]; }; vec ans(n); REP(i, n) ans[i] = i; sort(ans.begin(), ans.end(), f); REP(i, n) cout << ans[i] << endl; return 0; }
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ███████████ // ██╬╬╬╬╬████╬╬████╬╬╬╬╬██ // █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██ // ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██ // ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██ // ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████ // █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ // ██████████████ // ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████ // ███████ █████ // ███████████████████ #include "bits/stdc++.h" using namespace std; #define MOD 1000000007 const double EPS = 1e-9; #define INF (1LL << 60) #define fs first #define sc second #define D double #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, 0, n) #define ITR(itr, mp) for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr, mp) for (auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #define debug(x) cout << #x << " = " << (x) << endl; #define SP << " " << typedef pair<int, int> P; typedef vector<vector<P>> Graph; typedef vector<int> vec; typedef vector<vector<int>> mat; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vec x(n); vector<string> s(n); REP(i, n) cin >> s[i] >> x[i]; auto f = [&](int a, int b) { if (s[a] != s[b]) return s[a] < s[b]; else return x[a] >= x[b]; }; vec ans(n); REP(i, n) ans[i] = i; sort(ans.begin(), ans.end(), f); REP(i, n) cout << ans[i] + 1 << endl; return 0; }
[ "misc.opposites", "expression.operator.compare.change", "function.return_value.change", "expression.operation.binary.change" ]
840,234
840,233
u239493918
cpp
p03030
#include <bits/stdc++.h> using namespace std; #define For(i, n) for (long i = 0; i < (n); i++) long gcd(long a, long b) { return b ? gcd(b, a % b) : a; } long n, m, ans = 0; int main() { cin >> n; vector<string> ato(n); vector<string> mae(n); For(i, n) { string s; int t; cin >> s >> t; mae.at(i) = s + to_string(9999 - t); ato.at(i) = s + to_string(9999 - t); } sort(ato.begin(), ato.end()); For(i, n) { For(j, n) { if (mae.at(j) == ato.at(i)) { cout << j << endl; break; } } } }
#include <bits/stdc++.h> using namespace std; #define For(i, n) for (long i = 0; i < (n); i++) long gcd(long a, long b) { return b ? gcd(b, a % b) : a; } long n, m, ans = 0; int main() { cin >> n; vector<string> ato(n); vector<string> mae(n); For(i, n) { string s; int t; cin >> s >> t; mae.at(i) = s + to_string(9999 - t); ato.at(i) = s + to_string(9999 - t); } sort(ato.begin(), ato.end()); For(i, n) { For(j, n) { if (mae.at(j) == ato.at(i)) { cout << j + 1 << endl; break; } } } }
[ "expression.operation.binary.add" ]
840,237
840,238
u813174766
cpp
p03030
#include <bits/stdc++.h> typedef long long LL; using namespace std; int main() { int n; cin >> n; vector<pair<string, int>> sp(n), nsp; for (int i = 0; i < n; i++) { string s; int t; cin >> s >> t; t *= -1; sp[i] = make_pair(s, t); } nsp = sp; sort(nsp.begin(), nsp.end()); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (sp[i] == nsp[j]) { cout << j + 1 << endl; break; } } } }
#include <bits/stdc++.h> typedef long long LL; using namespace std; int main() { int n; cin >> n; vector<pair<string, int>> sp(n), nsp; for (int i = 0; i < n; i++) { string s; int t; cin >> s >> t; t *= -1; sp[i] = make_pair(s, t); } nsp = sp; sort(nsp.begin(), nsp.end()); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (sp[j] == nsp[i]) { cout << j + 1 << endl; break; } } } }
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
840,239
840,240
u392423112
cpp
p03030
#include <bits/stdc++.h> using ll = long long; #define int ll #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, s, n) for (int i = s; i < n; i++) #define erep(e, v) for (auto &&e : v) #define all(in) in.begin(), in.end() #define MP make_pair #define INF (sizeof(int) == 4 ? (int)1e9 : (int)1e18) #define EPS 0.0000000001 using namespace std; template <class T, class S> void cmin(T &a, const S &b) { if (a > b) a = b; } template <class T, class S> void cmax(T &a, const S &b) { if (a < b) a = b; } template <typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); } template <typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); } template <class T> void join(T &a) { int t = 0; for (auto itr : a) { if (t++) cout << " "; cout << itr; } cout << endl; } using ld = long double; using pii = pair<int, int>; using piii = pair<int, pii>; int W, H; int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0}; bool valid(int x, int y) { return (0 <= x && x < W) && (0 <= y && y < H); } signed main() { using ps = pair<string, pii>; int n; cin >> n; cin >> n; vector<ps> v(n); int cnt = 1; for (auto &e : v) { cin >> e.first >> e.second.first; e.second.first = -1 * e.second.first; e.second.second = cnt++; } sort(all(v)); for (auto e : v) cout << e.second.second << endl; }
#include <bits/stdc++.h> using ll = long long; #define int ll #define rep(i, n) for (int i = 0; i < n; i++) #define loop(i, s, n) for (int i = s; i < n; i++) #define erep(e, v) for (auto &&e : v) #define all(in) in.begin(), in.end() #define MP make_pair #define INF (sizeof(int) == 4 ? (int)1e9 : (int)1e18) #define EPS 0.0000000001 using namespace std; template <class T, class S> void cmin(T &a, const S &b) { if (a > b) a = b; } template <class T, class S> void cmax(T &a, const S &b) { if (a < b) a = b; } template <typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); } template <typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); } template <class T> void join(T &a) { int t = 0; for (auto itr : a) { if (t++) cout << " "; cout << itr; } cout << endl; } using ld = long double; using pii = pair<int, int>; using piii = pair<int, pii>; int W, H; int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0}; bool valid(int x, int y) { return (0 <= x && x < W) && (0 <= y && y < H); } signed main() { // std::ios_base::sync_with_stdio(false); // cin.tie(NULL); using ps = pair<string, pii>; int n; cin >> n; vector<ps> v(n); int cnt = 1; for (auto &e : v) { cin >> e.first >> e.second.first; e.second.first = -1 * e.second.first; e.second.second = cnt++; } sort(all(v)); for (auto e : v) cout << e.second.second << endl; }
[]
840,241
840,242
u318334550
cpp
p03030
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; void swap(string &acity, string &aprice, int &anum, string &bcity, string &bprice, int &bnum) { string wk; int iwk; wk = acity; acity = bcity; bcity = wk; wk = aprice; aprice = bprice; bprice = wk; iwk = anum; anum = bnum; bnum = iwk; return; } int main() { int n; cin >> n; string city[100]; string price[100]; int num[100]; for (int i = 0; i < n; i++) { cin >> city[i] >> price[i]; num[i] = i + 1; } bool loopflg = true; while (loopflg) { loopflg = false; for (int i = 0; i < n - 1; i++) { if (city[i] > city[i + 1]) { swap(city[i], price[i], num[i], city[i + 1], price[i + 1], num[i + 1]); loopflg = true; break; } if (city[i] == city[i + 1] && price[i] < price[i + 1]) { swap(city[i], price[i], num[i], city[i + 1], price[i + 1], num[i + 1]); loopflg = true; break; } } } for (int i = 0; i < n; i++) { cout << num[i] << endl; } return 0; }
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; void swap(string &acity, int &aprice, int &anum, string &bcity, int &bprice, int &bnum) { string wk; int iwk; wk = acity; acity = bcity; bcity = wk; iwk = aprice; aprice = bprice; bprice = iwk; iwk = anum; anum = bnum; bnum = iwk; return; } int main() { int n; cin >> n; string city[100]; int price[100]; int num[100]; for (int i = 0; i < n; i++) { cin >> city[i] >> price[i]; num[i] = i + 1; } bool loopflg = true; while (loopflg) { loopflg = false; for (int i = 0; i < n - 1; i++) { if (city[i] > city[i + 1]) { swap(city[i], price[i], num[i], city[i + 1], price[i + 1], num[i + 1]); loopflg = true; break; } if (city[i] == city[i + 1] && price[i] < price[i + 1]) { swap(city[i], price[i], num[i], city[i + 1], price[i + 1], num[i + 1]); loopflg = true; break; } } } for (int i = 0; i < n; i++) { cout << num[i] << endl; } return 0; }
[ "assignment.variable.change", "identifier.change", "assignment.value.change", "variable_declaration.type.change" ]
840,253
840,254
u845284573
cpp
p03030
#include <cstring> #include <iostream> using namespace std; void swp_i(int *N1, int *N2) { int tmp = *N1; *N1 = *N2; *N2 = tmp; } void swp_c(char *S1, char *S2) { char tmp[10]; strcpy(tmp, S1); strcpy(S1, S2); strcpy(S2, tmp); } int main() { int N; cin >> N; char S[100][10]; int P[100], NUM[100]; for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; NUM[i] = i; } for (int i = N; i > 0; i--) { for (int j = 0; j < i - 1; j++) { if (strcmp(S[j], S[j + 1]) > 0) { swp_c(S[j], S[j + 1]); swp_i(&P[j], &P[j + 1]); swp_i(&NUM[j], &NUM[j + 1]); } else if (strcmp(S[j], S[j + 1]) == 0) { if (P[j] < P[j + 1]) { swp_c(S[j], S[j + 1]); swp_i(&P[j], &P[j + 1]); swp_i(&NUM[j], &NUM[j + 1]); } } } } for (int i = 0; i < N; i++) { cout << NUM[i] + 1 << endl; } return 0; }
#include <cstring> #include <iostream> using namespace std; void swp_i(int *N1, int *N2) { int tmp = *N1; *N1 = *N2; *N2 = tmp; } void swp_c(char *S1, char *S2) { char tmp[11]; strcpy(tmp, S1); strcpy(S1, S2); strcpy(S2, tmp); } int main() { int N; cin >> N; char S[100][11]; int P[100], NUM[100]; for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; NUM[i] = i; } for (int i = N; i > 0; i--) { for (int j = 0; j < i - 1; j++) { if (strcmp(S[j], S[j + 1]) > 0) { swp_c(S[j], S[j + 1]); swp_i(&P[j], &P[j + 1]); swp_i(&NUM[j], &NUM[j + 1]); } else if (strcmp(S[j], S[j + 1]) == 0) { if (P[j] < P[j + 1]) { swp_c(S[j], S[j + 1]); swp_i(&P[j], &P[j + 1]); swp_i(&NUM[j], &NUM[j + 1]); } } } } for (int i = 0; i < N; i++) { cout << NUM[i] + 1 << endl; } return 0; }
[ "literal.number.change", "variable_declaration.array_dimensions.change" ]
840,297
840,298
u145483532
cpp
p03030
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; struct p { char s[20]; int score; int num; } a[200]; int cmp(p a, p b) { if (strcmp(a.s, b.s) == 0) { return a.score > b.score; } else if (strcmp(a.s, b.s) == -1) return 1; return 0; } int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%s%d", a[i].s, &a[i].score); a[i].num = i + 1; } sort(a, a + n, cmp); for (int i = 0; i < n; i++) printf("%d\n", a[i].num); return 0; }
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; struct p { char s[20]; int score; int num; } a[200]; int cmp(p a, p b) { if (strcmp(a.s, b.s) == 0) { return a.score > b.score; } else if (strcmp(a.s, b.s) < 0) return 1; return 0; } int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%s%d", a[i].s, &a[i].score); a[i].num = i + 1; } sort(a, a + n, cmp); for (int i = 0; i < n; i++) printf("%d\n", a[i].num); return 0; }
[ "control_flow.branch.if.condition.change" ]
840,299
840,300
u725712446
cpp
p03030
#include <iostream> #include <map> #include <vector> using namespace std; int main() { int N; cin >> N; vector<string> S(N); vector<int> P(N); vector<int> K(N); for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; K[i] = i + 1; } string str; /* int j = N; for(int i = 0; i < j-1; i++) { if(S[i] > S[i+1]) { str = S[i]; S[i] = S[i+1]; S[i+1] = str; } if(S[i] == S[i+1]){ if(P[i] < P[i+1]){ str = S[i]; S[i] = S[i+1]; S[i+1] = str; } } j--; if(j == 1) break; } */ int j = 0, p = 0, k = 0; for (int j = 0; j < N - 2; j++) { for (int i = N - 1; j < i; i--) { if (S[i] < S[i - 1]) { // cout << S[i] << " S[i-1] = " << S[i-1] << endl; str = S[i]; S[i] = S[i - 1]; S[i - 1] = str; p = P[i]; P[i] = P[i - 1]; P[i - 1] = p; k = K[i]; K[i] = K[i - 1]; K[i - 1] = k; } if (S[i] == S[i - 1]) { if (P[i] > P[i - 1]) { str = S[i]; S[i] = S[i - 1]; S[i - 1] = str; p = P[i]; P[i] = P[i - 1]; P[i - 1] = p; k = K[i]; K[i] = K[i - 1]; K[i - 1] = k; } } } } for (int i = 0; i < N; i++) { cout << K[i] << endl; } return 0; }
#include <iostream> #include <map> #include <vector> using namespace std; int main() { int N; cin >> N; vector<string> S(N); vector<int> P(N); vector<int> K(N); for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; K[i] = i + 1; } string str; /* int j = N; for(int i = 0; i < j-1; i++) { if(S[i] > S[i+1]) { str = S[i]; S[i] = S[i+1]; S[i+1] = str; } if(S[i] == S[i+1]){ if(P[i] < P[i+1]){ str = S[i]; S[i] = S[i+1]; S[i+1] = str; } } j--; if(j == 1) break; } */ int j = 0, p = 0, k = 0; for (int j = 0; j < N - 1; j++) { for (int i = N - 1; j < i; i--) { if (S[i] < S[i - 1]) { // cout << S[i] << " S[i-1] = " << S[i-1] << endl; str = S[i]; S[i] = S[i - 1]; S[i - 1] = str; p = P[i]; P[i] = P[i - 1]; P[i - 1] = p; k = K[i]; K[i] = K[i - 1]; K[i - 1] = k; } if (S[i] == S[i - 1]) { if (P[i] > P[i - 1]) { str = S[i]; S[i] = S[i - 1]; S[i - 1] = str; p = P[i]; P[i] = P[i - 1]; P[i - 1] = p; k = K[i]; K[i] = K[i - 1]; K[i - 1] = k; } } } } for (int i = 0; i < N; i++) { cout << K[i] << endl; } return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
840,305
840,306
u070471279
cpp
p03030
//#include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, j, k) for (int i = (int)(j); i < (int)(k); ++i) #define ROF(i, j, k) for (int i = (int)(j); i >= (int)(k); --i) #define FORLL(i, n, m) for (long long i = n; i < (long long)(m); i++) #define SORT(v, n) sort(v, v + n) #define REVERSE(v) reverse((v).begin(), (v).end()) using namespace std; using ll = long long; const ll MOD = 1000000007LL; typedef pair<int, int> P; ll ADD(ll x, ll y) { return (x + y) % MOD; } ll SUB(ll x, ll y) { return (x - y + MOD) % MOD; } ll MUL(ll x, ll y) { return x * y % MOD; } ll POW(ll x, ll e) { ll v = 1; for (; e; x = MUL(x, x), e >>= 1) if (e & 1) v = MUL(v, x); return v; } ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD - 2)); } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } string s[110]; int p[110]; map<string, vector<P>> mp; int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; REP(i, n) { cin >> s[i] >> p[i]; mp[s[i]].push_back({p[i], i + 1}); } for (auto itr = mp.begin(); itr != mp.end(); ++itr) { sort(itr->second.begin(), itr->second.end()); reverse(itr->second.begin(), itr->second.end()); REP(i, itr->second.size()) { cerr << itr->second[i].second << endl; } // cerr << itr->second[itr->second.size()-1].second << endl; } return 0; }
//#include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, j, k) for (int i = (int)(j); i < (int)(k); ++i) #define ROF(i, j, k) for (int i = (int)(j); i >= (int)(k); --i) #define FORLL(i, n, m) for (long long i = n; i < (long long)(m); i++) #define SORT(v, n) sort(v, v + n) #define REVERSE(v) reverse((v).begin(), (v).end()) using namespace std; using ll = long long; const ll MOD = 1000000007LL; typedef pair<int, int> P; ll ADD(ll x, ll y) { return (x + y) % MOD; } ll SUB(ll x, ll y) { return (x - y + MOD) % MOD; } ll MUL(ll x, ll y) { return x * y % MOD; } ll POW(ll x, ll e) { ll v = 1; for (; e; x = MUL(x, x), e >>= 1) if (e & 1) v = MUL(v, x); return v; } ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD - 2)); } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } string s[110]; int p[110]; map<string, vector<P>> mp; int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; REP(i, n) { cin >> s[i] >> p[i]; mp[s[i]].push_back({p[i], i + 1}); } for (auto itr = mp.begin(); itr != mp.end(); ++itr) { sort(itr->second.begin(), itr->second.end()); reverse(itr->second.begin(), itr->second.end()); REP(i, itr->second.size()) { cout << itr->second[i].second << endl; } // cerr << itr->second[itr->second.size()-1].second << endl; } return 0; }
[ "identifier.change", "io.output.change" ]
840,320
840,321
u783861517
cpp
p03030
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef struct Restaurant { string name; int point; int id; Restaurant(string _name, int _p, int _id) { name = _name; point = _p; id = _id; } } restaurant_t; bool cmp(restaurant_t a, restaurant_t b) { if (a.name != b.name) { return a.name < b.name; } else { return a.point > b.point; } } int main(void) { int n; cin >> n; vector<restaurant_t> rest; for (int i = 0; i < n; i++) { string tmp; int p; cin >> tmp; cin >> p; rest.push_back(Restaurant(tmp, p, i + 1)); } sort(rest.begin(), rest.end(), cmp); for (int i = 0; i < n; i++) { cout << rest[i].id; } return 0; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef struct Restaurant { string name; int point; int id; Restaurant(string _name, int _p, int _id) { name = _name; point = _p; id = _id; } } restaurant_t; bool cmp(restaurant_t a, restaurant_t b) { if (a.name != b.name) { return a.name < b.name; } else { return a.point > b.point; } } int main(void) { int n; cin >> n; vector<restaurant_t> rest; for (int i = 0; i < n; i++) { string tmp; int p; cin >> tmp; cin >> p; rest.push_back(Restaurant(tmp, p, i + 1)); } sort(rest.begin(), rest.end(), cmp); for (int i = 0; i < n; i++) { cout << rest[i].id << endl; ; } return 0; }
[ "io.output.newline.add" ]
840,344
840,345
u810075828
cpp
p03030
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //------------------------------------------- template <class T> inline T sqr(T x) { return x * x; } // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define EXISTch(s, c) \ ((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1) #define SORT(c) sort((c).begin(), (c).end()) #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int INF = (int)1000000007; const LL MOD = (LL)1000000007; // 10^9+7 const LL INF2 = (LL)100000000000000000; // 10^18 struct P { string f, s; int x; }; bool comp(P p1, P p2) { if (p1.f != p2.f) { return p1.f < p2.f; } else { return p1.s >= p2.s; } } void dump(const vector<P> a) { int n = a.size(); for (int i = 0; i < n; i++) { cout << a[i].f << " " << a[i].s << endl; } } /* vector<P> a(n); for (int i = 0; i < n; i++) { cin >> a[i].f>>a[i].s; } sort(a.begin(), a.end(),comp); */ int main() { int n; cin >> n; vector<P> a(n); for (int i = 0; i < n; i++) { cin >> a[i].f >> a[i].s; a[i].x = i + 1; } sort(a.begin(), a.end(), comp); for (int i = 0; i < n; i++) { cout << a[i].x << endl; } return 0; }
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //------------------------------------------- template <class T> inline T sqr(T x) { return x * x; } // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define EXISTch(s, c) \ ((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1) #define SORT(c) sort((c).begin(), (c).end()) #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int INF = (int)1000000007; const LL MOD = (LL)1000000007; // 10^9+7 const LL INF2 = (LL)100000000000000000; // 10^18 struct P { string f; int s; int x; }; bool comp(P p1, P p2) { if (p1.f != p2.f) { return p1.f < p2.f; } else { return p1.s >= p2.s; } } void dump(const vector<P> a) { int n = a.size(); for (int i = 0; i < n; i++) { cout << a[i].f << " " << a[i].s << endl; } } /* vector<P> a(n); for (int i = 0; i < n; i++) { cin >> a[i].f>>a[i].s; } sort(a.begin(), a.end(),comp); */ int main() { int n; cin >> n; vector<P> a(n); for (int i = 0; i < n; i++) { cin >> a[i].f >> a[i].s; a[i].x = i + 1; } sort(a.begin(), a.end(), comp); for (int i = 0; i < n; i++) { cout << a[i].x << endl; } return 0; }
[]
840,346
840,347
u874996917
cpp
p03030
#include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <stdio.h> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #define rep(i, a, n) for (ll i = (a); i < (n); ++i) #define urep(i, a, n) for (ll i = (a); i >= (n); --i) #define all(x) (x).begin(), (x).end() #define INF 1e18 const int mod = 1e9 + 7; typedef long long ll; using namespace std; ll dx[4] = {1, -1, 0, 0}; ll dy[4] = {0, 0, 1, -1}; ll N, M, X, Y, A, B, C, D, Q, K, R, W, H, P, L, G; ll ans; string S, T; ll y[101010]; ll a[101010]; ll b[101010]; ll t[101010]; ll p[101010]; ll n[101010]; ll l[101010]; ll r[101010]; string s[101010]; ll gcd(ll a, ll b) { if (b == 0) return a; else return gcd(b, a % b); } struct Edge { ll to, cost; Edge(ll to, ll cost) : to(to), cost(cost) {} }; typedef vector<vector<Edge>> AdjList; AdjList graph; vector<ll> dist; struct UnionFind { vector<ll> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 vector<ll> size; UnionFind(ll N) : par(N), size(N) { //最初は全てが根であるとして初期化 for (ll i = 0; i < N; i++) par[i] = i; for (ll i = 0; i < N; i++) size[i] = 1; } ll root(ll x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根} if (par[x] == x) return x; return par[x] = root(par[x]); } ll GetSize(ll x) { return size[root(x)]; } void unite(ll x, ll y) { // xとyの木を併合 ll rx = root(x); // xの根をrx ll ry = root(y); // yの根をry if (rx == ry) return; // xとyの根が同じ(=同じ木にある)時はそのまま par[rx] = ry; // xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける size[ry] += size[rx]; } bool same(ll x, ll y) { // 2つのデータx, yが属する木が同じならtrueを返す ll rx = root(x); ll ry = root(y); return rx == ry; } }; ll sr, sc; int main() { cin >> N; vector<pair<string, pair<ll, ll>>> v; rep(i, 1, N + 1) { string s; ll p; cin >> s >> p; v.push_back(make_pair(s, make_pair(p, i))); } sort(v.begin(), v.end()); rep(i, 0, N) { ll j = i; vector<pair<ll, ll>> v2; v2.push_back(v[i].second); if (j + 1 == N) { cout << v[i].second.second << endl; } while (v[j].first == v[j + 1].first) { v2.push_back(v[j + 1].second); i++; j++; if (j == N) break; } sort(v2.begin(), v2.end()); urep(j, v2.size() - 1, 0) { cout << v2[j].second << endl; } } return 0; }
#include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <stdio.h> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #define rep(i, a, n) for (ll i = (a); i < (n); ++i) #define urep(i, a, n) for (ll i = (a); i >= (n); --i) #define all(x) (x).begin(), (x).end() #define INF 1e18 const int mod = 1e9 + 7; typedef long long ll; using namespace std; ll dx[4] = {1, -1, 0, 0}; ll dy[4] = {0, 0, 1, -1}; ll N, M, X, Y, A, B, C, D, Q, K, R, W, H, P, L, G; ll ans; string S, T; ll y[101010]; ll a[101010]; ll b[101010]; ll t[101010]; ll p[101010]; ll n[101010]; ll l[101010]; ll r[101010]; string s[101010]; ll gcd(ll a, ll b) { if (b == 0) return a; else return gcd(b, a % b); } struct Edge { ll to, cost; Edge(ll to, ll cost) : to(to), cost(cost) {} }; typedef vector<vector<Edge>> AdjList; AdjList graph; vector<ll> dist; struct UnionFind { vector<ll> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 vector<ll> size; UnionFind(ll N) : par(N), size(N) { //最初は全てが根であるとして初期化 for (ll i = 0; i < N; i++) par[i] = i; for (ll i = 0; i < N; i++) size[i] = 1; } ll root(ll x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根} if (par[x] == x) return x; return par[x] = root(par[x]); } ll GetSize(ll x) { return size[root(x)]; } void unite(ll x, ll y) { // xとyの木を併合 ll rx = root(x); // xの根をrx ll ry = root(y); // yの根をry if (rx == ry) return; // xとyの根が同じ(=同じ木にある)時はそのまま par[rx] = ry; // xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける size[ry] += size[rx]; } bool same(ll x, ll y) { // 2つのデータx, yが属する木が同じならtrueを返す ll rx = root(x); ll ry = root(y); return rx == ry; } }; ll sr, sc; int main() { cin >> N; vector<pair<string, pair<ll, ll>>> v; rep(i, 1, N + 1) { string s; ll p; cin >> s >> p; v.push_back(make_pair(s, make_pair(p, i))); } sort(v.begin(), v.end()); rep(i, 0, N) { ll j = i; vector<pair<ll, ll>> v2; v2.push_back(v[i].second); if (j + 1 == N) { cout << v[i].second.second << endl; break; } while (v[j].first == v[j + 1].first) { v2.push_back(v[j + 1].second); i++; j++; if (j + 1 == N) break; } sort(v2.begin(), v2.end()); urep(j, v2.size() - 1, 0) { cout << v2[j].second << endl; } } return 0; }
[ "control_flow.branch.if.condition.change" ]
840,359
840,360
u406225550
cpp
p03030
#include <iostream> #include <string> #include <utility> #include <vector> using namespace std; void swa(pair<string, int> &a, pair<string, int> &b) { pair<string, int> t = a; a = b; b = t; } void wap(int &a, int &b) { int t = a; a = b; b = t; } int main() { int N; cin >> N; vector<pair<string, int>> res(N); for (int i = 0; i < N; i++) { string S; int k; cin >> S >> k; res[i] = make_pair(S, k); } vector<int> ans(N); for (int i = 0; i < N; i++) ans[i] = i + 1; for (int i = 0; i < N; i++) { for (int j = 0; j < N - 1; j++) { if (res[j].first > res[j + 1].first) { swa(res[j], res[j + 1]); wap(ans[j], ans[j + 1]); } if (res[j].first == res[j + 1].first && res[j].second > res[j + 1].second) { swa(res[j], res[j + 1]); wap(ans[j], ans[j + 1]); } } } for (int i = 0; i < N; i++) cout << ans[i] << endl; }
#include <iostream> #include <string> #include <utility> #include <vector> using namespace std; void swa(pair<string, int> &a, pair<string, int> &b) { pair<string, int> t = a; a = b; b = t; } void wap(int &a, int &b) { int t = a; a = b; b = t; } int main() { int N; cin >> N; vector<pair<string, int>> res(N); for (int i = 0; i < N; i++) { string S; int k; cin >> S >> k; res[i] = make_pair(S, k); } vector<int> ans(N); for (int i = 0; i < N; i++) ans[i] = i + 1; for (int i = 0; i < N; i++) { for (int j = 0; j < N - 1; j++) { if (res[j].first > res[j + 1].first) { swa(res[j], res[j + 1]); wap(ans[j], ans[j + 1]); } if (res[j].first == res[j + 1].first && res[j].second < res[j + 1].second) { swa(res[j], res[j + 1]); wap(ans[j], ans[j + 1]); } } } for (int i = 0; i < N; i++) cout << ans[i] << endl; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
840,375
840,376
u058186113
cpp
p03030
#include <algorithm> #include <iostream> #include <string> #include <tuple> #include <vector> using namespace std; int main() { int n, p; string s; cin >> n; vector<tuple<string, int, int>> sp; for (int i = 0; i < n; ++i) { cin >> s >> p; sp.push_back(make_tuple(s, p, i + 1)); } sort(sp.begin(), sp.end()); for (int i = 0; i < n; ++i) { cout << n - get<2>(sp[i]) + 1 << '\n'; } }
#include <algorithm> #include <iostream> #include <string> #include <tuple> #include <vector> using namespace std; int main() { int n, p; string s; cin >> n; vector<tuple<string, int, int>> sp; for (int i = 0; i < n; ++i) { cin >> s >> p; sp.push_back(make_tuple(s, -p, i + 1)); } sort(sp.begin(), sp.end()); for (int i = 0; i < n; ++i) { cout << get<2>(sp[i]) << '\n'; } }
[ "expression.operation.unary.add", "call.arguments.change", "expression.operation.binary.remove" ]
840,381
840,382
u021083776
cpp
p03030
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; int n, m; string s; typedef pair<int, int> P; typedef vector<int> VI; typedef tuple<string, int, int> TU; bool comp(const TU &a, const TU &b) { if (get<0>(a) < get<0>(b)) { return 1; } else if (get<0>(a) > get<0>(b)) { return 0; } else { return get<1>(a) > get<1>(b); } } int main() { cin >> n; vector<TU> mem(n); int q; for (int i = 0; i < n; i++) { cin >> s >> q; mem[i] = make_tuple(s, q, i + 1); } sort(mem.begin(), mem.end(), comp); for (int i = 0; i < n; i++) { cout << get<2>(mem[i]); } cout << endl; }
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; int n, m; string s; typedef pair<int, int> P; typedef vector<int> VI; typedef tuple<string, int, int> TU; bool comp(const TU &a, const TU &b) { if (get<0>(a) < get<0>(b)) { return 1; } else if (get<0>(a) > get<0>(b)) { return 0; } else { return get<1>(a) > get<1>(b); } } int main() { cin >> n; vector<TU> mem(n); int q; for (int i = 0; i < n; i++) { cin >> s >> q; mem[i] = make_tuple(s, q, i + 1); } sort(mem.begin(), mem.end(), comp); for (int i = 0; i < n; i++) { cout << get<2>(mem[i]) << endl; } }
[]
840,417
840,418
u587724217
cpp
p03030
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<string, ll> P; #define M 1000000007 int main() { ll n, l; cin >> n; vector<P> p(n), q(n); map<P, ll> m; string s; for (ll i = 0; i < n; i++) { cin >> s >> l; p[i] = P(s, -l); q[i] = p[i]; m[p[i]] = i; } sort(p.begin(), p.end()); for (int i = 0; i < n; i++) { cout << m[p[i]] << endl; } }
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<string, ll> P; #define M 1000000007 int main() { ll n, l; cin >> n; vector<P> p(n), q(n); map<P, ll> m; string s; for (ll i = 0; i < n; i++) { cin >> s >> l; p[i] = P(s, -l); q[i] = p[i]; m[p[i]] = i + 1; } sort(p.begin(), p.end()); for (int i = 0; i < n; i++) { cout << m[p[i]] << endl; } }
[ "assignment.change" ]
840,419
840,420
u987476436
cpp
p03030
#include <bits/stdc++.h> using namespace std; #define fi first #define se second bool cmp(pair<string, pair<int, int>> a, pair<string, pair<int, int>> b) { if (a.fi == b.fi) return a.se.fi > b.se.fi; return a.fi < b.fi; } int main() { int n; cin >> n; pair<string, pair<int, int>> p[n + 1]; for (int i = 1; i <= n; i++) { cin >> p[i].fi >> p[i].se.fi; p[i].se.se = i; } sort(p + 1, p + n + 1); for (int i = 1; i <= n; i++) { cout << p[i].se.se << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define fi first #define se second bool cmp(pair<string, pair<int, int>> a, pair<string, pair<int, int>> b) { if (a.fi == b.fi) return a.se.fi > b.se.fi; return a.fi < b.fi; } int main() { int n; cin >> n; pair<string, pair<int, int>> p[n + 1]; for (int i = 1; i <= n; i++) { cin >> p[i].fi >> p[i].se.fi; p[i].se.se = i; } sort(p + 1, p + n + 1, cmp); for (int i = 1; i <= n; i++) { cout << p[i].se.se << endl; } return 0; }
[ "call.arguments.add" ]
840,421
840,422
u576115185
cpp
p03030
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair #define fastIO \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count()); struct R { string city; int score; int id; bool operator<(const R &B) const { if (city == B.city) return score < B.score; else return city < B.city; } }; int main() { fastIO; int n; cin >> n; R t[n]; for (int i = 0; i < n; i++) { cin >> t[i].city >> t[i].score; t[i].id = i + 1; } sort(t, t + n); for (int i = 0; i < n; i++) cout << t[i].id << "\n"; return 0; }
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair #define fastIO \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count()); struct R { string city; int score; int id; bool operator<(const R &B) const { if (city == B.city) return score > B.score; else return city < B.city; } }; int main() { fastIO; int n; cin >> n; R t[n]; for (int i = 0; i < n; i++) { cin >> t[i].city >> t[i].score; t[i].id = i + 1; } sort(t, t + n); for (int i = 0; i < n; i++) cout << t[i].id << "\n"; return 0; }
[ "misc.opposites", "expression.operator.compare.change", "function.return_value.change", "expression.operation.binary.change" ]
840,429
840,430
u722777218
cpp
p03030
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = a; i < b; i++) #define REP(i, b) FOR(i, 0, b) #define RFOR(i, a, b) for (int i = a - 1; i >= b; i--) #define RREP(i, a) RFOR(i, a, 0) #define REPALL(i, v) for (int i = 0; i < v.size(); i++) #define RREPALL(i, v) for (int i = v.size() - 1; i >= 0; i--) #define SORT(v) sort(v.begin(), v.end()) #define MIN_ELEMENT(v) min_element(v.begin(), v.end()) #define MAX_ELEMENT(v) max_element(v.begin(), v.end()) #define COUNT(v, n) count(v.begin(), v.end(), n); void YES(bool flag) { cout << (flag ? "YES" : "NO") << endl; } void Yes(bool flag) { cout << (flag ? "Yes" : "No") << endl; } void yes(bool flag) { cout << (flag ? "yes" : "no") << endl; } typedef long long ll; typedef unsigned long long ull; const int INF = 1e7; const ll MOD = 1e9 + 7; map<pair<string, int>, int> mp; int main() { int n, m, ans = 0; cin >> n; REP(i, n) { string s; int p; cin >> s >> p; mp[{s, p}] = n - i; } for (auto itr : mp) { cout << itr.second << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = a; i < b; i++) #define REP(i, b) FOR(i, 0, b) #define RFOR(i, a, b) for (int i = a - 1; i >= b; i--) #define RREP(i, a) RFOR(i, a, 0) #define REPALL(i, v) for (int i = 0; i < v.size(); i++) #define RREPALL(i, v) for (int i = v.size() - 1; i >= 0; i--) #define SORT(v) sort(v.begin(), v.end()) #define MIN_ELEMENT(v) min_element(v.begin(), v.end()) #define MAX_ELEMENT(v) max_element(v.begin(), v.end()) #define COUNT(v, n) count(v.begin(), v.end(), n); void YES(bool flag) { cout << (flag ? "YES" : "NO") << endl; } void Yes(bool flag) { cout << (flag ? "Yes" : "No") << endl; } void yes(bool flag) { cout << (flag ? "yes" : "no") << endl; } typedef long long ll; typedef unsigned long long ull; const int INF = 1e7; const ll MOD = 1e9 + 7; map<pair<string, int>, int> mp; int main() { int n, m, ans = 0; cin >> n; REP(i, n) { string s; int p; cin >> s >> p; mp[{s, -p}] = i + 1; } for (auto itr : mp) { cout << itr.second << endl; } return 0; }
[ "expression.operation.unary.add", "expression.operation.binary.remove", "assignment.change" ]
840,431
840,432
u007637377
cpp
p03030
#include <algorithm> #include <cmath> #include <cstdio> #include <map> #include <queue> #include <string> #include <vector> using namespace std; bool func(const pair<pair<string, int>, int> &a, const pair<pair<string, int>, int> &b) { return a.first.first < b.first.first || a.first.second == b.first.second && a.first.second > b.first.second; } int main() { vector<pair<pair<string, int>, int>> list; char input[20]; int input2; string str; int n; int i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s %d", input, &input2); str = input; list.push_back( pair<pair<string, int>, int>(pair<string, int>(str, input2), i + 1)); } sort(list.begin(), list.end(), func); for (i = 0; i < n; i++) { printf("%d\n", list[i].second); } return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <map> #include <queue> #include <string> #include <vector> using namespace std; bool func(const pair<pair<string, int>, int> &a, const pair<pair<string, int>, int> &b) { return a.first.first < b.first.first || a.first.first == b.first.first && a.first.second > b.first.second; } int main() { vector<pair<pair<string, int>, int>> list; char input[20]; int input2; string str; int n; int i; // freopen("input.txt", "r", stdin); scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s %d", input, &input2); str = input; list.push_back( pair<pair<string, int>, int>(pair<string, int>(str, input2), i + 1)); } sort(list.begin(), list.end(), func); for (i = 0; i < n; i++) { printf("%d\n", list[i].second); } return 0; }
[ "function.return_value.change", "expression.operation.binary.change" ]
840,437
840,438
u619248223
cpp
p03030
//----------ACCIDENTAL COMPETITIVE PROGRAMMER--------------------- #include <bits/stdc++.h> /* #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> */ using namespace std; #define LL long long #define LD long double #define PB push_back #define MP make_pair const LL MOD = (1e9) + 7; const LD EPS = 0.0000001; struct node { string name; int idx; int p; }; bool comp(const node a, const node b) { if (a.name == b.name) return a.p < b.p; else return a.name < b.name; } int main(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; node arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i].name >> arr[i].p; arr[i].idx = i + 1; } sort(arr, arr + n, comp); for (int i = 0; i < n; i++) cout << arr[i].idx << endl; return 0; }
//----------ACCIDENTAL COMPETITIVE PROGRAMMER--------------------- #include <bits/stdc++.h> /* #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> */ using namespace std; #define LL long long #define LD long double #define PB push_back #define MP make_pair const LL MOD = (1e9) + 7; const LD EPS = 0.0000001; struct node { string name; int idx; int p; }; bool comp(const node a, const node b) { if (a.name == b.name) return a.p > b.p; else return a.name < b.name; } int main(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; node arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i].name >> arr[i].p; arr[i].idx = i + 1; } sort(arr, arr + n, comp); for (int i = 0; i < n; i++) cout << arr[i].idx << endl; return 0; }
[ "misc.opposites", "expression.operator.compare.change", "function.return_value.change", "expression.operation.binary.change" ]
840,441
840,442
u109311178
cpp
p03030
#include <bits/stdc++.h> using namespace std; bool sortbydesc(const pair<string, pair<int, int>> &a, const pair<string, pair<int, int>> &b) { return (a.second.first > b.second.first); } int main() { int n; cin >> n; string s; int p; vector<pair<string, pair<int, int>>> sp; for (int i = 0; i < n; i++) { cin >> s >> p; sp.push_back(make_pair(s, make_pair(p, i + 1))); } sort(sp.begin(), sp.end()); string iter1 = sp[0].first; int i = 0, j = 0; while (i < n) { while (j < n && sp[j].first == iter1) j++; sort(sp.begin() + i, sp.begin() + j, sortbydesc); i = j; if (j < n) iter1 = sp[j].first; break; } for (pair<string, pair<int, int>> a : sp) cout << a.second.second << endl; }
#include <bits/stdc++.h> using namespace std; bool sortbydesc(const pair<string, pair<int, int>> &a, const pair<string, pair<int, int>> &b) { return (a.second.first > b.second.first); } int main() { int n; cin >> n; string s; int p; vector<pair<string, pair<int, int>>> sp; for (int i = 0; i < n; i++) { cin >> s >> p; sp.push_back(make_pair(s, make_pair(p, i + 1))); } sort(sp.begin(), sp.end()); string iter1 = sp[0].first; int i = 0, j = 0; while (i < n) { while (j < n && sp[j].first == iter1) j++; sort(sp.begin() + i, sp.begin() + j, sortbydesc); i = j; if (j < n) iter1 = sp[j].first; } for (pair<string, pair<int, int>> a : sp) cout << a.second.second << endl; }
[]
840,452
840,453
u117783424
cpp
p03030
#include <iostream> #include <string> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #include <vector> #include <algorithm> #include <tuple> typedef tuple<char, int, int> mytuple; int main() { int N; cin >> N; vector<mytuple> T; // S,P,index rep(i, 0, N) { string s_temp; int p_temp; cin >> s_temp >> p_temp; T.push_back(make_tuple(s_temp[0], -p_temp, i + 1)); } sort(T.begin(), T.end(), [](mytuple const &lhs, mytuple const &rhs) { if (std::get<0>(lhs) != std::get<0>(rhs)) return std::get<0>(lhs) < std::get<0>(rhs); if (std::get<1>(lhs) != std::get<1>(rhs)) return std::get<1>(lhs) < std::get<1>(rhs); return std::get<2>(lhs) < std::get<2>(rhs); }); rep(i, 0, N) { char &c_temp = get<0>(T[i]); int &p_temp = get<1>(T[i]); int &i_temp = get<2>(T[i]); // cout<<p_temp<<endl; cout << i_temp << endl; } }
#include <iostream> #include <string> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #include <vector> #include <algorithm> #include <tuple> typedef tuple<string, int, int> mytuple; int main() { int N; cin >> N; vector<mytuple> T; // S,P,index rep(i, 0, N) { string s_temp; int p_temp; cin >> s_temp >> p_temp; T.push_back(make_tuple(s_temp, -p_temp, i + 1)); } sort(T.begin(), T.end(), [](mytuple const &lhs, mytuple const &rhs) { if (std::get<0>(lhs) != std::get<0>(rhs)) return std::get<0>(lhs) < std::get<0>(rhs); if (std::get<1>(lhs) != std::get<1>(rhs)) return std::get<1>(lhs) < std::get<1>(rhs); return std::get<2>(lhs) < std::get<2>(rhs); }); rep(i, 0, N) { string &c_temp = get<0>(T[i]); int &p_temp = get<1>(T[i]); int &i_temp = get<2>(T[i]); // cout<<p_temp<<endl; cout << i_temp << endl; } }
[ "variable_declaration.type.change" ]
840,454
840,455
u291552830
cpp
p03030
#include <algorithm> #include <bits/stdc++.h> #include <string> #include <vector> using namespace std; struct data_t { string str; int num; int num2; bool operator<(const data_t &right) const { return str == right.str ? num > right.num : str < right.str; } }; int main() { int N; cin >> N; vector<data_t> data_array(N); for (int i = 0; i < N; i++) { cin >> data_array[i].str >> data_array[i].num; data_array[i].num2 = i; } sort(data_array.begin(), data_array.end()); for (int i = 0; i < N; i++) cout << data_array[i].num2 << endl; return 0; }
#include <algorithm> #include <bits/stdc++.h> #include <string> #include <vector> using namespace std; struct data_t { string str; int num; int num2; bool operator<(const data_t &right) const { return str == right.str ? num > right.num : str < right.str; } }; int main() { int N; cin >> N; vector<data_t> data_array(N); for (int i = 0; i < N; i++) { cin >> data_array[i].str >> data_array[i].num; data_array[i].num2 = i + 1; } sort(data_array.begin(), data_array.end()); for (int i = 0; i < N; i++) cout << data_array[i].num2 << endl; return 0; }
[ "assignment.change" ]
840,456
840,457
u523548069
cpp
p03030
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <typeinfo> #include <vector> using namespace std; typedef long long ll; typedef pair<string, int> P; int main() { int n, a; vector<P> vec; map<P, int> m; int index = 1; string s; cin >> n; while (n--) { cin >> s; cin >> a; P p = make_pair(s, index); vec.emplace_back(p); m.emplace(map<P, int>::value_type(p, index)); index++; } sort(vec.begin(), vec.end(), [](P a, P b) { return a.second > b.second; }); P p; for (int i = 0; i < vec.size(); i++) { p = vec[i]; int ind = i; for (int j = i + 1; j < vec.size(); j++) { if (vec[j].first < p.first) { p = vec[j]; ind = j; } } for (int k = ind; k > i; k--) vec[k] = vec[k - 1]; vec[i] = p; } for (auto e : vec) { cout << m[e] << endl; } return 0; }
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <typeinfo> #include <vector> using namespace std; typedef long long ll; typedef pair<string, int> P; int main() { int n, a; vector<P> vec; map<P, int> m; int index = 1; string s; cin >> n; while (n--) { cin >> s; cin >> a; P p = make_pair(s, a); vec.emplace_back(p); m.emplace(map<P, int>::value_type(p, index)); index++; } sort(vec.begin(), vec.end(), [](P a, P b) { return a.second > b.second; }); P p; for (int i = 0; i < vec.size(); i++) { p = vec[i]; int ind = i; for (int j = i + 1; j < vec.size(); j++) { if (vec[j].first < p.first) { p = vec[j]; ind = j; } } for (int k = ind; k > i; k--) vec[k] = vec[k - 1]; vec[i] = p; } for (auto e : vec) { cout << m[e] << endl; } return 0; }
[ "identifier.change", "call.arguments.change" ]
840,458
840,459
u508492526
cpp
p03030
#include <bits/stdc++.h> using namespace std; /* #pragma */ /* #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") */ /*alias*/ #define F first #define S second #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext #define prev asdprev #define itn int /*template*/ template <class T> inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } /* func */ int GCD(int a, int b) { return b ? GCD(b, a % b) : a; } long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; } int LCM(int a, int b) { return a * b / GCD(a, b); } long long LCM(long long a, long long b) { return a * b / GCD(a, b); } /*struct*/ struct aaa { aaa() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } aaaaaaa; /* const */ const int INF = 1001001001; const long long LINF = 1001001001001001001ll; const int MOD = 1e9 + 7; // 10^9 const double EPS = 1e-9; const int dx[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; // const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; // Counterclockwise from the 6o'clock direction // Take the x-axis downward and the y-axis right //#define int long long // g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp // chcp 65001 signed main() { int n; cin >> n; vector<tuple<string, int, int>> z(n); for (int i = 0, i_len = (int)n; i < i_len; ++i) { string s; cin >> s; int p; cin >> p; z[i] = make_tuple(s, p, i + 1); } sort(z.begin(), z.end(), [](const auto &x, const auto &y) { //第一要素が同一ならば第二要素の小さい方を返す return get<0>(x) == get<0>(y) ? get<1>(x) > get<1>(y) : get<0>(x) > get<0>(y); }); for (int i = 0, i_len = (int)n; i < i_len; ++i) { cout << get<2>(z[i]) << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; /* #pragma */ /* #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") */ /*alias*/ #define F first #define S second #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext #define prev asdprev #define itn int /*template*/ template <class T> inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } /* func */ int GCD(int a, int b) { return b ? GCD(b, a % b) : a; } long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; } int LCM(int a, int b) { return a * b / GCD(a, b); } long long LCM(long long a, long long b) { return a * b / GCD(a, b); } /*struct*/ struct aaa { aaa() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } aaaaaaa; /* const */ const int INF = 1001001001; const long long LINF = 1001001001001001001ll; const int MOD = 1e9 + 7; // 10^9 const double EPS = 1e-9; const int dx[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; // const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; // Counterclockwise from the 6o'clock direction // Take the x-axis downward and the y-axis right //#define int long long // g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp // chcp 65001 signed main() { int n; cin >> n; vector<tuple<string, int, int>> z(n); for (int i = 0, i_len = (int)n; i < i_len; ++i) { string s; cin >> s; int p; cin >> p; z[i] = make_tuple(s, p, i + 1); } sort(z.begin(), z.end(), [](const auto &x, const auto &y) { return get<0>(x) == get<0>(y) ? get<1>(x) > get<1>(y) : get<0>(x) < get<0>(y); }); for (int i = 0, i_len = (int)n; i < i_len; ++i) { cout << get<2>(z[i]) << endl; } return 0; }
[ "misc.opposites", "expression.operator.compare.change", "call.arguments.change", "function.return_value.change", "expression.operation.binary.change" ]
840,473
840,474
u509680664
cpp
p03030
#include <bits/stdc++.h> using namespace std; struct dat { int id, price; string name; }; int main(void) { list<dat> lst; int n, p, min; string str; auto itr = lst.begin(); cin >> n; for (int i = 0; i < n; ++i) { cin >> str >> p; dat d; d.id = i + 1; d.name = str; d.price = p; for (itr = lst.begin(); itr != lst.end(); ++itr) { if ((((*itr).name == str) && ((*itr).price < p)) || ((*itr).name < str)) { lst.insert(itr, d); break; } } if (itr == lst.end()) { lst.insert(itr, d); } } for (itr = lst.begin(); itr != lst.end(); ++itr) { cout << (*itr).id << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; struct dat { int id, price; string name; }; int main(void) { list<dat> lst; int n, p, min; string str; auto itr = lst.begin(); cin >> n; for (int i = 0; i < n; ++i) { cin >> str >> p; dat d; d.id = i + 1; d.name = str; d.price = p; for (itr = lst.begin(); itr != lst.end(); ++itr) { if ((((*itr).name == str) && ((*itr).price < p)) || ((*itr).name > str)) { lst.insert(itr, d); break; } } if (itr == lst.end()) { lst.insert(itr, d); } } for (itr = lst.begin(); itr != lst.end(); ++itr) { cout << (*itr).id << endl; } return 0; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
840,485
840,486
u528602057
cpp
p03030
#include <bits/stdc++.h> using namespace std; bool smit(pair<string, int> v1, pair<string, int> v2) { if (v1.first == v2.first) return v1.second > v2.second; else return v1.first < v2.first; } int main() { long long int n; cin >> n; vector<pair<string, int>> v; string s; int p; for (int i = 1; i <= n; i++) { cin >> s >> p; v.push_back(make_pair(s, p)); } vector<pair<string, int>> v1(v); sort(v.begin(), v.end(), smit); for (int i = 0; i < n; i++) { pair<string, int> p = make_pair(v1[i].first, v1[i].second); for (int j = 0; j < n; j++) { if (v[j].second == p.second && v[j].first == p.first) cout << j + 1 << endl; } } }
#include <bits/stdc++.h> using namespace std; bool smit(pair<string, int> v1, pair<string, int> v2) { if (v1.first == v2.first) return v1.second > v2.second; else return v1.first < v2.first; } int main() { long long int n; cin >> n; vector<pair<string, int>> v; string s; int p; for (int i = 1; i <= n; i++) { cin >> s >> p; v.push_back(make_pair(s, p)); } vector<pair<string, int>> v1(v); sort(v.begin(), v.end(), smit); for (int i = 0; i < n; i++) { pair<string, int> p = make_pair(v[i].first, v[i].second); for (int j = 0; j < n; j++) { if (v1[j].second == p.second && v1[j].first == p.first) cout << j + 1 << endl; } } }
[ "identifier.change", "call.arguments.change", "control_flow.branch.if.condition.change" ]
840,522
840,523
u670919462
cpp
p03030
#include <bits/stdc++.h> using namespace std; int main() { string str; int n, t; vector<pair<pair<string, int>, int>> v; cin >> n; for (int i = 0; i < n; i++) { cin >> str >> t; v.push_back(make_pair(make_pair(str, t), i)); } sort(v.begin(), v.end()); for (int i = 0; i < n; i++) { cout << v[i].second + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str; int n, t; vector<pair<pair<string, int>, int>> v; cin >> n; for (int i = 0; i < n; i++) { cin >> str >> t; v.push_back(make_pair(make_pair(str, -t), i)); } sort(v.begin(), v.end()); for (int i = 0; i < n; i++) { cout << v[i].second + 1 << endl; } return 0; }
[ "expression.operation.unary.add", "call.arguments.change" ]
840,550
840,551
u063608889
cpp
p03030
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (a); i >= (b); i--) #define REP(i, n) rep(i, 0, n) #define RREP(i, n) rrep(i, n, 0) int main() { int n; cin >> n; vector<tuple<string, int, int>> all; REP(i, n) { string s; int p; cin >> s >> p; p = -p; int ii = i + 1; all.push_back(tie(s, p, ii)); } sort(all.begin(), all.end()); REP(i, n - 1) { cout << get<2>(all.at(i)) << endl; } }
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (a); i >= (b); i--) #define REP(i, n) rep(i, 0, n) #define RREP(i, n) rrep(i, n, 0) int main() { int n; cin >> n; vector<tuple<string, int, int>> all; REP(i, n) { string s; int p; cin >> s >> p; p = -p; int ii = i + 1; all.push_back(tie(s, p, ii)); } sort(all.begin(), all.end()); REP(i, n) { cout << get<2>(all.at(i)) << endl; } }
[ "expression.operation.binary.remove" ]
840,554
840,555
u973991908
cpp
p03030
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (a); i >= (b); i--) #define REP(i, n) rep(i, 0, n) #define RREP(i, n) rrep(i, n, 0) int main() { int n; cin >> n; vector<pair<pair<string, int>, int>> all; REP(i, n) { string s; int p; cin >> s >> p; all.push_back(make_pair(make_pair(s, p), i + 1)); } sort(all.begin(), all.end()); REP(i, n) { cout << all.at(i).second << endl; } }
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (a); i >= (b); i--) #define REP(i, n) rep(i, 0, n) #define RREP(i, n) rrep(i, n, 0) int main() { int n; cin >> n; vector<pair<pair<string, int>, int>> all; REP(i, n) { string s; int p; cin >> s >> p; all.push_back(make_pair(make_pair(s, -p), i + 1)); } sort(all.begin(), all.end()); REP(i, n) { cout << all.at(i).second << endl; } }
[ "expression.operation.unary.add", "call.arguments.change" ]
840,556
840,557
u973991908
cpp
p03030
#pragma region include #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ALL(obj) (obj).begin(), (obj).end() #define RALL(obj) (obj).rbegin(), (obj).rend() #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define MOD 1000000007 #define INF 1000000000 #define LLINF 4000000000000000000 using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; #pragma endregion //#define __DEBUG__ #ifdef __DEBUG__ #define dump(x) \ cerr << #x << " = " << (x) << " [" << __LINE__ << ":" << __FUNCTION__ \ << "] " << endl; // vector出力 template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << "{"; REP(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); } os << "}"; return os; } // pair出力 template <typename T, typename U> ostream &operator<<(ostream &os, pair<T, U> &p) { return os << "(" << p.first << ", " << p.second << ")"; } // map出力 template <typename T, typename U> ostream &operator<<(ostream &os, map<T, U> &map_var) { os << "{"; for (auto itr = map_var.begin(); itr != map_var.end(); itr++) { os << "(" << itr->first << ", " << itr->second << ")"; itr++; if (itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } // set 出力 template <typename T> ostream &operator<<(ostream &os, set<T> &set_var) { os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) { os << *itr; ++itr; if (itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } #endif int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<tuple<string, int, int>> A(N); REP(i, N) { string s; int rank; cin >> s >> rank; A[i] = make_tuple(s, -rank, i); } sort(ALL(A)); REP(i, N) { // int id; // tie(ignore, ignore, id) = A[i]; // cout << id << endl; cout << get<2>(A[i]) << endl; } getchar(); getchar(); }
#pragma region include #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ALL(obj) (obj).begin(), (obj).end() #define RALL(obj) (obj).rbegin(), (obj).rend() #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define MOD 1000000007 #define INF 1000000000 #define LLINF 4000000000000000000 using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; #pragma endregion //#define __DEBUG__ #ifdef __DEBUG__ #define dump(x) \ cerr << #x << " = " << (x) << " [" << __LINE__ << ":" << __FUNCTION__ \ << "] " << endl; // vector出力 template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << "{"; REP(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); } os << "}"; return os; } // pair出力 template <typename T, typename U> ostream &operator<<(ostream &os, pair<T, U> &p) { return os << "(" << p.first << ", " << p.second << ")"; } // map出力 template <typename T, typename U> ostream &operator<<(ostream &os, map<T, U> &map_var) { os << "{"; for (auto itr = map_var.begin(); itr != map_var.end(); itr++) { os << "(" << itr->first << ", " << itr->second << ")"; itr++; if (itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } // set 出力 template <typename T> ostream &operator<<(ostream &os, set<T> &set_var) { os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) { os << *itr; ++itr; if (itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } #endif int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<tuple<string, int, int>> A(N); REP(i, N) { string s; int rank; cin >> s >> rank; A[i] = make_tuple(s, -rank, i + 1); } sort(ALL(A)); REP(i, N) { // int id; // tie(ignore, ignore, id) = A[i]; // cout << id << endl; cout << get<2>(A[i]) << endl; } getchar(); getchar(); }
[ "assignment.change" ]
840,563
840,564
u165374901
cpp
p03030
// gauravsinghh #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; #define ll long long int #define ld long double #define db double #define pii pair<int, int> #define pll pair<long long, long long> #define sii set<int> #define sll set<long long> #define vii vector<int> #define vll vector<long long> #define mii map<int, int> #define mll map<long long, long long> #define lob lower_bound #define upb upper_bound #define ff first #define ss second #define pb push_back #define pf push_front #define ins insert #define mp make_pair #define w(t) \ cin >> t; \ while (t--) #define on cout << "\n" #define o2(a, b) cout << a << " " << b #define os cout << " " #define bitcount __builtin_popcount #define gcd __gcd #define endl "\n" #define present(s, x) (s.find(x) != s.end()) #define cpresent(s, x) (find(all(s), x) != s.end()) #define ford(container, it) \ for (__typeof(container.begin()) it = container.begin(); \ it != container.end(); it++) #define fors(container, it, a, b) \ for (__typeof(container.begin()) it = a; it != b; it++) #define MOD 1000000007 #define EPSILON 1e-9 #define PI 3.14159265358979323846 #define inf 999999999999999999 #define siz 100005 #define SIZ 1000005 #define SIZE 200005 #define fbo find_by_order #define ook order_of_key #define sz(s) (int)s.size() #define mem(n, m) memset(n, m, sizeof(n)) #define rep(i, n) for (ll i = 0; i < n; i++) #define ren(i, n) for (ll i = n - 1; i >= 0; i--) #define all(x) x.begin(), x.end() #define fo(i, a, b) for (ll i = a; i <= b; i++) #define ffo(i, a, b) for (ll i = a; i >= b; i--) #define MAX 100005 #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds; //#pragma GCC target ("avx2") //#pragma GCC optimization ("O3") //#pragma GCC optimization ("unroll-loops") void io_set() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } bool comp(const pair<string, ll> &a, const pair<string, ll> &b) { return (a.first < b.first || (a.first == b.first && a.second > b.second)); } signed main() { IOS io_set(); ll n, p; string s; cin >> n; ll tt = n; vector<pair<string, ll>> a, b; while (tt--) { cin >> s >> p; a.pb(mp(s, p)); b.pb(mp(s, p)); } sort(all(b), comp); map<pair<string, ll>, ll> mpp; ll j = 1; for (auto it : a) { mpp[{it.first, it.second}] = j; j++; } for (auto it : b) { cout << mpp[{it.first, it.second}] << endl; } return 0; }
// gauravsinghh #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; #define ll long long int #define ld long double #define db double #define pii pair<int, int> #define pll pair<long long, long long> #define sii set<int> #define sll set<long long> #define vii vector<int> #define vll vector<long long> #define mii map<int, int> #define mll map<long long, long long> #define lob lower_bound #define upb upper_bound #define ff first #define ss second #define pb push_back #define pf push_front #define ins insert #define mp make_pair #define w(t) \ cin >> t; \ while (t--) #define on cout << "\n" #define o2(a, b) cout << a << " " << b #define os cout << " " #define bitcount __builtin_popcount #define gcd __gcd #define endl "\n" #define present(s, x) (s.find(x) != s.end()) #define cpresent(s, x) (find(all(s), x) != s.end()) #define ford(container, it) \ for (__typeof(container.begin()) it = container.begin(); \ it != container.end(); it++) #define fors(container, it, a, b) \ for (__typeof(container.begin()) it = a; it != b; it++) #define MOD 1000000007 #define EPSILON 1e-9 #define PI 3.14159265358979323846 #define inf 999999999999999999 #define siz 100005 #define SIZ 1000005 #define SIZE 200005 #define fbo find_by_order #define ook order_of_key #define sz(s) (int)s.size() #define mem(n, m) memset(n, m, sizeof(n)) #define rep(i, n) for (ll i = 0; i < n; i++) #define ren(i, n) for (ll i = n - 1; i >= 0; i--) #define all(x) x.begin(), x.end() #define fo(i, a, b) for (ll i = a; i <= b; i++) #define ffo(i, a, b) for (ll i = a; i >= b; i--) #define MAX 100005 #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds; //#pragma GCC target ("avx2") //#pragma GCC optimization ("O3") //#pragma GCC optimization ("unroll-loops") void io_set() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } bool comp(const pair<string, ll> &a, const pair<string, ll> &b) { return (a.first < b.first || (a.first == b.first && a.second > b.second)); } signed main() { IOS // io_set(); ll n, p; string s; cin >> n; ll tt = n; vector<pair<string, ll>> a, b; while (tt--) { cin >> s >> p; a.pb(mp(s, p)); b.pb(mp(s, p)); } sort(all(b), comp); map<pair<string, ll>, ll> mpp; ll j = 1; for (auto it : a) { mpp[{it.first, it.second}] = j; j++; } for (auto it : b) { cout << mpp[{it.first, it.second}] << endl; } return 0; }
[ "variable_declaration.remove" ]
840,565
840,566
u480527921
cpp
p03030
#include <algorithm> #include <iostream> using namespace std; int main(void) { int N, P; string S; cin >> N; pair<pair<string, int>, int> p[N]; for (int i = 0; i < N; i++) { cin >> S >> P; p[i] = make_pair(make_pair(S, P), i); } sort(p, p + N); for (int i = 0; i < N; i++) { cout << p[i].second + 1 << endl; } }
#include <algorithm> #include <iostream> using namespace std; int main(void) { int N, P; string S; cin >> N; pair<pair<string, int>, int> p[N]; for (int i = 0; i < N; i++) { cin >> S >> P; p[i] = make_pair(make_pair(S, -P), i); } sort(p, p + N); for (int i = 0; i < N; i++) { cout << p[i].second + 1 << endl; } }
[ "expression.operation.unary.add", "call.arguments.change" ]
840,577
840,578
u657051080
cpp
p03030
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <string.h> using namespace std; struct guide { char name[10]; int point; int idx; }; bool compareguide(guide g1, guide g2) { if (strcmp(g1.name, g2.name) < 0) return true; else if (strcmp(g1.name, g2.name) == 0) return (g1.point > g2.point); else return false; } int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; guide rest[110]; for (int i = 0; i < N; i++) { char tmp[10]; int p; cin >> tmp >> p; strcpy(rest[i].name, tmp); rest[i].point = p; rest[i].idx = i + 1; } int n = sizeof(rest) / sizeof(rest[0]); sort(rest, rest + N, compareguide); for (int i = 0; i < N; i++) { /* cout << "rest name : " << rest[i].name; cout << " point : " << rest[i].point;*/ cout << rest[i].idx << endl; } return 0; }
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <string.h> using namespace std; struct guide { char name[15]; int point; int idx; }; bool compareguide(guide g1, guide g2) { if (strcmp(g1.name, g2.name) < 0) return true; else if (strcmp(g1.name, g2.name) == 0) return (g1.point > g2.point); else return false; } int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; guide rest[110]; for (int i = 0; i < N; i++) { char tmp[15]; int p; cin >> tmp >> p; strcpy(rest[i].name, tmp); rest[i].point = p; rest[i].idx = i + 1; } int n = sizeof(rest) / sizeof(rest[0]); sort(rest, rest + N, compareguide); for (int i = 0; i < N; i++) { /* cout << "rest name : " << rest[i].name; cout << " point : " << rest[i].point;*/ cout << rest[i].idx << endl; } return 0; }
[ "literal.number.change", "variable_declaration.array_dimensions.change" ]
840,587
840,588
u363251947
cpp
p03030
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <string.h> using namespace std; struct guide { char name[10]; int point; int idx; }; bool compareguide(guide g1, guide g2) { if (strcmp(g1.name, g2.name) < 0) return true; else if (strcmp(g1.name, g2.name) == 0) return (g1.point > g2.point); else return false; } int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; guide rest[N]; for (int i = 0; i < N; i++) { char tmp[10]; int p; cin >> tmp >> p; strcpy(rest[i].name, tmp); rest[i].point = p; rest[i].idx = i + 1; } int n = sizeof(rest) / sizeof(rest[0]); sort(rest, rest + n, compareguide); for (int i = 0; i < N; i++) { /* cout << "rest name : " << rest[i].name; cout << " point : " << rest[i].point;*/ cout << rest[i].idx << endl; } return 0; }
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <string.h> using namespace std; struct guide { char name[15]; int point; int idx; }; bool compareguide(guide g1, guide g2) { if (strcmp(g1.name, g2.name) < 0) return true; else if (strcmp(g1.name, g2.name) == 0) return (g1.point > g2.point); else return false; } int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; guide rest[110]; for (int i = 0; i < N; i++) { char tmp[15]; int p; cin >> tmp >> p; strcpy(rest[i].name, tmp); rest[i].point = p; rest[i].idx = i + 1; } int n = sizeof(rest) / sizeof(rest[0]); sort(rest, rest + N, compareguide); for (int i = 0; i < N; i++) { /* cout << "rest name : " << rest[i].name; cout << " point : " << rest[i].point;*/ cout << rest[i].idx << endl; } return 0; }
[ "literal.number.change", "variable_declaration.array_dimensions.change", "identifier.replace.remove", "literal.replace.add", "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
840,589
840,588
u363251947
cpp
p03030
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <string.h> using namespace std; struct guide { char name[15]; int point; int idx; }; bool compareguide(guide g1, guide g2) { if (strcmp(g1.name, g2.name) < 0) return true; else if (strcmp(g1.name, g2.name) == 0) return (g1.point > g2.point); else return false; } int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; guide rest[110]; for (int i = 0; i < N; i++) { char tmp[15]; int p; cin >> tmp >> p; strcpy(rest[i].name, tmp); rest[i].point = p; rest[i].idx = i + 1; } int n = sizeof(rest) / sizeof(rest[0]); sort(rest, rest + n, compareguide); for (int i = 0; i < N; i++) { /* cout << "rest name : " << rest[i].name; cout << " point : " << rest[i].point;*/ cout << rest[i].idx << endl; } return 0; }
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <string.h> using namespace std; struct guide { char name[15]; int point; int idx; }; bool compareguide(guide g1, guide g2) { if (strcmp(g1.name, g2.name) < 0) return true; else if (strcmp(g1.name, g2.name) == 0) return (g1.point > g2.point); else return false; } int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; guide rest[110]; for (int i = 0; i < N; i++) { char tmp[15]; int p; cin >> tmp >> p; strcpy(rest[i].name, tmp); rest[i].point = p; rest[i].idx = i + 1; } int n = sizeof(rest) / sizeof(rest[0]); sort(rest, rest + N, compareguide); for (int i = 0; i < N; i++) { /* cout << "rest name : " << rest[i].name; cout << " point : " << rest[i].point;*/ cout << rest[i].idx << endl; } return 0; }
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
840,590
840,588
u363251947
cpp
p03030
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<string, int> P; int main() { int N; cin >> N; vector<string> S(N); vector<int> T(N), ans(N); vector<P> Q, judge; for (int i = 0; i < N; i++) { cin >> S.at(i) >> T.at(i); Q.push_back(P(S.at(i), T.at(i))); judge.push_back(P(S.at(i), T.at(i))); } sort(S.begin(), S.end()); sort(Q.begin(), Q.end()); string check1; int check2; int k = 0; bool flag = true; for (int i = 0; flag; i++) { flag = false; for (int j = N - 1; j >= i + 1; j--) { if (Q.at(j).first == Q.at(j - 1).first && Q.at(j).second > Q.at(j - 1).second) { swap(Q.at(j), Q.at(j - 1)); flag = true; } } } for (int i = 0; i < N; i++) { check1 = judge.at(i).first; check2 = judge.at(i).second; for (int j = 0; j < N; j++) { if (check1 == Q.at(j).first && check2 == Q.at(j).second) { ans.at(k) = j + 1; k++; } } } for (int i = 0; i < N; i++) { cout << ans.at(i) << endl; } }
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<string, int> P; int main() { int N; cin >> N; vector<string> S(N); vector<int> T(N), ans(N); vector<P> Q, judge; for (int i = 0; i < N; i++) { cin >> S.at(i) >> T.at(i); Q.push_back(P(S.at(i), T.at(i))); judge.push_back(P(S.at(i), T.at(i))); } sort(S.begin(), S.end()); sort(Q.begin(), Q.end()); string check1; int check2; int k = 0; bool flag = true; for (int i = 0; flag; i++) { flag = false; for (int j = N - 1; j >= i + 1; j--) { if (Q.at(j).first == Q.at(j - 1).first && Q.at(j).second > Q.at(j - 1).second) { swap(Q.at(j), Q.at(j - 1)); flag = true; } } } for (int i = 0; i < N; i++) { check1 = judge.at(i).first; check2 = judge.at(i).second; for (int j = 0; j < N; j++) { if (check1 == Q.at(j).first && check2 == Q.at(j).second) { ans.at(j) = i + 1; k++; } } } for (int i = 0; i < N; i++) { cout << ans.at(i) << endl; } }
[ "assignment.variable.change", "identifier.change", "call.arguments.change", "assignment.value.change", "expression.operation.binary.change" ]
840,596
840,597
u822169805
cpp
p03030
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <string> #include <typeinfo> #include <vector> typedef long long int ll; using namespace std; int main() { int N; cin >> N; string S[N]; int P[N]; int n[N]; for (int i = 0; i < N; i++) { n[i] = i; } for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; } string buf; int b; for (int t = 0; t < N; t++) { for (int i = 0; i < N - 1; i++) { if (S[i] > S[i + 1]) { buf = S[i]; S[i] = S[i + 1]; S[i + i] = buf; b = n[i]; n[i] = n[i + 1]; n[i + 1] = b; b = P[i]; P[i] = P[i + 1]; P[i + 1] = b; } } } for (int t = 0; t < N; t++) { for (int i = 0; i < N - 1; i++) { if (S[i] == S[i + 1] && P[i] < P[i + 1]) { buf = S[i]; S[i] = S[i + 1]; S[i + i] = buf; b = n[i]; n[i] = n[i + 1]; n[i + 1] = b; b = P[i]; P[i] = P[i + 1]; P[i + 1] = b; } } } for (int i = 0; i < N; i++) { cout << n[i] << endl; } return 0; }
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <string> #include <typeinfo> #include <vector> typedef long long int ll; using namespace std; int main() { int N; cin >> N; string S[N]; int P[N]; int n[N]; for (int i = 0; i < N; i++) { n[i] = i + 1; } for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; } string buf; int b; for (int t = 0; t < N; t++) { for (int i = 0; i < N - 1; i++) { if (S[i] > S[i + 1]) { buf = S[i]; S[i] = S[i + 1]; S[i + 1] = buf; b = n[i]; n[i] = n[i + 1]; n[i + 1] = b; b = P[i]; P[i] = P[i + 1]; P[i + 1] = b; } } } for (int t = 0; t < N; t++) { for (int i = 0; i < N - 1; i++) { if (S[i] == S[i + 1] && P[i] < P[i + 1]) { buf = S[i]; S[i] = S[i + 1]; S[i + 1] = buf; b = n[i]; n[i] = n[i + 1]; n[i + 1] = b; b = P[i]; P[i] = P[i + 1]; P[i + 1] = b; } } } for (int i = 0; i < N; i++) { cout << n[i] << endl; } return 0; }
[ "assignment.change", "assignment.variable.change", "identifier.replace.remove", "literal.replace.add", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
840,608
840,609
u532154568
cpp
p03030
#include <bits/stdc++.h> #define ll long long #define se second #define vl vector<ll> #define pb push_back #define pi pair<int, int> #define mp make_pair #define rep(i, a, b) for (ll i = a; i < b; i++) #define per(i, a, b) for (int i = b - 1; i >= a; i--) #define YES(i) cout << (i ? "YES" : "NO") << endl #define Yes(i) cout << (i ? "Yes" : "No") << endl #define SORT(v) sort((v).begin(), (v).end(), compare_by_b) #define RSORT(v) sort((v).rbegin(), (v).rend()) using namespace std; vector<pair<string, ll>> pairs; vector<pair<string, ll>> pairs2; ll n; bool compare_by_b(pair<string, ll> a, pair<string, ll> b) { if (a.first != b.first) { return a.first < b.first; } else { return b.second < a.second; } } int main() { cin >> n; rep(i, 0, n) { string s; ll point; cin >> s >> point; pairs.pb(mp(s, point)); pairs2.pb(mp(s, point)); } SORT(pairs); for (auto &i : pairs2) { for (ll j = 0; j < n; j++) { if (i.first == pairs.at(j).first && i.second == pairs.at(j).second) { cout << j + 1 << endl; } } } };
#include <bits/stdc++.h> #define ll long long #define se second #define vl vector<ll> #define pb push_back #define pi pair<int, int> #define mp make_pair #define rep(i, a, b) for (ll i = a; i < b; i++) #define per(i, a, b) for (int i = b - 1; i >= a; i--) #define YES(i) cout << (i ? "YES" : "NO") << endl #define Yes(i) cout << (i ? "Yes" : "No") << endl #define SORT(v) sort((v).begin(), (v).end(), compare_by_b) #define RSORT(v) sort((v).rbegin(), (v).rend()) using namespace std; vector<pair<string, ll>> pairs; vector<pair<string, ll>> pairs2; ll n; bool compare_by_b(pair<string, ll> a, pair<string, ll> b) { if (a.first != b.first) { return a.first < b.first; } else { return b.second < a.second; } } int main() { cin >> n; rep(i, 0, n) { string s; ll point; cin >> s >> point; pairs.pb(mp(s, point)); pairs2.pb(mp(s, point)); } SORT(pairs); for (auto &i : pairs) { for (ll j = 0; j < n; j++) { if (i.first == pairs2.at(j).first && i.second == pairs2.at(j).second) { cout << j + 1 << endl; } } } };
[ "identifier.change", "control_flow.branch.if.condition.change" ]
840,610
840,611
u782733831
cpp
p03030
#include "algorithm" #include "bitset" #include "cassert" #include "climits" #include "cmath" #include "cstdio" #include "functional" #include "iomanip" #include "iostream" #include "list" #include "map" #include "numeric" #include "queue" #include "random" #include "set" #include "stack" #include "string" #include "unordered_map" #include "unordered_set" using namespace std; const long long int MOD = 1000000007; // const int MOD = 1000000007; // const int MOD = 998244353; // const long long int MOD = 998244353; long long int N, M, K, H, W, L, R; // int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; vector<pair<string, pair<int, int>>> s(N); for (int i = 0; i < N; i++) { cin >> s[i].first >> s[i].second.first; s[i].second.first *= -1; s[i].second.first = i + 1; } sort(s.begin(), s.end()); for (auto i : s) cout << i.second.second << endl; }
#include "algorithm" #include "bitset" #include "cassert" #include "climits" #include "cmath" #include "cstdio" #include "functional" #include "iomanip" #include "iostream" #include "list" #include "map" #include "numeric" #include "queue" #include "random" #include "set" #include "stack" #include "string" #include "unordered_map" #include "unordered_set" using namespace std; const long long int MOD = 1000000007; // const int MOD = 1000000007; // const int MOD = 998244353; // const long long int MOD = 998244353; long long int N, M, K, H, W, L, R; // int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; vector<pair<string, pair<int, int>>> s(N); for (int i = 0; i < N; i++) { cin >> s[i].first >> s[i].second.first; s[i].second.first *= -1; s[i].second.second = i + 1; } sort(s.begin(), s.end()); for (auto i : s) cout << i.second.second << endl; }
[ "assignment.variable.change" ]
840,612
840,613
u468700753
cpp
p03030
#include "algorithm" #include "bitset" #include "cassert" #include "climits" #include "cmath" #include "cstdio" #include "functional" #include "iomanip" #include "iostream" #include "list" #include "map" #include "numeric" #include "queue" #include "random" #include "set" #include "stack" #include "string" #include "unordered_map" #include "unordered_set" using namespace std; const long long int MOD = 1000000007; // const int MOD = 1000000007; // const int MOD = 998244353; // const long long int MOD = 998244353; long long int N, M, K, H, W, L, R; // int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; vector<pair<string, pair<int, int>>> s(N); for (int i = 0; i < N; i++) { cin >> s[i].first >> s[i].second.first; s[i].second.first *= -1; s[i].second.first = i; } sort(s.begin(), s.end()); for (auto i : s) cout << i.second.second << endl; }
#include "algorithm" #include "bitset" #include "cassert" #include "climits" #include "cmath" #include "cstdio" #include "functional" #include "iomanip" #include "iostream" #include "list" #include "map" #include "numeric" #include "queue" #include "random" #include "set" #include "stack" #include "string" #include "unordered_map" #include "unordered_set" using namespace std; const long long int MOD = 1000000007; // const int MOD = 1000000007; // const int MOD = 998244353; // const long long int MOD = 998244353; long long int N, M, K, H, W, L, R; // int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; vector<pair<string, pair<int, int>>> s(N); for (int i = 0; i < N; i++) { cin >> s[i].first >> s[i].second.first; s[i].second.first *= -1; s[i].second.second = i + 1; } sort(s.begin(), s.end()); for (auto i : s) cout << i.second.second << endl; }
[ "assignment.variable.change", "assignment.change" ]
840,614
840,613
u468700753
cpp
p03030
#include <bits/stdc++.h> #define REP(i, N) for (int i = 0; i < (N); ++i) #define ALL(x) (x).begin(), (x).end() #define MOD 1000000007 #define PB push_back #define MP make_pair using namespace std; typedef long long ll; ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll div_ceil(ll, ll); int dx[4] = {0, 0, -1, 1}; int dy[4] = {-1, 1, 0, 0}; int main() { int N; std::cin >> N; vector<tuple<string, int, int>> v(N); REP(i, N) { string s; int a; std::cin >> s >> a; v[i] = make_tuple(s, a, i + 1); } sort(ALL(v), [](const auto &x, const auto &y) { return get<0>(x) < get<0>(y); }); string id = get<0>(v[0]); int index = 0; for (int i = 1; i < N; i++) { if (id != get<0>(v[i])) { sort(v.begin() + index, v.begin() + i + 1, [](const auto &x, const auto &y) { return get<1>(x) > get<1>(y); }); id = get<0>(v[i]); index = i; } if (i == N - 1) { sort(v.begin() + index, v.end(), [](const auto &x, const auto &y) { return get<1>(x) > get<1>(y); }); } } // REP(i, N) { // std::cout << get<0>(v[i]) << ' ' << get<1>(v[i]) << ' ' << get<2>(v[i]) // << '\n'; // } REP(i, N) { std::cout << get<2>(v[i]) << '\n'; } } ll div_ceil(ll a, ll b) { ll quotient = a / b; ll remainder = a % b; if (remainder == 0) { return quotient; } else { return quotient + 1; } }
#include <bits/stdc++.h> #define REP(i, N) for (int i = 0; i < (N); ++i) #define ALL(x) (x).begin(), (x).end() #define MOD 1000000007 #define PB push_back #define MP make_pair using namespace std; typedef long long ll; ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll div_ceil(ll, ll); int dx[4] = {0, 0, -1, 1}; int dy[4] = {-1, 1, 0, 0}; int main() { int N; std::cin >> N; vector<tuple<string, int, int>> v(N); REP(i, N) { string s; int a; std::cin >> s >> a; v[i] = make_tuple(s, a, i + 1); } sort(ALL(v), [](const auto &x, const auto &y) { return get<0>(x) < get<0>(y); }); string id = get<0>(v[0]); int index = 0; for (int i = 1; i < N; i++) { if (id != get<0>(v[i])) { sort(v.begin() + index, v.begin() + i, [](const auto &x, const auto &y) { return get<1>(x) > get<1>(y); }); id = get<0>(v[i]); index = i; } if (i == N - 1) { sort(v.begin() + index, v.end(), [](const auto &x, const auto &y) { return get<1>(x) > get<1>(y); }); } } // REP(i, N) { // std::cout << get<0>(v[i]) << ' ' << get<1>(v[i]) << ' ' << get<2>(v[i]) // << '\n'; // } REP(i, N) { std::cout << get<2>(v[i]) << '\n'; } } ll div_ceil(ll a, ll b) { ll quotient = a / b; ll remainder = a % b; if (remainder == 0) { return quotient; } else { return quotient + 1; } }
[ "expression.operation.binary.remove" ]
840,623
840,624
u408053343
cpp
p03030
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; string S[N]; int P[N]; for (int i = 0; i < N; i++) cin >> S[i] >> P[i]; int swaped[N]; for (int i = 0; i < N; i++) swaped[i] = 0; for (int i = 0; i < N - 1; i++) { for (int j = 1; j < N; j++) { if ((S[i] == S[j] && P[i] < P[j]) || (S[i] > S[j])) { swaped[i]++; } } } int cnt = 0; for (int j = 0; j < N; j++) { for (int i = 0; i < N; i++) { if (swaped[i] == cnt) { cout << i + 1 << endl; } } cnt++; } return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; string S[N]; int P[N]; for (int i = 0; i < N; i++) cin >> S[i] >> P[i]; int swaped[N]; for (int i = 0; i < N; i++) swaped[i] = 0; for (int i = 0; i < N; i++) { for (int j = 1; j < N; j++) { if ((S[i] == S[j] && P[i] < P[j]) || (S[i] > S[j])) { swaped[i]++; } } } int cnt = 0; for (int j = 0; j < N; j++) { for (int i = 0; i < N; i++) { if (swaped[i] == cnt) { cout << i + 1 << endl; } } cnt++; } return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
840,629
840,630
u911222357
cpp
p03030
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rept(i, a, b) for (int i = a; i < b; i++) #define ll long long #define MOD 1000000007 #define IMIN INT_MIN; #define IMAX INT_MAX; bool sort1(const pair<int, pair<int, int>> a, const pair<int, pair<int, int>> b) { if (a.second.first == b.second.first) return a.second.second > b.second.second; else return a.second.first < b.second.first; } int main() { int N; cin >> N; vector<pair<int, pair<ll, int>>> S(N); string s; int p; ll tmp; ll base; rep(i, N) { tmp = 0; cin >> s >> p; base = pow(26, 10); rep(i, s.size()) { tmp += base * (ll)(s[i] - 'a'); base /= 26; } auto pa = make_pair(tmp, p); S[i].first = i + 1; S[i].second = pa; } sort(S.begin(), S.end(), sort1); rep(i, N) cout << S[i].first << endl; return 0; }
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rept(i, a, b) for (int i = a; i < b; i++) #define ll long long #define MOD 1000000007 #define IMIN INT_MIN; #define IMAX INT_MAX; bool sort1(const pair<int, pair<ll, int>> a, const pair<int, pair<ll, int>> b) { if (a.second.first == b.second.first) return a.second.second > b.second.second; else return a.second.first < b.second.first; } int main() { int N; cin >> N; vector<pair<int, pair<ll, int>>> S(N); string s; int p; ll tmp; ll base; rep(i, N) { tmp = 0; cin >> s >> p; base = pow(26, 10); rep(i, s.size()) { tmp += base * (ll)(s[i] - 'a'); base /= 26; } auto pa = make_pair(tmp, p); S[i].first = i + 1; S[i].second = pa; } sort(S.begin(), S.end(), sort1); rep(i, N) cout << S[i].first << endl; return 0; }
[]
840,633
840,634
u569041543
cpp
p03030
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N; cin >> N; map<std::string, vector<pair<int, int>>> sp; for (int i = 0; i < N; i++) { string s; int p; cin >> s >> p; sp[s].push_back({i + 1, p}); } for (auto &v : sp) { sort(v.second.begin(), v.second.end(), [](auto l, auto r) { return l.second > r.second; }); } for (auto &v : sp) { for (auto p : v.second) cout << p.second << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N; cin >> N; map<std::string, vector<pair<int, int>>> sp; for (int i = 0; i < N; i++) { string s; int p; cin >> s >> p; sp[s].push_back({i + 1, p}); } for (auto &v : sp) { sort(v.second.begin(), v.second.end(), [](auto l, auto r) { return l.second > r.second; }); } for (auto &v : sp) { for (auto p : v.second) cout << p.first << endl; } return 0; }
[ "io.output.change" ]
840,637
840,638
u500092662
cpp
p03031
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; #define chmax(x, y) x = max(x, y); #define chmin(x, y) x = min(x, y); const int di[] = {-1, 0, 1, 0}; const int dj[] = {0, -1, 0, 1}; const int INF = 1001001001; int main() { int n, m; cin >> n >> m; vector<vector<int>> s(m); rep(i, m) { int k; cin >> k; rep(j, k) { int a; cin >> a; s[i].push_back(a); } } vector<int> p(m); rep(i, m) cin >> p[i]; int ans = 0; rep(is, 1 << n) { bool ok = true; rep(i, m) { int cnt = 0; for (int x : s[i]) { if (is >> x & 1) cnt++; } cnt %= 2; if (cnt != p[i]) ok = false; } if (ok) ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; #define chmax(x, y) x = max(x, y); #define chmin(x, y) x = min(x, y); const int di[] = {-1, 0, 1, 0}; const int dj[] = {0, -1, 0, 1}; const int INF = 1001001001; int main() { int n, m; cin >> n >> m; vector<vector<int>> s(m); rep(i, m) { int k; cin >> k; rep(j, k) { int a; cin >> a; a--; s[i].push_back(a); } } vector<int> p(m); rep(i, m) cin >> p[i]; int ans = 0; rep(is, 1 << n) { bool ok = true; rep(i, m) { int cnt = 0; for (int x : s[i]) { if (is >> x & 1) cnt++; } cnt %= 2; if (cnt != p[i]) ok = false; } if (ok) ans++; } cout << ans << endl; return 0; }
[ "expression.unary.arithmetic.add" ]
840,677
840,678
u005006157
cpp
p03031
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; #define chmax(x, y) x = max(x, y); #define chmin(x, y) x = min(x, y); const int di[] = {-1, 0, 1, 0}; const int dj[] = {0, -1, 0, 1}; const int INF = 1001001001; int main() { int n, m; cin >> n >> m; vector<vector<int>> s(m); rep(i, m) { int k; cin >> k; rep(j, k) { int a; cin >> a; s[i].push_back(a); } } vector<int> p(m); rep(i, m) cin >> p[i]; int ans = 0; rep(is, 1 << n) { bool ok = true; rep(i, m) { int cnt = 0; for (int x : s[i]) { if (is >> x & 1) cnt++; } cnt /= 2; if (cnt != p[i]) ok = false; } if (ok) ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; #define chmax(x, y) x = max(x, y); #define chmin(x, y) x = min(x, y); const int di[] = {-1, 0, 1, 0}; const int dj[] = {0, -1, 0, 1}; const int INF = 1001001001; int main() { int n, m; cin >> n >> m; vector<vector<int>> s(m); rep(i, m) { int k; cin >> k; rep(j, k) { int a; cin >> a; a--; s[i].push_back(a); } } vector<int> p(m); rep(i, m) cin >> p[i]; int ans = 0; rep(is, 1 << n) { bool ok = true; rep(i, m) { int cnt = 0; for (int x : s[i]) { if (is >> x & 1) cnt++; } cnt %= 2; if (cnt != p[i]) ok = false; } if (ok) ans++; } cout << ans << endl; return 0; }
[ "expression.unary.arithmetic.add", "expression.operator.change" ]
840,679
840,678
u005006157
cpp
p03031
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define all(x) (x).begin(), (x).end() #define PI 3.14159265358979323846264338327950L using namespace std; typedef long long ll; typedef long double ld; int main() { int n, m; cin >> n >> m; int k[m], s[m][20]; rep(i, m) { cin >> k[i]; rep(j, k[i]) { cin >> s[i][j]; s[i][j]--; } } int p[m]; rep(i, m) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int a = 0; rep(i, m) { int cnt = 0; rep(j, k[i]) if (bit & (1 << s[i][j])) cnt++; if (cnt % 2 == k[i]) a++; } if (a == m) ans++; } cout << ans; }
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define all(x) (x).begin(), (x).end() #define PI 3.14159265358979323846264338327950L using namespace std; typedef long long ll; typedef long double ld; int main() { int n, m; cin >> n >> m; int k[m], s[m][20]; rep(i, m) { cin >> k[i]; rep(j, k[i]) { cin >> s[i][j]; s[i][j]--; } } int p[m]; rep(i, m) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int a = 0; rep(i, m) { int cnt = 0; rep(j, k[i]) if (bit & (1 << s[i][j])) cnt++; if (cnt % 2 == p[i]) a++; } if (a == m) ans++; } cout << ans; }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
840,691
840,692
u151236434
cpp
p03031
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 == 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[m], s[m][20], p[m]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 != 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
[ "identifier.replace.add", "literal.replace.remove", "variable_declaration.array_dimensions.change", "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
840,693
840,694
u056912761
cpp
p03031
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 == 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 != 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
840,693
840,695
u056912761
cpp
p03031
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < m; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 == 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 != 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.change", "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
840,696
840,695
u056912761
cpp
p03031
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < m; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 0 && (cnt % 2 == 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 != 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.change", "literal.number.change", "control_flow.branch.if.condition.change", "misc.opposites", "expression.operator.compare.change" ]
840,697
840,695
u056912761
cpp
p03031
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < n; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 != 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int k[20], s[20][20], p[20]; for (int i = 0; i < m; i++) { cin >> k[i]; for (int j = 0; j < k[i]; j++) { cin >> s[i][j]; } } for (int i = 0; i < m; i++) cin >> p[i]; int ans = 0; for (int bit = 0; bit < (1 << n); bit++) { int light = 0; for (int i = 0; i < m; i++) { int cnt = 0; for (int j = 0; j < k[i]; j++) { if (bit & (1 << s[i][j] - 1)) cnt++; } if (p[i] == 0 && (cnt % 2 == 0)) light++; if (p[i] == 1 && (cnt % 2 != 0)) light++; } if (light == m) ans++; } cout << ans << endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
840,698
840,699
u056912761
cpp
p03031
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator> //集合演算(積集合,和集合,差集合など) #include <map> //map(辞書) #include <numeric> //iota(整数列の生成),gcdとlcm(c++17) #include <queue> //キュー #include <set> //集合 #include <stack> //スタック #include <string> //文字列 //#include<unordered_map>//イテレータあるけど順序保持しないmap //#include<unordered_set>//イテレータあるけど順序保持しないset #include <utility> //pair #include <valarray> //なんとなく追加 #include <vector> //可変長配列 //メモ:表示桁数を大きくする  cout << fixed << setprecision(20) << cm << endl; using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) // xにはvectorなどのコンテナ #define ALL(x) (x).begin(), (x).end() // sortなどの引数を省略したい #define SIZE(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく #define MAX(x) *max_element(ALL(x)) //最大値を求める #define MIN(x) *min_element(ALL(x)) //最小値を求める //定数 #define INF 1000000000000 // 10^12:極めて大きい値,∞ #define MOD 1000000007 // 10^9+7:合同式の法 #define MAXR 100000 // 10^5:配列の最大のrange(素数列挙などで使用) //略記 #define PB push_back // vectorヘの挿入 #define MP make_pair // pairのコンストラクタ #define F first // pairの一つ目の要素 #define S second // pairの二つ目の要素 #define PI acos(-1.0) #define answer(ans) cout << ans << endl; #define input(N) cin >> N; bool setcontain(set<int> const &X, int const x) { std::set<int>::iterator itr = X.begin(); for (int i = 0; i < X.size(); i++) { if ((*itr) == x) { return 1; } itr++; } return 0; } signed main() { ll N, M; cin >> N >> M; vector<set<int>> ks(M); vector<int> p(M); int tmp = 0, in, ans = 0; for (int i = 0; i < M; i++) { cin >> tmp; for (int j = 0; j < tmp; j++) { cin >> in; ks.at(i).insert(in); } } REP(i, M) { cin >> p[i]; } int count; bool frag = true; for (int bit = 0; bit < (1 << N); bit++) { frag = true; for (int i = 0; i < M; i++) { count = 0; for (int bits = 0; bits < N; bits++) { if (bit & (1 << bits)) { if (setcontain(ks.at(i), bits + 1)) { count++; } } } if (count % 2 == p[i]) { frag = false; } } if (frag) { ans++; } } answer(ans); return 0; }
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator> //集合演算(積集合,和集合,差集合など) #include <map> //map(辞書) #include <numeric> //iota(整数列の生成),gcdとlcm(c++17) #include <queue> //キュー #include <set> //集合 #include <stack> //スタック #include <string> //文字列 //#include<unordered_map>//イテレータあるけど順序保持しないmap //#include<unordered_set>//イテレータあるけど順序保持しないset #include <utility> //pair #include <valarray> //なんとなく追加 #include <vector> //可変長配列 //メモ:表示桁数を大きくする  cout << fixed << setprecision(20) << cm << endl; using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) // xにはvectorなどのコンテナ #define ALL(x) (x).begin(), (x).end() // sortなどの引数を省略したい #define SIZE(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく #define MAX(x) *max_element(ALL(x)) //最大値を求める #define MIN(x) *min_element(ALL(x)) //最小値を求める //定数 #define INF 1000000000000 // 10^12:極めて大きい値,∞ #define MOD 1000000007 // 10^9+7:合同式の法 #define MAXR 100000 // 10^5:配列の最大のrange(素数列挙などで使用) //略記 #define PB push_back // vectorヘの挿入 #define MP make_pair // pairのコンストラクタ #define F first // pairの一つ目の要素 #define S second // pairの二つ目の要素 #define PI acos(-1.0) #define answer(ans) cout << ans << endl; #define input(N) cin >> N; bool setcontain(set<int> const &X, int const x) { std::set<int>::iterator itr = X.begin(); for (int i = 0; i < X.size(); i++) { if ((*itr) == x) { return 1; } itr++; } return 0; } signed main() { ll N, M; cin >> N >> M; vector<set<int>> ks(M); vector<int> p(M); int tmp = 0, in, ans = 0; for (int i = 0; i < M; i++) { cin >> tmp; for (int j = 0; j < tmp; j++) { cin >> in; ks.at(i).insert(in); } } REP(i, M) { cin >> p[i]; } int count; bool frag = true; for (int bit = 0; bit < (1 << N); bit++) { frag = true; for (int i = 0; i < M; i++) { count = 0; for (int bits = 0; bits < N; bits++) { if (bit & (1 << bits)) { if (setcontain(ks.at(i), bits + 1)) { count++; } } } if (count % 2 != p[i]) { frag = false; } } if (frag) { ans++; } } answer(ans); return 0; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
840,704
840,705
u182012703
cpp
p03031
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator> //集合演算(積集合,和集合,差集合など) #include <map> //map(辞書) #include <numeric> //iota(整数列の生成),gcdとlcm(c++17) #include <queue> //キュー #include <set> //集合 #include <stack> //スタック #include <string> //文字列 //#include<unordered_map>//イテレータあるけど順序保持しないmap //#include<unordered_set>//イテレータあるけど順序保持しないset #include <utility> //pair #include <valarray> //なんとなく追加 #include <vector> //可変長配列 //メモ:表示桁数を大きくする  cout << fixed << setprecision(20) << cm << endl; using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) // xにはvectorなどのコンテナ #define ALL(x) (x).begin(), (x).end() // sortなどの引数を省略したい #define SIZE(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく #define MAX(x) *max_element(ALL(x)) //最大値を求める #define MIN(x) *min_element(ALL(x)) //最小値を求める //定数 #define INF 1000000000000 // 10^12:極めて大きい値,∞ #define MOD 1000000007 // 10^9+7:合同式の法 #define MAXR 100000 // 10^5:配列の最大のrange(素数列挙などで使用) //略記 #define PB push_back // vectorヘの挿入 #define MP make_pair // pairのコンストラクタ #define F first // pairの一つ目の要素 #define S second // pairの二つ目の要素 #define PI acos(-1.0) #define answer(ans) cout << ans << endl; #define input(N) cin >> N; bool setcontain(set<int> const &X, int const x) { std::set<int>::iterator itr = X.begin(); for (int i = 0; i < X.size(); i++) { if ((*itr) == x) { return 1; } itr++; } return 0; } signed main() { ll N, M; cin >> N >> M; vector<set<int>> ks(M); vector<int> p(M); int tmp = 0, in, ans = 0; for (int i = 0; i < M; i++) { cin >> tmp; for (int j = 0; j < tmp; j++) { cin >> in; ks.at(i).insert(in); } } REP(i, M) { cin >> p[i]; } int count; bool frag = true; for (int bit = 0; bit < (1 << N); bit++) { frag = true; for (int i = 0; i < M; i++) { count = 0; for (int bits = 0; bits < N; bits++) { if (bit & (1 << bits)) { if (setcontain(ks.at(i), bits + 1)) { count++; } } } if (count % 2 == p[i]) { frag = false; } } if (frag) { ans++; answer(bit); } } answer(ans); return 0; }
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator> //集合演算(積集合,和集合,差集合など) #include <map> //map(辞書) #include <numeric> //iota(整数列の生成),gcdとlcm(c++17) #include <queue> //キュー #include <set> //集合 #include <stack> //スタック #include <string> //文字列 //#include<unordered_map>//イテレータあるけど順序保持しないmap //#include<unordered_set>//イテレータあるけど順序保持しないset #include <utility> //pair #include <valarray> //なんとなく追加 #include <vector> //可変長配列 //メモ:表示桁数を大きくする  cout << fixed << setprecision(20) << cm << endl; using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) // xにはvectorなどのコンテナ #define ALL(x) (x).begin(), (x).end() // sortなどの引数を省略したい #define SIZE(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく #define MAX(x) *max_element(ALL(x)) //最大値を求める #define MIN(x) *min_element(ALL(x)) //最小値を求める //定数 #define INF 1000000000000 // 10^12:極めて大きい値,∞ #define MOD 1000000007 // 10^9+7:合同式の法 #define MAXR 100000 // 10^5:配列の最大のrange(素数列挙などで使用) //略記 #define PB push_back // vectorヘの挿入 #define MP make_pair // pairのコンストラクタ #define F first // pairの一つ目の要素 #define S second // pairの二つ目の要素 #define PI acos(-1.0) #define answer(ans) cout << ans << endl; #define input(N) cin >> N; bool setcontain(set<int> const &X, int const x) { std::set<int>::iterator itr = X.begin(); for (int i = 0; i < X.size(); i++) { if ((*itr) == x) { return 1; } itr++; } return 0; } signed main() { ll N, M; cin >> N >> M; vector<set<int>> ks(M); vector<int> p(M); int tmp = 0, in, ans = 0; for (int i = 0; i < M; i++) { cin >> tmp; for (int j = 0; j < tmp; j++) { cin >> in; ks.at(i).insert(in); } } REP(i, M) { cin >> p[i]; } int count; bool frag = true; for (int bit = 0; bit < (1 << N); bit++) { frag = true; for (int i = 0; i < M; i++) { count = 0; for (int bits = 0; bits < N; bits++) { if (bit & (1 << bits)) { if (setcontain(ks.at(i), bits + 1)) { count++; } } } if (count % 2 != p[i]) { frag = false; } } if (frag) { ans++; } } answer(ans); return 0; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "call.remove" ]
840,706
840,705
u182012703
cpp
p03031
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, s, n) for (int i = (s); i < (n); ++i) #define ll long long #define ld long double #define P pair<ll, ll> #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1.0); int main(void) { ll n, m; cin >> n >> m; vector<vector<ll>> s; rep(i, m) { ll k; cin >> k; rep(j, k) { ll a; cin >> a; a--; s[i].push_back(a); } } vector<ll> p(m); rep(i, m) cin >> p[i]; ll ans = 0; for (int bit = 0; bit < (1 << n); bit++) { bool ok = true; rep(i, m) { ll cnt = 0; for (auto on : s[i]) { if (bit & (1 << on)) cnt++; } if (cnt % 2 != p[i]) ok = false; } if (ok) ++ans; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, s, n) for (int i = (s); i < (n); ++i) #define ll long long #define ld long double #define P pair<ll, ll> #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1.0); int main(void) { ll n, m; cin >> n >> m; vector<vector<ll>> s(m); rep(i, m) { ll k; cin >> k; rep(j, k) { ll a; cin >> a; a--; s[i].push_back(a); } } vector<ll> p(m); rep(i, m) cin >> p[i]; ll ans = 0; for (int bit = 0; bit < (1 << n); bit++) { bool ok = true; rep(i, m) { ll cnt = 0; for (auto on : s[i]) { if (bit & (1 << on)) cnt++; } if (cnt % 2 != p[i]) ok = false; } if (ok) ++ans; } cout << ans << endl; return 0; }
[]
840,707
840,708
u025469035
cpp
p03031
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, s, n) for (int i = (s); i < (n); ++i) #define ll long long #define ld long double #define P pair<ll, ll> #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1.0); int main(void) { ll n, m; cin >> n >> m; vector<vector<ll>> s; rep(i, m) { ll k; cin >> k; rep(j, k) { ll a; cin >> a; a--; s[i].push_back(a); } } vector<ll> p(m); rep(i, m) cin >> p[i]; ll ans = 0; for (int bit = 0; bit < (1 << n); bit++) { bool ok = true; rep(i, m) { ll cnt = 0; for (auto on : s[i]) { if (1 & (1 << on)) cnt++; } if (cnt % 2 != p[i]) ok = false; } if (ok) ++ans; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, s, n) for (int i = (s); i < (n); ++i) #define ll long long #define ld long double #define P pair<ll, ll> #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1.0); int main(void) { ll n, m; cin >> n >> m; vector<vector<ll>> s(m); rep(i, m) { ll k; cin >> k; rep(j, k) { ll a; cin >> a; a--; s[i].push_back(a); } } vector<ll> p(m); rep(i, m) cin >> p[i]; ll ans = 0; for (int bit = 0; bit < (1 << n); bit++) { bool ok = true; rep(i, m) { ll cnt = 0; for (auto on : s[i]) { if (bit & (1 << on)) cnt++; } if (cnt % 2 != p[i]) ok = false; } if (ok) ++ans; } cout << ans << endl; return 0; }
[ "identifier.replace.add", "literal.replace.remove", "control_flow.branch.if.condition.change" ]
840,709
840,708
u025469035
cpp
p03031
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef pair<int, int> P; const int inf = 1012345678; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; int N, M; bool sw[12]; int c[12][12]; int p[12]; int k[12]; int main() { cin >> N >> M; rep(i, M) { cin >> k[i]; rep(j, k[i]) { cin >> c[i][j]; } } rep(i, M) { cin >> p[i]; } int ans = 0; for (int bit = 0; bit < (1 << N); bit++) { bool f = true; rep(i, N) { sw[i] = false; } rep(i, N) { if (bit & 1 << i) sw[i] = true; } rep(i, M) { int num = 0; rep(j, k[i]) { if (sw[c[i][j]] - 1) num++; } if (num % 2 != p[i]) f = false; } if (f) ans++; } cout << ans << endl; }
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef pair<int, int> P; const int inf = 1012345678; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; int N, M; bool sw[12]; int c[12][12]; int p[12]; int k[12]; int main() { cin >> N >> M; rep(i, M) { cin >> k[i]; rep(j, k[i]) { cin >> c[i][j]; } } rep(i, M) { cin >> p[i]; } int ans = 0; for (int bit = 0; bit < (1 << N); bit++) { bool f = true; rep(i, N) { sw[i] = false; } rep(i, N) { if (bit & 1 << i) sw[i] = true; } rep(i, M) { int num = 0; rep(j, k[i]) { if (sw[c[i][j] - 1]) num++; } if (num % 2 != p[i]) f = false; } if (f) ans++; } cout << ans << endl; }
[ "control_flow.branch.if.condition.change" ]
840,710
840,711
u950174376
cpp
p03031
#include <bits/stdc++.h> #define loop(s, e, i) for (int i = s; i < e; ++i) #define print(s) cout << s << endl; using namespace std; using ll = long long; int P[100]; int main() { int N, M; cin >> N >> M; vector<vector<ll>> S(N); loop(0, M, i) { ll k; cin >> k; loop(0, k, j) { ll s; cin >> s; s--; S[s].emplace_back(k - 1); } } loop(0, M, i) { cin >> P[i]; } ll count = 0; for (int bit = 0; bit < (1 << N); bit++) { vector<ll> KON(M, 0); loop(0, N, i) { if (bit & (1 << i)) { for (auto si : S[i]) { KON[si]++; } } } bool allon = true; loop(0, M, i) { if (KON[i] % 2 != P[i]) { allon = false; break; } } if (allon) { count++; } } print(count); }
#include <bits/stdc++.h> #define loop(s, e, i) for (int i = s; i < e; ++i) #define print(s) cout << s << endl; using namespace std; using ll = long long; int P[100]; int main() { int N, M; cin >> N >> M; vector<vector<ll>> S(N); loop(0, M, i) { ll k; cin >> k; loop(0, k, j) { ll s; cin >> s; s--; S[s].emplace_back(i); } } loop(0, M, i) { cin >> P[i]; } ll count = 0; for (int bit = 0; bit < (1 << N); bit++) { vector<ll> KON(M, 0); loop(0, N, i) { if (bit & (1 << i)) { for (auto si : S[i]) { KON[si]++; } } } bool allon = true; loop(0, M, i) { if (KON[i] % 2 != P[i]) { allon = false; break; } } if (allon) { count++; } } print(count); }
[ "call.arguments.change", "expression.operation.binary.change", "expression.operation.binary.remove" ]
840,712
840,713
u111653921
cpp
p03031
#include <algorithm> #include <cstdlib> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> int main() { int n, m; cin >> n >> m; vector<int> s[m]; rep(i, m) { int k; cin >> k; rep(j, k) { int s_; cin >> s_; s_--; s[i].push_back(s_); } } int p[m]; rep(i, m) cin >> p[i]; int ans = 0; for (int i = 0; i < (1 << n); i++) { int swich[m]; for (int j = 0; j < n; j++) { swich[j] = ((i >> j) & 1); } int light = m; int num; for (int j = 0; j < m; j++) { num = 0; for (int l = 0; l < s[j].size(); l++) { if (swich[s[j][l]] == 1) { num++; } } if (num % 2 != p[j]) { light--; break; } } if (light == m) { ans++; } } cout << ans << endl; }
#include <algorithm> #include <cstdlib> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> int main() { int n, m; cin >> n >> m; vector<int> s[m]; rep(i, m) { int k; cin >> k; rep(j, k) { int s_; cin >> s_; s_--; s[i].push_back(s_); } } int p[m]; rep(i, m) cin >> p[i]; int ans = 0; for (int i = 0; i < (1 << n); i++) { int swich[n]; for (int j = 0; j < n; j++) { swich[j] = ((i >> j) & 1); } int light = m; int num; for (int j = 0; j < m; j++) { num = 0; for (int l = 0; l < s[j].size(); l++) { if (swich[s[j][l]] == 1) { num++; } } if (num % 2 != p[j]) { light--; break; } } if (light == m) { ans++; } } cout << ans << endl; }
[ "identifier.change", "variable_declaration.array_dimensions.change" ]
840,725
840,726
u416773418
cpp
p03031
#include <algorithm> #include <cstdlib> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> int main() { int n, m; cin >> n >> m; vector<int> s[m]; rep(i, m) { int k; cin >> k; rep(j, k) { int s_; cin >> s_; s_--; s[i].push_back(s_); } } int p[m]; rep(i, m) cin >> p[i]; int ans = 0; for (int i = 0; i < (1 << n); i++) { int swich[m]; for (int j = 0; j < n; j++) { swich[j] = (i >> j) & 1; } int light = m; int num; for (int j = 0; j < m; j++) { num = 0; for (int l = 0; l < s[j].size(); l++) { if (swich[s[j][l]] == 1) { num++; } } if (num % 2 != p[j]) { light--; break; } } if (light == m) { ans++; } } cout << ans << endl; }
#include <algorithm> #include <cstdlib> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> int main() { int n, m; cin >> n >> m; vector<int> s[m]; rep(i, m) { int k; cin >> k; rep(j, k) { int s_; cin >> s_; s_--; s[i].push_back(s_); } } int p[m]; rep(i, m) cin >> p[i]; int ans = 0; for (int i = 0; i < (1 << n); i++) { int swich[n]; for (int j = 0; j < n; j++) { swich[j] = ((i >> j) & 1); } int light = m; int num; for (int j = 0; j < m; j++) { num = 0; for (int l = 0; l < s[j].size(); l++) { if (swich[s[j][l]] == 1) { num++; } } if (num % 2 != p[j]) { light--; break; } } if (light == m) { ans++; } } cout << ans << endl; }
[ "identifier.change", "variable_declaration.array_dimensions.change" ]
840,727
840,726
u416773418
cpp
p03031
#include <bits/stdc++.h> using namespace std; int n, m; int k[100]; int s[100][100]; int p[100]; int a[100]; int ans; int check() { for (int i = 1; i <= m; i++) { int cnt; for (int j = 1; j <= k[i]; j++) { cnt += a[s[i][j]]; } if (cnt % 2 != p[i]) { return 0; } } return 1; } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &k[i]); for (int j = 1; j <= k[i]; j++) { scanf("%d", &s[i][j]); } } for (int i = 1; i <= m; i++) { scanf("%d", &p[i]); } for (int i = 0; i < pow(2, n); i++) { for (int j = 1; j <= n; j++) { a[j] = (i >> j - 1) & 1; } ans += check(); } printf("%d\n", ans); return 0; }
#include <bits/stdc++.h> using namespace std; int n, m; int k[100]; int s[100][100]; int p[100]; int a[100]; int ans; int check() { for (int i = 1; i <= m; i++) { int cnt = 0; for (int j = 1; j <= k[i]; j++) { cnt += a[s[i][j]]; } if (cnt % 2 != p[i]) { return 0; } } return 1; } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &k[i]); for (int j = 1; j <= k[i]; j++) { scanf("%d", &s[i][j]); } } for (int i = 1; i <= m; i++) { scanf("%d", &p[i]); } for (int i = 0; i < pow(2, n); i++) { for (int j = 1; j <= n; j++) { a[j] = (i >> j - 1) & 1; } ans += check(); } printf("%d\n", ans); return 0; }
[ "variable_declaration.value.change" ]
840,734
840,735
u353919145
cpp
p03031
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef int itn; const ll LINF = 1e18; const int INF = 1e9; //マクロ定義 #define vvint(vec, n, m, l) \ vector<vector<int>> vec(n, vector<int>(m, l)); // lで初期化 #define vvll(vec, n, m, l) vector<vector<ll>> vec(n, vector<ll>(m, l)); #define vint vector<int> #define pint pair<int, int> #define rep(i, a) for (ll i = 0; i < (a); i++) #define all(x) (x).begin(), (x).end() #define debug system("pause") //デバッグ用 #define ret return 0 template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } using Graph = vector<vector<ll>>; #define ketasitei setprecision(15) // 15桁表示 const ll MOD = 1000000007; const double PI = 3.1415926535897932; int main(void) { cin.tie(0); ios::sync_with_stdio(false); // ll n, k; // cin >> n >> k; // vector<ll> a(n); // rep(i, n) //{ // cin >> a[i]; //} // // ll ok = 1000000001; // ll ng = 0; // while (abs(ok - ng) > 1) //{ // ll mid = (ok + ng) / 2; // if (isOK(mid,k,a)) // { // ok = mid; // } // else // { // ng = mid; // } //} // cout << ok << endl; ll n, m; cin >> n >> m; vector<ll> k(m); vector<vector<ll>> s(m, vector<ll>()); vector<ll> p(m); rep(i, m) { cin >> k[i]; rep(j, k[i]) { ll tmp; cin >> tmp; s[i].push_back(tmp); } } rep(i, m) cin >> p[i]; ll ans = 0; ll bits = (1 << n) - 1; //全部0の場合も調べたいのなら条件を変更するか、別途その分だけプログラムを書く while (bits) { bool ok = true; ll tmp = bits; for (int i = 0; i < m; i++) { ll sum = 0; for (int j = 0; j < s[i].size(); j++) { if ((tmp >> (s[i][j] - 1)) & 1) { sum++; } } if (sum % 2 != p[i]) ok = false; } if (ok) ans++; bits--; } cout << ans << endl; return 0; }
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef int itn; const ll LINF = 1e18; const int INF = 1e9; //マクロ定義 #define vvint(vec, n, m, l) \ vector<vector<int>> vec(n, vector<int>(m, l)); // lで初期化 #define vvll(vec, n, m, l) vector<vector<ll>> vec(n, vector<ll>(m, l)); #define vint vector<int> #define pint pair<int, int> #define rep(i, a) for (ll i = 0; i < (a); i++) #define all(x) (x).begin(), (x).end() #define debug system("pause") //デバッグ用 #define ret return 0 template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } using Graph = vector<vector<ll>>; #define ketasitei setprecision(15) // 15桁表示 const ll MOD = 1000000007; const double PI = 3.1415926535897932; int main(void) { cin.tie(0); ios::sync_with_stdio(false); // ll n, k; // cin >> n >> k; // vector<ll> a(n); // rep(i, n) //{ // cin >> a[i]; //} // // ll ok = 1000000001; // ll ng = 0; // while (abs(ok - ng) > 1) //{ // ll mid = (ok + ng) / 2; // if (isOK(mid,k,a)) // { // ok = mid; // } // else // { // ng = mid; // } //} // cout << ok << endl; ll n, m; cin >> n >> m; vector<ll> k(m); vector<vector<ll>> s(m, vector<ll>()); vector<ll> p(m); rep(i, m) { cin >> k[i]; rep(j, k[i]) { ll tmp; cin >> tmp; s[i].push_back(tmp); } } rep(i, m) cin >> p[i]; ll ans = 0; ll bits = (1 << n) - 1; //全部0の場合も調べたいのなら条件を変更するか、別途その分だけプログラムを書く while (bits + 1) { bool ok = true; ll tmp = bits; for (int i = 0; i < m; i++) { ll sum = 0; for (int j = 0; j < s[i].size(); j++) { if ((tmp >> (s[i][j] - 1)) & 1) { sum++; } } if (sum % 2 != p[i]) ok = false; } if (ok) ans++; bits--; } cout << ans << endl; return 0; }
[ "control_flow.loop.condition.change" ]
840,738
840,739
u776194115
cpp
p03031
#include <algorithm> #include <iostream> #include <string> #include <vector> int main() { int N, M; std::cin >> N >> M; std::vector<std::vector<int>> A(M); for (auto i{0}; i < N; ++i) { int k; std::cin >> k; for (auto j{0}; j < k; ++j) { //予め各電球に対して対応するスイッチの組み合わせを2進数変数に変換しておく。 int a; std::cin >> a; --a; A[i].push_back(a); } } std::vector<int> P(M); for (auto &r : P) std::cin >> r; int ans{0}; for (int bit{0}; bit < (1 << N); ++bit) { bool ok = true; for (int i{0}; i < N; ++i) { int con{0}; for (auto &r : A[i]) // onになっているスイッチの組み合わせと1.で用意した電球に対応するスイッチの組み合わせとでAND演算した結果を取る。 if (bit & (1 << r)) ++con; if ((con % 2) != P[i]) ok = false; } if (ok == true) ++ans; } std::cout << ans << std::endl; return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> int main() { int N, M; std::cin >> N >> M; std::vector<std::vector<int>> s(M); for (auto i{0}; i < M; ++i) { int k; std::cin >> k; for (auto j{0}; j < k; ++j) { //予め各電球に対して対応するスイッチの組み合わせを2進数変数に変換しておく。 int a; std::cin >> a; --a; s[i].push_back(a); } } std::vector<int> P(M); for (auto &r : P) std::cin >> r; int ans{0}; for (int bit{0}; bit < (1 << N); ++bit) { bool ok = true; for (int i{0}; i < M; ++i) { int con{0}; for (auto &r : s[i]) // onになっているスイッチの組み合わせと1.で用意した電球に対応するスイッチの組み合わせとでAND演算した結果を取る。 if (bit & (1 << r)) ++con; if ((con % 2) != P[i]) ok = false; } if (ok == true) ++ans; } std::cout << ans << std::endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
840,749
840,750
u917678406
cpp
p03031
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<vector<int>> s; vector<int> p; int N, M; bool judge(int bit) { int cnt = 0; for (int i = 0; i < M; i++) { int state = 0; for (int j = 0; j < s[i].size(); j++) { if (bit & (1 << s[i][j])) state += 1; } if (p[i] == (state % 2)) cnt++; } return cnt == M; } int main() { cin >> N >> M; for (int i = 0; i < M; i++) { int k; cin >> k; vector<int> s_tmp; for (int j = 0; j < k; j++) { int tmp; cin >> tmp; s_tmp.push_back(tmp); } s.push_back(s_tmp); } for (int i = 0; i < M; i++) { int tmp; cin >> tmp; p.push_back(tmp); } int ans = 0; for (int bit = 0; bit < (1 << N); ++bit) if (judge(bit)) ans++; cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<vector<int>> s; vector<int> p; int N, M; bool judge(int bit) { int cnt = 0; for (int i = 0; i < M; i++) { int state = 0; for (int j = 0; j < s[i].size(); j++) { if (bit & (1 << s[i][j])) state += 1; } if (p[i] == (state % 2)) cnt++; } return cnt == M; } int main() { cin >> N >> M; for (int i = 0; i < M; i++) { int k; cin >> k; vector<int> s_tmp; for (int j = 0; j < k; j++) { int tmp; cin >> tmp; s_tmp.push_back(tmp - 1); } s.push_back(s_tmp); } for (int i = 0; i < M; i++) { int tmp; cin >> tmp; p.push_back(tmp); } int ans = 0; for (int bit = 0; bit < (1 << N); ++bit) if (judge(bit)) ans++; cout << ans; return 0; }
[ "expression.operation.binary.add" ]
840,753
840,754
u810625173
cpp