buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int s, w; cin >> s >> w; if (w > s) cout << "unsafe"; else cout << "safe"; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int s, w; cin >> s >> w; if (w >= s) cout << "unsafe"; else cout << "safe"; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
71
#include <bits/stdc++.h> #include <string.h> #define ll long long #include <vector> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> #include <string.h> #define ll long long #include <vector> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
55
a = input().spolit() if int(a[0]) > int(a[1]): print("safe") else: print("unsafe")
a = input().split() if int(a[0]) <= int(a[1]): print("unsafe") else: print("safe")
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
40
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int s = scan.nextInt(); int w = scan.nextInt(); if (w >= s / 2) { System.out.println("unsafe"); } else { System.out.println("safe"); } } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int s = scan.nextInt(); int w = scan.nextInt(); if (w >= s) { System.out.println("unsafe"); } else { System.out.println("safe"); } } }
[["-", 0, 57, 15, 15, 0, 16, 12, 16, 17, 85], ["-", 0, 57, 15, 15, 0, 16, 12, 16, 12, 499]]
3
88
main(s, w) { scanf("%d%d", &s, &w); puts(w < s ? "unsafe" : "safe"); }
main(s, w) { scanf("%d%d", &s, &w); puts(w < s ? "safe" : "unsafe"); }
[["-", 0, 2, 3, 4, 0, 41, 64, 5, 0, 6], ["+", 0, 2, 3, 4, 0, 41, 64, 5, 0, 6], ["-", 0, 2, 3, 4, 0, 41, 75, 5, 0, 6], ["+", 0, 2, 3, 4, 0, 41, 75, 5, 0, 6]]
0
36
S,W=map(int,input().split()) if S<W: print("unsafe") elif S>W: print("safe")
S,W=map(int,input().split()) if S<=W: print("unsafe") elif S>W: print("safe")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
38
s, w = map(int, (input().split())) if s < w : print("unsafe") else : print("safe")
s, w = map(int, (input().split())) if s > w : print("safe") else : print("unsafe")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
37
function main(input) { const tmp = input.trim().split(' ') const s = parseInt(tmp[0], 10) const w = parseInt(tmp[1], 10) if (w > s) { console.log('unsafe') } else { console.log('safe') } } main(require('fs').readFileSync('/dev/stdin', 'utf8'))
function main(input) { const tmp = input.trim().split(' ') const s = parseInt(tmp[0], 10) const w = parseInt(tmp[1], 10) if (w >= s) { console.log('unsafe') } else { console.log('safe') } } main(require('fs').readFileSync('/dev/stdin', 'utf8'))
[["-", 8, 556, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 556, 0, 57, 15, 23, 0, 16, 17, 20]]
2
93
#include <bits/stdc++.h> using namespace std; signed main() { int n, m; cin >> n >> m; if (n < m) { cout << "unsafe"; } else cout << "safe"; return 0; }
#include <bits/stdc++.h> using namespace std; signed main() { int n, m; cin >> n >> m; if (n <= m) { cout << "unsafe"; } else cout << "safe"; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
47
S, W = gets.chomp.split(' ').map(&:to_i) puts S < W ? 'unsafe' : 'safe'
S, W = gets.chomp.split(' ').map(&:to_i) puts S <= W ? 'unsafe' : 'safe'
[["-", 0, 652, 3, 4, 0, 754, 15, 738, 17, 18], ["+", 0, 652, 3, 4, 0, 754, 15, 738, 17, 19]]
4
32
#include <bits/stdc++.h> using namespace std; int main() { int S, W; cin >> S >> W; if (W > S) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int S, W; cin >> S >> W; if (W >= S) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
49
S, W = list(map(int, input().split())) if S <= W*2: print("unsafe") else: print("safe")
S, W = list(map(int, input().split())) if S <= W: print("unsafe") else: print("safe")
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 48], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
40
#include <stdio.h> int main() { int S, W; scanf("%d", &S); scanf("%d", &W); if (S < W) { printf("unsafe"); } else { printf("safe"); } return 0; }
#include <stdio.h> int main() { int S, W; scanf("%d", &S); scanf("%d", &W); if (S <= W) { printf("unsafe"); } else { printf("safe"); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
61
#include <stdio.h> int main(void) { int S, W; scanf("%d%d", &S, &W); if (S >= W) printf("safe\n"); else printf("unsafe\n"); return 0; }
#include <stdio.h> int main(void) { int S, W; scanf("%d%d", &S, &W); if (W >= S) printf("unsafe\n"); else printf("safe\n"); return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6...
0
53
s,w=gets.split.map(&:to_i) if s > w then puts("safe") else puts("usafe") end
s,w=gets.split.map(&:to_i) if s > w then puts("safe") else puts("unsafe") end
[["-", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 75, 95, 0, 652, 3, 4, 0, 557, 0, 6]]
4
32
#include <iostream> int main() { int s, w; std::cin >> s >> w; if (s < w) { std::cout << "unsafe"; } else { std::cout << "safe"; } return 0; }
#include <iostream> int main() { int s, w; std::cin >> s >> w; if (s <= w) { std::cout << "unsafe"; } else { std::cout << "safe"; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
51
S , W = (int(a) for a in input().split()) if S <= W : prit("unsafe") else : print("safe")
S , W = (int(a) for a in input().split()) if S <= W : print("unsafe") else : print("safe")
[["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22]]
5
39
#include <stdio.h> int main() { int s, w; scanf("%d%d", &s, &w); if (s < w) { printf("unsafe"); } else { printf("safe"); } return 0; }
#include <stdio.h> int main() { int s, w; scanf("%d %d", &s, &w); if (w >= s) { printf("unsafe"); } else { printf("safe"); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22]]
0
54
s,w = map(int,input().rstrip().split(' ')) if s>=w: print('safe') else: print('unsafe')
s,w = map(int,input().rstrip().split(' ')) if s>w: print('safe') else: print('unsafe')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
42
#include <bits/stdc++.h> #define int long long int #define gif(a, b) (a / b + (a % b ? 1 : 0)) #define watch(x) cout << (#x) << " is " << (x) << "\n"; using namespace std; int32_t main() { cin.tie(NULL); std::ios::sync_with_stdio(false); int s, t; cin >> s >> t; if (s < t) cout << "unsafe"; else c...
#include <bits/stdc++.h> #define int long long int #define gif(a, b) (a / b + (a % b ? 1 : 0)) #define watch(x) cout << (#x) << " is " << (x) << "\n"; using namespace std; int32_t main() { cin.tie(NULL); std::ios::sync_with_stdio(false); int s, t; cin >> s >> t; if (s <= t) cout << "unsafe"; else ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
78
#include <iostream> using namespace std; int main(void) { int s, w; cin >> s >> w; if (w > s) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int s, w; cin >> s >> w; if (w >= s) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
50
S, W = [int(x) for x in input().split()] if S <= 2 * W: print('unsafe') else: print('safe')
S, W = [int(x) for x in input().split()] if S <= W: print('unsafe') else: print('safe')
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 31, 612], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 48]]
5
41
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (w >= s) cout << "safe"; else cout << "unsafe"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (w >= s) cout << "unsafe"; else cout << "safe"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
45
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int S = sc.nextInt(); int W = sc.nextInt(); if (2 * W >= S) { System.out.println("unsafe"); } else { System.out.println("safe"); } } }
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int S = sc.nextInt(); int W = sc.nextInt(); if (W >= S) { System.out.println("unsafe"); } else { System.out.println("safe"); } } }
[["-", 0, 57, 15, 15, 0, 16, 31, 16, 31, 499], ["-", 0, 57, 15, 15, 0, 16, 31, 16, 17, 48]]
3
87
n,m=map(input,int().split()) if(n>m): print("safe") else: print("unsafe")
n,m=map(int,input().split()) if(n>m): print("safe") else: print("unsafe")
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22]]
5
37
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
94
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; cout << (s < w ? "unsafe" : "safe"); }
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; cout << (s > w ? "safe" : "unsafe"); }
[["-", 0, 16, 12, 23, 0, 41, 15, 16, 17, 18], ["+", 0, 16, 12, 23, 0, 41, 15, 16, 17, 47], ["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
39
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<int> vi; int main(void) { int s, w; cin >> s >> w; if (s >= w) { cout << "safe" << endl; } else { cout << "unsafe" << endl; } return 0; }
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<int> vi; int main(void) { int s, w; cin >> s >> w; if (w >= s) { cout << "unsafe" << endl; } else { cout << "safe" << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
68
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int s, w; cin >> s >> w; if (s <= w) { cout << "Unsafe" << endl; } else { cout << "Safe" << endl; } return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { int s, w; cin >> s >> w; if (s <= w) { cout << "unsafe" << endl; } else { cout << "safe" << endl; } return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
66
#include <bits/stdc++.h> using namespace std; int main() { long long s, w; cin >> s >> w; if (w > s) { cout << "unsafe" << endl; } else { cout << "safe" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { long long s, w; cin >> s >> w; if (w >= s) { cout << "unsafe" << endl; } else { cout << "safe" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
51
#include <bits/stdc++.h> using namespace std; template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } int main() { int s, w; cin >> s >> w; if (s <= w * 2) cout <<...
#include <bits/stdc++.h> using namespace std; template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } int main() { int s, w; cin >> s >> w; if (s <= w) cout << "un...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
120
S,W=input().split() if S<=W: print("unsafe") elif S>W: print("safe")
S,W= map(int, input().split()) if S<=W: print("unsafe") elif S>W: print("safe")
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
33
#include <iostream> using namespace std; int main(void) { int s, w; cin >> s >> w; s /= 2; if (w >= s) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int s, w; cin >> s >> w; if (w >= s) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
54
#include <stdio.h> int main() { int S, W; scanf("%d%d", &S, &W); if (S <= W) printf("un"); printf("saffe"); };
#include <stdio.h> int main() { int S, W; scanf("%d %d", &S, &W); if (S <= W) printf("un"); printf("safe"); };
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
47
#include <stdio.h> int main(void) { int s, w; scanf("%d%d", &s, &w); if (s >= w) { printf("safe"); } else { printf("unsafe"); } return 0; }
#include <stdio.h> int main(void) { int s, w; scanf("%d%d", &s, &w); if (s > w) { printf("safe"); } else { printf("unsafe"); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47]]
0
55
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define pb push_back #define COUT(x) cout << (x) << endl #define ENDL cout << endl #define debug(x) cout << "[debug] " << #x << ": " << x << endl using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1000000000; int...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define pb push_back #define COUT(x) cout << (x) << endl #define ENDL cout << endl #define debug(x) cout << "[debug] " << #x << ": " << x << endl using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1000000000; int...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
99
#include <stdio.h> int main(void) { int sheep, wolves; scanf("%d%d", &sheep, &wolves); if (sheep >= wolves) { printf("safe\n"); } else { printf("unsafe\n"); } return 0; }
#include <stdio.h> int main(void) { int sheep, wolves; scanf("%d%d", &sheep, &wolves); if (sheep > wolves) { printf("safe\n"); } else { printf("unsafe\n"); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47]]
0
57
#include <bits/stdc++.h> using namespace std; #define REP(name, stop) for (ll(name) = 0; (name) < (stop); (name)++) using ll = long long; using vi = vector<ll>; int main(void) { ll S, W; cin >> S >> W; string ans; if (S >= W) ans = "safe"; else ans = "unsafe"; cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define REP(name, stop) for (ll(name) = 0; (name) < (stop); (name)++) using ll = long long; using vi = vector<ll>; int main(void) { ll S, W; cin >> S >> W; string ans; if (S > W) ans = "safe"; else ans = "unsafe"; cout << ans << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
77
G=gets.split(' ') S=G[0];W=G[1] if (W>=S) then puts('unsafe') else puts('safe') end
G=gets.split.map(&:to_i) S=G[0];W=G[1] if (W>=S) then puts('unsafe') else puts('safe') end
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22], ["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 62], ["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 67], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
44
#include <bits/stdc++.h> using namespace std; int main() { int S, W; cin >> S >> W; if (S < W) { cout << "unsafe" << endl; } else if (S > W) { cout << "safe" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int S, W; cin >> S >> W; if (S <= W) { cout << "unsafe" << endl; } else if (S > W) { cout << "safe" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
56
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; int main() { double s, w; cin >> s >> w; if (w >= 0.5 * s) cout << "unsafe" << endl; else cout << "safe" << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (double i = 0; i < n; ++i) using namespace std; int main() { double s, w; cin >> s >> w; if (w >= s) cout << "unsafe" << endl; else cout << "safe" << endl; }
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48]]
1
56
#include <bits/stdc++.h> using namespace std; /** ******************* Author:Bisnu sarkar **************************** **/ /* #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") */ #define fRead(x) freopen(x, "r", stdin) #define fWrite(x) freopen(x, "w", stdout) #defin...
#include <bits/stdc++.h> using namespace std; /** ******************* Author:Bisnu sarkar **************************** **/ /* #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") */ #define fRead(x) freopen(x, "r", stdin) #define fWrite(x) freopen(x, "w", stdout) #defin...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
556
S,W = input().split() print('unsafe') if S <= W else print('safe')
S,W = map(int,input().split()) print('unsafe') if S <= W else print('safe')
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
28
s,w = map(int, input().split(' ')) if w >= s/2: print('unsafe') else: print('safe')
s,w = map(int, input().split(' ')) if w >= s: print('unsafe') else: print('safe')
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 85], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
40
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define MAX 200005 lli arr[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lli s, w; cin >> s >> w; if (s < w) { cout << "unsafe"; } else { cout << "safe"; } }
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define MAX 200005 lli arr[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lli s, w; cin >> s >> w; if (s <= w) { cout << "unsafe"; } else { cout << "safe"; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
75
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a >= b) cout << "safe" << endl; else cout << "unsafe" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a > b) cout << "safe" << endl; else cout << "unsafe" << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
46
const main = (input) => { const [s, w] = input.trim().split(' ').map(v => parseInt(v, 10)) s < w ? console.log('unsafe') : console.log('safe') } main(require('fs').readFileSync('/dev/stdin', 'utf8'));
const main = (input) => { const [s, w] = input.trim().split(' ').map(v => parseInt(v, 10)) s <= w ? console.log('unsafe') : console.log('safe') } main(require('fs').readFileSync('/dev/stdin', 'utf8'));
[["-", 8, 556, 0, 1, 0, 510, 15, 16, 17, 18], ["+", 8, 556, 0, 1, 0, 510, 15, 16, 17, 19]]
2
82
// CODING ME ACCHHA KARNEKA HAI TERKO TO BAS PRACTICE KARTE REH #include <bits/stdc++.h> #define pragma using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define aisort sort(a, a + n) #define adsort sort(a, a + n, greater<ll>()) #define PI 2 * acos(0) typedef p...
// CODING ME ACCHHA KARNEKA HAI TERKO TO BAS PRACTICE KARTE REH #include <bits/stdc++.h> #define pragma using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define aisort sort(a, a + n) #define adsort sort(a, a + n, greater<ll>()) #define PI 2 * acos(0) typedef p...
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
406
#include <bits/stdc++.h> using namespace std; typedef long long int ll; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } const long long IN...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } const long long IN...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48]]
1
142
s,w =map(input().split()) if s>w: print("safe") else: print("unsafe")
s,w =map(int,input().split()) if s>w: print("safe") else: print("unsafe")
[["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21]]
5
33
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int S, W; cin >> S >> W; if (S <= W) cout << "safe" << endl; else cout << "unsaf...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int S, W; cin >> S >> W; if (S > W) cout << "safe" << endl; else cout << "unsafe...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
81
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (s < w) cout << "unsafe" << endl; else cout << "safe" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (s <= w) cout << "unsafe" << endl; else cout << "safe" << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
46
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); a = a / 2; if (a <= b) { printf("unsafe\n"); } else { printf("safe\n"); } return 0; }
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if (a <= b) { printf("unsafe\n"); } else { printf("safe\n"); } return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
0
63
#include <stdio.h> int main(void) { int S, W; scanf("%d %d", &S, &W); if (S < W) { printf("unsafe\n"); } else { printf("safe\n"); } return 0; }
#include <stdio.h> int main(void) { int S, W; scanf("%d %d", &S, &W); if (S <= W) { printf("unsafe\n"); } else { printf("safe\n"); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
57
S,W = map(int,input,split) if S <= W : print("unsafe") else : print("safe")
#入力例全てOKだけど黄色# S,W = map(int,input().split()) if S <= W : print("unsafe") else : print("safe")
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
31
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (b > a) cout << "unsafe"; else cout << "safe"; }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (b >= a) cout << "unsafe"; else cout << "safe"; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
42
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (s / 2 <= w) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (s > w) cout << "safe" << endl; else cout << "unsafe" << endl; return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1...
1
51
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (s / 2 <= w) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int s, w; cin >> s >> w; if (s <= w) cout << "unsafe" << endl; else cout << "safe" << endl; return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
51
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (x >= y) { cout << "safe"; } else { cout << "unsafe"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (x > y) { cout << "safe"; } else { cout << "unsafe"; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
49
#include <bits/stdc++.h> #define ed cout << "\n"; #define speed \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ...
#include <bits/stdc++.h> #define ed cout << "\n"; #define speed \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
110
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", a, b); if (a <= b) { printf("unsafe"); } else { printf("safe"); } }
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if (a <= b) { printf("unsafe"); } else { printf("safe"); } }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
50
#include <stdio.h> int main(void) { int s; int w; scanf("%d", &s); scanf("%d", &w); if (w > s) puts("unsafe"); else puts("safe"); return 0; }
#include <stdio.h> int main(void) { int s; int w; scanf("%d", &s); scanf("%d", &w); if (w >= s) puts("unsafe"); else puts("safe"); return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
59
#include <stdio.h> int main(void) { int s, w; scanf("%d", &s); scanf("%d", &w); if (s < w) { printf("unsafe"); } else { printf("safe"); } return (0); }
#include <stdio.h> int main(void) { int s, w; scanf("%d", &s); scanf("%d", &w); if (s <= w) { printf("unsafe"); } else { printf("safe"); } return (0); }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
64
#include <stdio.h> int main(void) { int s; int r; scanf("%d\n", &s); scanf("%d\n", &r); if (r >= 2 * s) { printf("unsafe"); } else { printf("safe"); } return 0; }
#include <stdio.h> int main(void) { int s; int r; scanf("%d\n", &s); scanf("%d\n", &r); if (r >= s) { printf("unsafe"); } else { printf("safe"); } return 0; }
[["-", 0, 57, 15, 23, 0, 16, 12, 16, 31, 13], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 48]]
0
67
#include <stdio.h> int main(void) { int s; int r; scanf("%d\n", &s); scanf("%d\n", &r); if (r < s / 2) { printf("safe"); } else { printf("unsafe"); } return 0; }
#include <stdio.h> int main(void) { int s; int r; scanf("%d\n", &s); scanf("%d\n", &r); if (r < s) { printf("safe"); } else { printf("unsafe"); } return 0; }
[["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 85], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 12, 13]]
0
67
S, W = list(map(int, input().split())) if S < W : print("unsafe") if S > W : print("safe")
S, W = list(map(int, input().split())) if S <= W : print("unsafe") if S > W : print("safe")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
41
s, w = map(int, input().strip().split(" ")) print(["safe", "unsafe"][s < w])
s, w = map(int, input().split(" ")) print(["safe", "unsafe"][s <= w])
[["-", 0, 652, 63, 319, 500, 652, 63, 319, 319, 22], ["-", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["-", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["-", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["-", 0, 652, 3, 4, 0, 206, 206, 666, 667, 18], ["+", 0, 652, 3, 4, 0, 206, 206, 666, 667, 19]]
5
40
#include <CodeforcesSolutions.h> #include <ONLINE_JUDGE <solution.cf(contestID = "1364",problemID = "A",method = "GET")>.h> """ Author : thekushalghosh Team : CodeDiggers I prefer Python language over the C++ language :p :D Visit my website : thekushalghosh.github.io """ import sys,math,cma...
#include <CodeforcesSolutions.h> #include <ONLINE_JUDGE <solution.cf(contestID = "1364",problemID = "A",method = "GET")>.h> """ Author : thekushalghosh Team : CodeDiggers I prefer Python language over the C++ language :p :D Visit my website : thekushalghosh.github.io """ import sys,math,cma...
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 14, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
733
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array #define vi vector<int> #define INF 1000000000 int main() { ios::sync_with_stdio(0); cin.tie(0); int S, W; cin >> S >> W; string safety = W > S ? "unsafe" : "safe"; cout << safety << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array #define vi vector<int> #define INF 1000000000 int main() { ios::sync_with_stdio(0); cin.tie(0); int S, W; cin >> S >> W; string safety = W >= S ? "unsafe" : "safe"; cout << safety << endl; return 0; }
[["-", 0, 43, 49, 50, 51, 41, 15, 16, 17, 47], ["+", 0, 43, 49, 50, 51, 41, 15, 16, 17, 20]]
1
73
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s = sc.nextInt(); int w = sc.nextInt(); if (w * 2 >= s) System.out.println("unsafe"); else System.out.println("safe"); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s = sc.nextInt(); int w = sc.nextInt(); if (w >= s) System.out.println("unsafe"); else System.out.println("safe"); } }
[["-", 0, 57, 15, 15, 0, 16, 31, 16, 17, 48], ["-", 0, 57, 15, 15, 0, 16, 31, 16, 12, 499]]
3
84
#include <bits/stdc++.h> #define nl \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll long long #define all(v...
#include <bits/stdc++.h> #define nl \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll long long #define all(v...
[["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
60
#include <cstdio> #include <iostream> using namespace std; int main() { int s, w; cin >> s >> w; if (w > s) { cout << "unsafe"; } else { cout << "safe"; } return 0; }
#include <cstdio> #include <iostream> using namespace std; int main() { int s, w; cin >> s >> w; if (w >= s) { cout << "unsafe"; } else { cout << "safe"; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
51
S,W=map(int,input().split()) if W>=S: print('unsafe') print('safe')
S,W=map(int,input().split()) if W>=S: print('unsafe') exit() print('safe')
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
33
#include <bits/stdc++.h> #define pb emplace_back using namespace std; using ll = long long; const int maxn = 300010; vector<int> edge[maxn]; int n, a[maxn], res[maxn]; int dp[maxn]; void dfs(int now, int last = -1, int len = 0) { int pos = upper_bound(dp, dp + len, a[now]) - dp; int o = dp[pos]; len = max(len, po...
#include <bits/stdc++.h> #define pb emplace_back using namespace std; using ll = long long; const int maxn = 300010; vector<int> edge[maxn]; int n, a[maxn], res[maxn]; int dp[maxn]; void dfs(int now, int last = -1, int len = 0) { int pos = lower_bound(dp, dp + len, a[now]) - dp; int o = dp[pos]; len = max(len, po...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
277
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using u64 = unsigned long long; using namespace std; template <class T> constexp...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using u64 = unsigned long long; using namespace std; template <class T> constexp...
[["+", 0, 2, 3, 4, 0, 69, 28, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 28, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 69, 28, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73]]
1
2,020
#include <bits/stdc++.h> using namespace std; constexpr int INF = 1e9 + 1; int main() { int n; cin >> n; vector<int> a(n); for (auto &e : a) cin >> e; vector<vector<int>> g(n); for (int i = 0; i < n - 1; i++) { int u, v; cin >> u >> v; u--, v--; g[u].push_back(v); g[v].push_back(u);...
#include <bits/stdc++.h> using namespace std; constexpr int INF = 1e9 + 1; int main() { int n; cin >> n; vector<int> a(n); for (auto &e : a) cin >> e; vector<vector<int>> g(n); for (int i = 0; i < n - 1; i++) { int u, v; cin >> u >> v; u--, v--; g[u].push_back(v); g[v].push_back(u);...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
274
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; using P = pair<int, int>; constexpr int INF = 1e9; constexpr long long LINF = 1e18; constexpr long long MOD = 1e9 + 7; #define MAX 200000 int n; ll a[MAX]; ll dp[MA...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; using P = pair<int, int>; constexpr int INF = 1e9; constexpr long long LINF = 1e18; constexpr long long MOD = 1e9 + 7; #define MAX 200000 int n; ll a[MAX]; ll dp[MA...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["-", 0, 43, 49, 50, 51, 66, 28, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 66, 28, 2, 63, 22], ["-", 0, 1, 0, 11, 31, 66, 28, 2, 63, 22], ["+", 0, 1, 0, 11, 31, 66, 28, 2, 63, 22]]
1
322
import sys input = sys.stdin.readline n = int(input()) A = [0] + list(map(int,input().split())) C = [list(map(int,input().split())) for i in range(n-1)] sys.setrecursionlimit(10**5 + 5) # 再帰回数の上限!! M = [[] for i in range(n+1)] for i in range(n-1): M[C[i][0]].append(C[i][1]) M[C[i][1]].append(C[i][0]) # ...
import sys input = sys.stdin.readline n = int(input()) A = [0] + list(map(int,input().split())) C = [list(map(int,input().split())) for i in range(n-1)] sys.setrecursionlimit(10**5 + 5) # 再帰回数の上限!! M = [[] for i in range(n+1)] for i in range(n-1): M[C[i][0]].append(C[i][1]) M[C[i][1]].append(C[i][0]) # ...
[["+", 0, 656, 0, 1, 0, 662, 12, 206, 51, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 206, 0, 70], ["+", 0, 656, 0, 1, 0, 662, 12, 206, 0, 73]]
5
315
#include <bits/stdc++.h> #define endl '\n' #define fi first #define se second #define MOD(n, k) ((((n) % (k)) + (k)) % (k)) #define forn(i, n) for (int i = 0; i < n; i++) #define forr(i, a, b) for (int i = a; i <= b; i++) #define all(v) v.begin(), v.end() #define pb(x) push_back(x) using namespace std; typedef long ...
#include <bits/stdc++.h> #define endl '\n' #define fi first #define se second #define MOD(n, k) ((((n) % (k)) + (k)) % (k)) #define forn(i, n) for (int i = 0; i < n; i++) #define forr(i, a, b) for (int i = a; i <= b; i++) #define all(v) v.begin(), v.end() #define pb(x) push_back(x) using namespace std; typedef long ...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13]]
1
360
#include <bits/stdc++.h> using namespace std; int n; int a[200005]; int ans[200005]; int L[200005]; vector<int> adjlist[200005]; void dfs(int u, int p, int l) { // printf("%d %d %d\n",u,p,l); int pos = lower_bound(L, L + l, a[u]) - L; int temp = L[pos]; L[pos] = a[u]; if (pos == l) l++; ans[u] = l; fo...
#include <bits/stdc++.h> using namespace std; int n; int a[200005]; int ans[200005]; int L[200005]; vector<int> adjlist[200005]; void dfs(int u, int p, int l) { // printf("%d %d %d\n",u,p,l); int pos = lower_bound(L, L + l, a[u]) - L; int temp = L[pos]; L[pos] = a[u]; if (pos == l) l++; ans[u] = l; fo...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22]]
1
277
#include <bits/stdc++.h> using namespace std; // Optimization //#pragma GCC optimize("O3") #define endl '\n' // Shortcut // #define int long long #define eb emplace_back #define pb push_back #define pob pop_back #define mp make_pair #define upb upper_bound #define lwb lower_bound #define fi first #define se second ...
#include <bits/stdc++.h> using namespace std; // Optimization //#pragma GCC optimize("O3") #define endl '\n' // Shortcut // #define int long long #define eb emplace_back #define pb push_back #define pob pop_back #define mp make_pair #define upb upper_bound #define lwb lower_bound #define fi first #define se second ...
[["-", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22]]
1
639
#include "bits/stdc++.h" using namespace std; const int N = 2e5 + 20; int n, a[N], u, v, ans[N]; vector<int> adj[N]; multiset<int> s; void dfs(int node, int parent = 0) { s.insert(a[node]); int del = -1; auto it = s.upper_bound(a[node]); if (it != s.end()) del = *it, s.erase(it); ans[node] = s.size(); ...
#include "bits/stdc++.h" using namespace std; const int N = 2e5 + 20; int n, a[N], u, v, ans[N]; vector<int> adj[N]; multiset<int> s; void dfs(int node, int parent = 0) { s.insert(a[node]); int del = -1; auto it = s.lower_bound(a[node]); if (++it != s.end()) del = *it, s.erase(it); ans[node] = s.size()...
[["-", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 31, 27, 17, 29]]
1
299
/// kazuki08 /* #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds...
/// kazuki08 /* #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds...
[["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
997
#include <bits/stdc++.h> using namespace std; int const maxn = 2e5 + 5; int a[maxn], ans[maxn], best[maxn], len; vector<int> g[maxn]; void dfs(int v, int p) { int lef = 0, righ = len + 1; while (righ - lef > 1) { int mid = (righ + lef) / 2; if (best[mid] < a[v]) lef = mid; else righ = mid...
#include <bits/stdc++.h> using namespace std; int const maxn = 2e5 + 5; int a[maxn], ans[maxn], best[maxn], len; vector<int> g[maxn]; void dfs(int v, int p) { int lef = 0, righ = len + 1; while (righ - lef > 1) { int mid = (righ + lef) / 2; if (best[mid] < a[v]) lef = mid; else righ = mid...
[["-", 0, 1, 0, 34, 31, 11, 12, 16, 31, 22], ["+", 0, 1, 0, 34, 31, 11, 12, 16, 31, 22], ["-", 12, 11, 12, 69, 341, 342, 0, 16, 31, 22], ["+", 12, 11, 12, 69, 341, 342, 0, 16, 31, 22], ["-", 0, 11, 31, 69, 341, 342, 0, 16, 31, 22], ["+", 0, 11, 31, 69, 341, 342, 0, 16, 31, 22]]
1
372
#include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll // [a -> b-1] #define reps(i, a, b) for (int i = (int)(a); i < (int)(b); i++) // [0 -> a-1] #define rep(i, a) reps(i, 0, (a)) // [a-1 -> b] #define rreps(i, a, b) for (int i = (int)((a)-1); i >= (int)(b); i--) // [a-1 -> 0] #define rre...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll // [a -> b-1] #define reps(i, a, b) for (int i = (int)(a); i < (int)(b); i++) // [0 -> a-1] #define rep(i, a) reps(i, 0, (a)) // [a-1 -> b] #define rreps(i, a, b) for (int i = (int)((a)-1); i >= (int)(b); i--) // [a-1 -> 0] #define rre...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
1,456
#include <algorithm> #include <iostream> #include <string.h> #include <vector> #define int long long using namespace std; int N; int pos[200100]; int bef[200100]; int arr[200100]; int a[200100]; vector<int> li[200100]; vector<int> p; void dfs(int n, int pa) { int i; pos[n] = upper_bound(p.begin(), p.end(), a[n]) - ...
#include <algorithm> #include <iostream> #include <string.h> #include <vector> #define int long long using namespace std; int N; int pos[200100]; int bef[200100]; int arr[200100]; int a[200100]; vector<int> li[200100]; vector<int> p; void dfs(int n, int pa) { int i; pos[n] = lower_bound(p.begin(), p.end(), a[n]) - ...
[["-", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22]]
1
362
#include <bits/stdc++.h> using namespace std; const int Maxn = 200005; int n, ct, cnt, top, a[Maxn], head[Maxn], ans[Maxn], val[Maxn]; pair<int, int> sta[Maxn]; struct edg { int nxt, to; } edge[2 * Maxn]; void add(int x, int y) { edge[++cnt] = (edg){head[x], y}; head[x] = cnt; } void dfs(int u, int fa) { int p...
#include <bits/stdc++.h> using namespace std; const int Maxn = 200005; int n, ct, cnt, top, a[Maxn], head[Maxn], ans[Maxn], val[Maxn]; pair<int, int> sta[Maxn]; struct edg { int nxt, to; } edge[2 * Maxn]; void add(int x, int y) { edge[++cnt] = (edg){head[x], y}; head[x] = cnt; } void dfs(int u, int fa) { int p...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
388
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using graph = vector<vector<int>>; graph T; vector<int> val; vector<int> lis, ans; void dfs(int u, int p) { auto it = upper_bound(lis.begin(), lis.end(), val[u]); int pos, val_pre; if (it == lis.end()) { pos = -...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using graph = vector<vector<int>>; graph T; vector<int> val; vector<int> lis, ans; void dfs(int u, int p) { auto it = lower_bound(lis.begin(), lis.end(), val[u]); int pos, val_pre; if (it == lis.end()) { pos = -...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
336
#define ONLINE_JUDGE #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef pair<ll, ll> pl; typedef vector<pl> vp; const ll INF = 1001001001; const ll LINF = 1001001001001001001; const ll D4[] = {0, 1, 0, -1, 0}; const ll D8[] = {0, 1, 1, 0, -1, -1, 1...
#define ONLINE_JUDGE #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef pair<ll, ll> pl; typedef vector<pl> vp; const ll INF = 1001001001; const ll LINF = 1001001001001001001; const ll D4[] = {0, 1, 0, -1, 0}; const ll D8[] = {0, 1, 1, 0, -1, -1, 1...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
644
#include <bits/stdc++.h> #include <stdlib.h> #include <sys/time.h> #include <unistd.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<P, ll> T; long long int INF = 2e18; const ll fact_table = 1200008; double Pi = 3.1415926535897932384626; priority_queue<ll> pql; priority_queue<P> pq...
#include <bits/stdc++.h> #include <stdlib.h> #include <sys/time.h> #include <unistd.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<P, ll> T; long long int INF = 2e18; const ll fact_table = 1200008; double Pi = 3.1415926535897932384626; priority_queue<ll> pql; priority_queue<P> pq...
[["-", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 70], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 73]]
1
766
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mii map<int, int> #define mll map<ll, ll> #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vd vector<double> #define vll vector<ll> #define fi first #define se seco...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mii map<int, int> #define mll map<ll, ll> #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vd vector<double> #define vll vector<ll> #define fi first #define se seco...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
472
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < int(n); i++) #define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--) #define reps(i, n) for (int i = 1; i <= int(n); i++) #define rreps(i, n) for (int i = int(n); i >= 1; i--) #define repc(i, n) for (int i = 0; i <= int(n); i++) #define rrepc(i, n) for (i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < int(n); i++) #define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--) #define reps(i, n) for (int i = 1; i <= int(n); i++) #define rreps(i, n) for (int i = int(n); i >= 1; i--) #define repc(i, n) for (int i = 0; i <= int(n); i++) #define rrepc(i, n) for (i...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
823
// raja1999 //#pragma comment(linker, "/stack:200000000") //#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ext/pb_ds/assoc_container.hpp> #include <...
// raja1999 //#pragma comment(linker, "/stack:200000000") //#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ext/pb_ds/assoc_container.hpp> #include <...
[["-", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
813
// Contest: AtCoder Beginner Contest 165 (https://atcoder.jp/contests/abc165) // Problem: F: LIS on Tree (https://atcoder.jp/contests/abc165/tasks/abc165_f) // region {{{ boilerplate #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdint> #includ...
// Contest: AtCoder Beginner Contest 165 (https://atcoder.jp/contests/abc165) // Problem: F: LIS on Tree (https://atcoder.jp/contests/abc165/tasks/abc165_f) // region {{{ boilerplate #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdint> #includ...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
582
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i) #define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i) mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); template <typename T> inline void chkmax(T &x, T y)...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i) #define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i) mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); template <typename T> inline void chkmax(T &x, T y)...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
438
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #includ...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 72], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
617
import sys from bisect import bisect_left as bl readline = sys.stdin.readline def euler_tour(root, Edge): N = len(Edge) stack = [root] used = [False]*N tour = [] down = [] dist = [0]*N ta = tour.append sa = stack.append St = [None]*N En = [None]*N cnt = -1 while stack: ...
import sys from bisect import bisect_left as bl readline = sys.stdin.readline def euler_tour(root, Edge): N = len(Edge) stack = [root] used = [False]*N tour = [] down = [] dist = [0]*N ta = tour.append sa = stack.append St = [None]*N En = [None]*N cnt = -1 while stack: ...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
474
/* 读题不规范,爆零两行泪。 数据不清空,爆零两行泪。 多测不读完,爆零两行泪。 边界不特判,爆零两行泪。 贪心不证明,爆零两行泪。 D P 顺序错,爆零两行泪。 大小少等号,爆零两行泪。 变量不统一,爆零两行泪。 越界不判断,爆零两行泪。 调试不注释,爆零两行泪。 溢出不 l l,爆零两行泪。 */ #include <bits/stdc++.h> using namespace std; #define pb push_back const int N = 200000; int n; int a[N + 1]; vector<int> nums; void discrete() { sort(nums.begin(), ...
/* 读题不规范,爆零两行泪。 数据不清空,爆零两行泪。 多测不读完,爆零两行泪。 边界不特判,爆零两行泪。 贪心不证明,爆零两行泪。 D P 顺序错,爆零两行泪。 大小少等号,爆零两行泪。 变量不统一,爆零两行泪。 越界不判断,爆零两行泪。 调试不注释,爆零两行泪。 溢出不 l l,爆零两行泪。 */ #include <bits/stdc++.h> using namespace std; #define pb push_back const int N = 200000; int n; int a[N + 1]; vector<int> nums; void discrete() { sort(nums.begin(), ...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
879
#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); \ c...
#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); \ c...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
345
#include <bits/stdc++.h> // ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); // clock_t start=clock();clock_t // end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef unsigned int ui; typedef pair<int, int> pii; typedef pair<pii...
#include <bits/stdc++.h> // ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); // clock_t start=clock();clock_t // end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef unsigned int ui; typedef pair<int, int> pii; typedef pair<pii...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]]
1
994