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> #define ll long long #define nl "\n" #define pi acos(-1) #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define pcase printf("Case %d:\n", ca) int ca = 1; using namespace std; int main() { string a; cin >> a; ll ans = 0; for (int i = 0; i < a.size(); i++) {...
#include <bits/stdc++.h> #define ll long long #define nl "\n" #define pi acos(-1) #define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define pcase printf("Case %d:\n", ca) int ca = 1; using namespace std; int main() { string a; cin >> a; ll ans = 0; for (int i = 0; i < a.size(); i++) {...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 33]]
1
116
if int(inout())%9==0: print("Yes") else: print("No")
if int(input())%9==0: print("Yes") else: print("No")
[["-", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22]]
5
26
number = int(input("enter your no")) sum_of_digits = 0 for digit in str(number): sum_of_digits += int(digit) if(sum_of_digits%9==0): print("Yes") else: print("No")
number = int(input()) sum_of_digits = 0 for digit in str(number): sum_of_digits += int(digit) if(sum_of_digits%9==0): print("Yes") else: print("No")
[["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 655]]
5
51
N = input() ans = 0 for i in range(len(N)): ans += N[i] print("Yes") if ans%9 == 0 else print("No")
N = input() ans = 0 for i in range(len(N)): ans += int(N[i]) print("Yes") if ans%9 == 0 else print("No")
[["+", 8, 196, 0, 1, 0, 677, 12, 652, 63, 22], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 25]]
5
44
#include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define rep(i, l, r) for (ll i = l; i < r; i++) typedef long long ll; int main() { char s[200001]; scanf("%s", s); ll sum = 0; rep(i, 0, strlen(s)) { sum += s[0] - 48; sum %= 9; } if (sum == 0) { ...
#include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define rep(i, l, r) for (ll i = l; i < r; i++) typedef long long ll; int main() { char s[200001]; scanf("%s", s); ll sum = 0; rep(i, 0, strlen(s)) { sum += s[i] - 48; sum %= 9; } if (sum == 0) { ...
[["-", 0, 1, 0, 11, 12, 16, 31, 69, 71, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 69, 71, 22]]
0
104
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using P = pair<int, int>; int main() { string s; cin >> s; ll sum = 0; for (ll i = 0; i < s.length(); i++) { sum += int(s.at(i)); } if (sum % 9 == 0) cout << "Yes" << endl; else ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using P = pair<int, int>; int main() { string s; cin >> s; int sum = 0; for (ll i = 0; i < s.length(); i++) { sum += (s.at(i)) - '0'; } if (sum % 9 == 0) cout << "Yes" << endl; else...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 40], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
108
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using ld = long double; long double const pi = std::acos(-1.0L); typedef pair<int, int> P; int main() { string n; cin >> n; int num = 0; rep(i, n.size()) { num += (int)(n[i]); } num %= 9; if ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using ld = long double; long double const pi = std::acos(-1.0L); typedef pair<int, int> P; int main() { string n; cin >> n; int num = 0; rep(i, n.size()) { num += (int)(n[i] - '0'); } num %= 9;...
[["+", 0, 11, 12, 74, 51, 23, 0, 16, 17, 33], ["+", 12, 74, 51, 23, 0, 16, 12, 103, 0, 104], ["+", 12, 74, 51, 23, 0, 16, 12, 103, 0, 125]]
1
120
/* Welcome to my Code */ #include <bits/stdc++.h> #define ll long long int #define i(a, n) int a = n; #define l(a, n) ll a = n; #define d(a, n) double a = n; #define s(a) string a; #define c(a) \ ll a; ...
/* Welcome to my Code */ #include <bits/stdc++.h> #define ll long long int #define i(a, n) int a = n; #define l(a, n) ll a = n; #define d(a, n) double a = n; #define s(a) string a; #define c(a) \ ll a; ...
[["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 104], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125]]
1
246
#include <iostream> using namespace std; int main() { string N; int o = 0; cin >> N; int m = 0; for (int i = 0; i < N.size(); i++) m += N[i] - '0'; if (o % 9 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
#include <iostream> using namespace std; int main() { string N; cin >> N; int m = 0; for (int i = 0; i < N.size(); i++) m += N[i] - '0'; if (m % 9 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
90
#include <bits/stdc++.h> using namespace std; #define int int64_t #define pb push_back #define pi pair<int, int> #define pii pair<pi, int> #define fir first.first #define sec first.second #define ter second #define MAXN 100001 #define mod 1000000007 signed main() { string s; cin >> s; int ans = 0; for (int i ...
#include <bits/stdc++.h> using namespace std; #define int int64_t #define pb push_back #define pi pair<int, int> #define pii pair<pi, int> #define fir first.first #define sec first.second #define ter second #define MAXN 100001 #define mod 1000000007 signed main() { string s; cin >> s; int ans = 0; for (int i ...
[["-", 0, 1, 0, 41, 15, 23, 0, 16, 17, 98], ["-", 0, 41, 15, 23, 0, 16, 12, 16, 31, 22], ["-", 0, 41, 15, 23, 0, 16, 12, 16, 17, 20], ["-", 0, 41, 15, 23, 0, 16, 12, 16, 12, 13]]
1
109
#include <bits/stdc++.h> using namespace std; #define ll long long #define dbg puts("It's Just Begining.Wait For The End!!!!!\n") #define CHECK(x) cout << (#x) << " is " << (x) << "\n"; #define endl printf("\n") typedef pair<ll, ll> pii; #define pb push_back #define ms(a, b) memset(a, b, sizeof(a)) #define in(x) scanf(...
#include <bits/stdc++.h> using namespace std; #define ll long long #define dbg puts("It's Just Begining.Wait For The End!!!!!\n") #define CHECK(x) cout << (#x) << " is " << (x) << "\n"; #define endl printf("\n") typedef pair<ll, ll> pii; #define pb push_back #define ms(a, b) memset(a, b, sizeof(a)) #define in(x) scanf(...
[["-", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22]]
1
222
#include <stdio.h> #include <string.h> int main() { char a[200100]; long long int i, j = 0, k; gets(a); k = strlen(a); for (i = 0; i < k - 1; i++) { j += a[i] - '0'; } if (j % 9 == 0) { printf("Yes\n"); } else printf("No\n"); }
#include <stdio.h> #include <string.h> int main() { char a[200100]; long long int i, j = 0, k; gets(a); k = strlen(a); for (i = 0; i <= k - 1; i++) { j += a[i] - '0'; } if (j % 9 == 0) { printf("Yes\n"); } else printf("No\n"); }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
94
n=input() s=0 for i in n: s+=int(i) s=s%9 if s%9==0: print(Yes) else: print("No")
n=input() s=0 for i in n: s+=int(i) s=s%9 if s%9==0: print("Yes") else: print("No")
[["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
43
n = input() a = [i for i in n] if sum(a) % 9 == 0: print("Yes") else: print("No")
n = input() a = [int(i) for i in n] if sum(a) % 9 == 0: print("Yes") else: print("No")
[["+", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 25]]
5
38
n=input() print('Yes' if n%9==0 else 'No')
n=int(input()) print('Yes' if n%9==0 else 'No')
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
21
#include <bits/stdc++.h> #include <iterator> #define HAR BAR LAGTA HAI APUN HI J BHAGWAAN HAI !! #define ll long long int #define MAX 1e9 #define MIN -1e9 #define mod 1000000007 #define pb push_back #define all(x) (x).begin(), (x).end() #define debug(x) cerr << #x << '=' << (x) << endl; #define output(x) cout << (x ? "...
#include <bits/stdc++.h> #include <iterator> #define HAR BAR LAGTA HAI APUN HI J BHAGWAAN HAI !! #define ll long long int #define MAX 1e9 #define MIN -1e9 #define mod 1000000007 #define pb push_back #define all(x) (x).begin(), (x).end() #define debug(x) cerr << #x << '=' << (x) << endl; #define output(x) cout << (x ? "...
[["-", 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
125
#include <bits/stdc++.h> #include <map> #include <set> #include <vector> using namespace std; #define mod 1000000007 #define ll long long #define ff first #define ss second #define E endl; #define PII pair<int, int> #define PCI pair<char, int> #define PLL pair<ll, ll> #define O " " #define ghur(i, n) for (int i = 0; ...
#include <bits/stdc++.h> #include <map> #include <set> #include <vector> using namespace std; #define mod 1000000007 #define ll long long #define ff first #define ss second #define E endl; #define PII pair<int, int> #define PCI pair<char, int> #define PLL pair<ll, ll> #define O " " #define ghur(i, n) for (int i = 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
365
#include <bits/stdc++.h> #include <climits> #include <cmath> #include <iomanip> #include <iterator> #include <unordered_map> using namespace std; using LL = long long; using ULL = unsigned long long; using PII = pair<int, int>; using PIL = pair<int, LL>; using PLL = pair<LL, LL>; // const int mod = 1e9 + 7; #define ...
#include <bits/stdc++.h> #include <climits> #include <cmath> #include <iomanip> #include <iterator> #include <unordered_map> using namespace std; using LL = long long; using ULL = unsigned long long; using PII = pair<int, int>; using PIL = pair<int, LL>; using PLL = pair<LL, LL>; // const int mod = 1e9 + 7; #define ...
[["-", 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, 0, 16, 31, 16, 12, 5, 0, 6]]
1
322
#include <bits/stdc++.h> using namespace std; #define lli long long int int main() { string s; lli i, a, ans = 0; cin >> s; a = s.length(); for (i = 0; i < a; i++) { ans += s[i] - 46; ans %= 9; } if (ans % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; #define lli long long int int main() { string s; lli i, a, ans = 0; cin >> s; a = s.length(); for (i = 0; i < a; i++) { ans += s[i] - 48; } if (ans % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 132], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
91
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; int main() { string s; cin >> s; ll dd = 0; int d = s.size(); for (int i = 0; i < d; i++) { dd += s[i] - '0'; } if (dd % 9 == 0) cout << "YES\n"; else cout << "NO\n"; return ...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; int main() { string s; cin >> s; ll dd = 0; int d = s.size(); for (int i = 0; i < d; i++) { dd += s[i] - '0'; } if (dd % 9 == 0) cout << "Yes\n"; else cout << "No\n"; return ...
[["-", 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
95
#include <stdio.h> int main() { char *s; scanf("%s", s); int len = strlen(s); int sum = 0; for (int i = 0; i < len; i++) sum += s[i] - '0'; if (sum % 9 == 0) { puts("Yes"); } else { puts("No"); } }
#include <stdio.h> int main() { char s[200001]; scanf("%s", s); int len = strlen(s); int sum = 0; for (int i = 0; i < len; i++) sum += s[i] - '0'; if (sum % 9 == 0) { puts("Yes"); } else { puts("No"); } }
[["-", 0, 14, 8, 9, 0, 43, 49, 84, 0, 48], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 70], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 73]]
0
86
n = input() s = sum([i for i in n]) if s%9==0: print("Yes") else: print("No")
n = input() s = sum([int(i) for i in n]) if s%9==0: print("Yes") else: print("No")
[["+", 12, 652, 3, 4, 0, 658, 8, 652, 63, 22], ["+", 3, 4, 0, 658, 8, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 658, 8, 652, 3, 4, 0, 25]]
5
38
import java.io.*; class Main { BufferedReader bf; PrintWriter writer; StringBuilder sb; static boolean local_system = false; void run() throws IOException { char[] d = bf.readLine().trim().toCharArray(); int v = 0; for (char e : d) v = (v + (e - '0')) % 9; writer.print(v == 0 ? "YES" :...
import java.io.*; class Main { BufferedReader bf; PrintWriter writer; StringBuilder sb; static boolean local_system = false; void run() throws IOException { char[] d = bf.readLine().trim().toCharArray(); int v = 0; for (char e : d) v = (v + (e - '0')) % 9; writer.print(v == 0 ? "Yes" :...
[["-", 0, 492, 3, 4, 0, 510, 64, 5, 0, 491], ["+", 0, 492, 3, 4, 0, 510, 64, 5, 0, 491], ["-", 0, 492, 3, 4, 0, 510, 75, 5, 0, 491], ["+", 0, 492, 3, 4, 0, 510, 75, 5, 0, 491]]
3
435
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n = sc.next(); long sum = 0; for (int i = 0; i < n.length(); i++) { sum += n.charAt(i); } System.out.println((sum % 9 == 0) ? "Yes" : "No"); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n = sc.next(); long sum = 0; for (int i = 0; i < n.length(); i++) { sum += (n.charAt(i) - '0'); } System.out.println((sum % 9 == 0) ? "Yes" : "No"); } }
[["+", 8, 196, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 492, 3, 4, 0, 25], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 12, 252]]
3
101
#include <bits/stdc++.h> #define ll long long int #define pb(i) push_back(i) using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t = 1; // cin>>t; while (t--) { string str; cin >> str; int sum = 0; for (int i = 0; i < str.size() - 1; i++) sum += str.at(...
#include <bits/stdc++.h> #define ll long long int #define pb(i) push_back(i) using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t = 1; // cin>>t; while (t--) { string str; cin >> str; int sum = 0; for (int i = 0; i < str.size(); i++) sum += str.at(i) -...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
116
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <string> #include <vector> #define ll long long #define PI 3.14159265358979323846 #define rep(i, n) for (ll i = 0; i < (ll)n; i++) #define rep1(x, n) for (l...
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <string> #include <vector> #define ll long long #define PI 3.14159265358979323846 #define rep(i, n) for (ll i = 0; i < (ll)n; i++) #define rep1(x, n) for (l...
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25]]
1
112
#include <bits/stdc++.h> using namespace std; string s; int tot = 0; int main() { cin >> s; for (int i = 0; i < s.size(); i++) { tot += s[i] - '0'; } if (tot % 9 == 0) { printf("YES"); } else { printf("NO"); } }
#include <bits/stdc++.h> using namespace std; string s; int tot = 0; int main() { cin >> s; for (int i = 0; i < s.size(); i++) { tot += s[i] - '0'; } if (tot % 9 == 0) { printf("Yes"); } else { printf("No"); } }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
82
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define SZ(X) ((int)(X).size()) #define endl "\n"; int main() { ios::sync_with_stdio(0); cin.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); string s; cin >> s; int sum = 0; for (int i...
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define SZ(X) ((int)(X).size()) #define endl "\n"; int main() { ios::sync_with_stdio(0); cin.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); string s; cin >> s; int sum = 0; for (int i...
[["-", 0, 11, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 22]]
1
115
#include <iostream> using namespace std; int main() { string p; cin >> p; int l = 0; for (int i = 0; p[i]; i++) { l += p[i]; l = l % 9; } if (l == 0) { cout << "Yes"; } else { cout << "No"; } }
#include <iostream> using namespace std; int main() { string p; cin >> p; int l = 0; for (int i = 0; p[i]; i++) { l += p[i] - '0'; l = l % 9; } if (l == 0) { cout << "Yes"; } else { cout << "No"; } }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
77
def main(): num = int(input()) if num & 9 == 0: return 'Yes' else: return 'No' if __name__ == '__main__': ans = main() print(ans)
def main(): num = int(input()) if num % 9 == 0: return 'Yes' else: return 'No' if __name__ == '__main__': ans = main() print(ans)
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 67], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 109]]
5
46
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using namespace std; int main() { string s; cin >> s; ll total = 0; rep(i, s.size()) { total += ll(s[i]); } if (total % 9 == 0) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using namespace std; int main() { string s; cin >> s; ll total = 0; rep(i, s.size()) { total += int(s[i]) - 48; } if (total % 9 == 0) cout << "Yes"; else cout << "No"; }
[["-", 0, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 40], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
82
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String n = in.next(); long sum = 0; for (int i = 0; i < n.length(); i++) { int num = n.charAt(i) - '0'; sum = sum + num; } if (sum % 9 == 0) { Sy...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String n = in.next(); long sum = 0; for (int i = 0; i < n.length(); i++) { int num = n.charAt(i) - '0'; sum = sum + num; } if (sum % 9 == 0) { Sy...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
122
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); char[] ch = new char[str.length()]; int[] n = new int[str.length()]; int nSum = 0; for (int i = 0; i < str.length(); i++) { ch[i] = str.ch...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); char[] ch = new char[str.length()]; int[] n = new int[str.length()]; int nSum = 0; for (int i = 0; i < str.length(); i++) { ch[i] = str.cha...
[["+", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 0, 131], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 141, 22], ["+", 0, 1, 0, 11, 12, 492, 3, 4, 0, 24], ["+", 0, 1, 0, 11, 12, 492, 3, 4, 0, 25]]
3
163
#include <iostream> using namespace std; int main() { string t; unsigned long long int a = 0; cin >> t; for (unsigned long long int i = 0; i < t.size(); i++) { a = a + ((unsigned long long int)t[i]) - 48; } cout << a; if (a % 9 == 0) { cout << "Yes" << "\n"; } else { cout << "No" ...
#include <iostream> using namespace std; int main() { string t; unsigned long long int a = 0; cin >> t; for (unsigned long long int i = 0; i < t.size(); i++) { a = a + ((unsigned long long int)t[i]) - 48; } if (a % 9 == 0) { cout << "Yes" << "\n"; } else { cout << "No" << "\...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
106
#include <bits/stdc++.h> using namespace std; #define dfl(i, a, b) for (int i = a; i > b; i--) #define fl(i, a, b) for (int i = a; i < b; i++) #define ll long long #define ld long double #define endl '\n' #define pb push_back #define ff first #define ss second #define pii pair<int, int> #define pll pair<ll, ll> #defin...
#include <bits/stdc++.h> using namespace std; #define dfl(i, a, b) for (int i = a; i > b; i--) #define fl(i, a, b) for (int i = a; i < b; i++) #define ll long long #define ld long double #define endl '\n' #define pb push_back #define ff first #define ss second #define pii pair<int, int> #define pll pair<ll, ll> #defin...
[["-", 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
278
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s; cin >> s; vector<int> v; for (int i = 0; i < s.size(); i++) { v.push_back(s[i] - '0'); } int x = 0; for (int i = 0; i < v.size(); i++) x = x + v[i]; if (x % 9 == 0) cout << "YES" << endl; else cou...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s; cin >> s; vector<int> v; for (int i = 0; i < s.size(); i++) { v.push_back(s[i] - '0'); } int x = 0; for (int i = 0; i < v.size(); i++) x = x + v[i]; if (x % 9 == 0) cout << "Yes" << endl; else cou...
[["-", 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, 0, 16, 31, 16, 12, 5, 0, 6]]
1
122
// author -> LetsGoAC #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 ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
// author -> LetsGoAC #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 ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
[["-", 8, 1, 0, 11, 12, 23, 0, 42, 0, 32], ["+", 8, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
740
n=input() x=sum([int(n[i]) for i in range(len(n))]) if x!=0 and x%9==0: print('Yes') else: print('No')
n=input() x=sum([int(n[i]) for i in range(len(n))]) if x%9==0: print('Yes') else: print('No')
[["-", 0, 656, 0, 57, 15, 679, 31, 666, 667, 79], ["-", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612], ["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["-", 0, 57, 15, 679, 12, 666, 0, 657, 31, 22]]
5
54
n = list(map(int, input())) if stm(n)%9==0: print('Yes') else: print('No')
n = list(map(int, input())) if sum(n)%9==0: print('Yes') else: print('No')
[["-", 0, 57, 15, 666, 0, 657, 31, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 657, 31, 652, 63, 22]]
5
37
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; long long size = N.size(); long long count = 0; for (long long i = 0; i < size; i++) { count += N.at(i); } if (N == "0") { cout << "Yes"; } else if (count % 9 == 0) { cout << "Yes"; } else { cout << "No"; ...
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; long long size = N.size(); long long count = 0; for (long long i = 0; i < size; i++) { count += (N.at(i) - 48); } if (N == "0") { cout << "Yes"; } else if (count % 9 == 0) { cout << "Yes"; } else { cout << ...
[["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13]]
1
103
#include <bits/stdc++.h> using namespace std; #define josh 0 #define ll long long #define llu long long unsigned #define ii pair<int, int> #define iii pair<int, ii> #define all(v) (v).begin(), (v).end() #define vout(v) \ for (auto i : v) ...
#include <bits/stdc++.h> using namespace std; #define josh 0 #define ll long long #define llu long long unsigned #define ii pair<int, int> #define iii pair<int, ii> #define all(v) (v).begin(), (v).end() #define vout(v) \ for (auto i : v) ...
[["-", 0, 2, 3, 4, 0, 41, 75, 5, 0, 6], ["+", 0, 2, 3, 4, 0, 41, 75, 5, 0, 6]]
1
550
#include <iostream> #include <string> using namespace std; int main() { int a; int64_t i; string s; a = 0; cin >> s; for (i = 0; i < s.size(); i++) { a += (s[i] - '0'); } if (a % 9 == 0 && a >= 9) { cout << "Yes"; } else { cout << "No"; } }
#include <iostream> #include <string> using namespace std; int main() { int a; uint64_t i; string s; a = 0; cin >> s; for (i = 0; i < s.size(); i++) { a += (s[i] - '0'); } if (a % 9 == 0 && a >= 9 || a == 0) { cout << "Yes"; } else { cout << "No"; } }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
92
p gets.to_i%9<1?:Yes: :No
puts gets.to_i%9<1?:Yes: :No
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
12
def digital_root(n): return n if n < 10 else digital_root(sum(map(int,str(n)))) n = input() if(digital_root(n) % 9 == 0): print("Yes") else: print("No")
def digital_root(n): return n if n < 10 else digital_root(sum(map(int,str(n)))) n = int(input()) if(digital_root(n) % 9 == 0): print("Yes") else: print("No")
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
59
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mp make_pair //#define vi vector<int> #define vb vector<bool> #define pii pair<int, int> #define mii map<int, int> #define all(c) c.begin(), c.end() #define rall(c) c.rbegin(), c.rend() #define tr(container, it) ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mp make_pair //#define vi vector<int> #define vb vector<bool> #define pii pair<int, int> #define mii map<int, int> #define all(c) c.begin(), c.end() #define rall(c) c.rbegin(), c.rend() #define tr(container, it) ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
375
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long int M = 1e9 + 7; using namespace std; int main() { ull sum = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) sum += (int)(s[i] - 48); if (sum % 9) cout << "NO"; else cout << "YES"; }
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long int M = 1e9 + 7; using namespace std; int main() { ll sum = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) sum += (int)(s[i] - 48); if (sum % 9) cout << "No"; else cout << "Yes"; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 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
88
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; int len = a.length(); int sum = 0; for (int i = 0; i < len; i++) { sum += a[i]; } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; int len = a.length(); int sum = 0; for (int i = 0; i < len; i++) { sum += a[i] - '0'; } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
80
n=input() wk=0 for i in range(len(n)): wk+=int(n[i]) if wk%9==0 and wk!=0: print('Yes') else: print('No')
n=input() wk=0 for i in range(len(n)): wk+=int(n[i]) if wk%9==0: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 667, 79], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
53
#include <algorithm> // アルゴリズム #include <cmath> // #include <iostream> #include <map> // map #include <set> // set #include <sstream> // istringstream #include <string> // 文字列 #include <vector> // vector using namespace std; int main() { // input sample string N; cin >> N; // for (int i = 0; i <...
#include <algorithm> // アルゴリズム #include <cmath> // #include <iostream> #include <map> // map #include <set> // set #include <sstream> // istringstream #include <string> // 文字列 #include <vector> // vector using namespace std; int main() { // input sample string N; cin >> N; // for (int i = 0; i <...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
116
N = str(input()) L = list(N) r = 0 for l in L: r = r + int(l) m = r % 9 if m == 0: print('yes') else: print('no')
N = str(input()) L = list(N) r = 0 for l in L: r = r + int(l) m = r % 9 if m == 0: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
54
import java.util.*; class Main { public static void main(String args[]) { int i, s = 0; String n; Scanner sc = new Scanner(System.in); n = sc.next(); for (i = 0; i < n.length(); i++) s += n.charAt(i); if (s % 9 == 0) System.out.println("Yes"); else System.out.println("No"...
import java.util.*; class Main { public static void main(String args[]) { int i, s = 0; String n; Scanner sc = new Scanner(System.in); n = sc.next(); for (i = 0; i < n.length(); i++) s += n.charAt(i) - '0'; if (s % 9 == 0) System.out.println("Yes"); else System.out.printl...
[["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 252]]
3
109
#include <bits/stdc++.h> using namespace std; int main() { char a[200050]; long long int b = 0; cin >> a; for (int i = 0; i < strlen(a); i++) b += a[i] - '0'; if (b % 9) cout << 'No'; else cout << 'Yes'; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char a[200050]; long long int b = 0; cin >> a; for (int i = 0; i < strlen(a); i++) b += a[i] - '0'; if (b % 9) cout << "No"; else cout << "Yes"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 103, 0, 104], ["-", 0, 57, 64, 1, 0, 16, 12, 103, 0, 125], ["-", 64, 1, 0, 16, 12, 103, 0, 42, 0, 22], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 62], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 103, 0, 104], ["-", 75, 76, 0, 1, 0, 16, 12, 103, 0, 125], ["-", 0, 1, ...
1
81
# your code goes here n=input() sum=0 for i in n: sum+=int(i) if(sum%9==0): print("YES") else: print("NO")
# your code goes here n=input() sum=0 for i in n: sum+=int(i) if(sum%9==0): print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
43
#include <bits/stdc++.h> using namespace std; #define freop \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); #define st string typedef long long ll; int sm(ll x) { if (x == 0) { ...
#include <bits/stdc++.h> using namespace std; #define freop \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); #define st string typedef long long ll; int sm(ll x) { if (x == 0) { ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
160
#include <iostream> #include <string.h> using namespace std; int main() { string s; int i; int sum = 0; cin >> s; for (i = 0; i < s.length(); i++) { sum = sum + (s[i] - '0'); } cout << sum; if (sum % 9 == 0) cout << "Yes"; else cout << "No"; }
#include <iostream> #include <string.h> using namespace std; int main() { string s; int i; int sum = 0; cin >> s; for (i = 0; i < s.length(); i++) { sum = sum + (s[i] - '0'); } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
88
#include <bits/stdc++.h> using namespace std; int main() { string n; int c = 0; int t; cin >> n; for (int i = 0; i < n.size(); i++) { t = (int)n.at(i) - 48; cout << t; c += t; } if (c % 9 == 0) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> using namespace std; int main() { string n; int c = 0; int t; cin >> n; for (int i = 0; i < n.size(); i++) { t = (int)n.at(i) - 48; c += t; } if (c % 9 == 0) cout << "Yes"; else cout << "No"; }
[["-", 0, 7, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
90
#include <bits/stdc++.h> using namespace std; using str = string; using ll = long long; #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 FOR(i, f, t) for (int i = int(f); i <= int(t); i++) #define RFOR(i, f, t) for (int i = int(f); i >= int(t); i--) #de...
#include <bits/stdc++.h> using namespace std; using str = string; using ll = long long; #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 FOR(i, f, t) for (int i = int(f); i <= int(t); i++) #define RFOR(i, f, t) for (int i = int(f); i >= int(t); i--) #de...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13]]
1
155
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double dd; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; const int mx = 1e6 + 11; const double PI = acos(-1); #define MOD 1000000007 #define nl '\n' #define pb push_back #define F ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double dd; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; const int mx = 1e6 + 11; const double PI = acos(-1); #define MOD 1000000007 #define nl '\n' #define pb push_back #define F ...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
289
s = input() n = 0 for i in range(len(s)-1): n += int(s[i:i+1]) if n % 9 == 0: print("Yes") else: print("No")
s = input() n = 0 for i in range(len(s)): n += int(s[i:i+1]) if n % 9 == 0: print("Yes") else: print("No")
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
55
#include <bits/stdc++.h> using namespace std; void solve() { string s; int n, res = 0; cin >> s; n = s.length(); for (int i = 0; i < n; i++) res += s[i] - '0'; if (res % 9) cout << "NO" << "\n"; else cout << "YES" << "\n"; } int main() { ios::sync_with_stdio(false); sol...
#include <bits/stdc++.h> using namespace std; void solve() { string s; int n, res = 0; cin >> s; n = s.length(); for (int i = 0; i < n; i++) res += s[i] - '0'; if (res % 9) cout << "No" << "\n"; else cout << "Yes" << "\n"; } int main() { ios::sync_with_stdio(false); sol...
[["-", 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, 0, 16, 31, 16, 12, 5, 0, 6]]
1
106
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here string s; cin >> s; int x = 0; for (int i = 0; i < s.length(); ++i) { x += s[i]; } string ans = (x % 9 == 0 ? "Yes" : "No"); cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here string s; cin >> s; int x = 0; for (int i = 0; i < s.length(); ++i) { x += (s[i] - '0'); } string ans = (x % 9 == 0 ? "Yes" : "No"); cout << ans; return 0; }
[["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 104], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]]
1
78
#include <bits/stdc++.h> using namespace std; #define fast_IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl '\...
#include <bits/stdc++.h> using namespace std; #define fast_IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl '\...
[["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 104], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]]
1
197
#include <bits/stdc++.h> #include <map> using namespace std; /** defines and macros */ #define ll long long #define ull unsigned long long #define loop(n) for (int i = 0; i < n; i++) #define loop1(n) for (int i = 1; i <= n; i++) #define all(v) (v.begin(), v.end()) #define vi vector<int> #define pii pair<int, int> #def...
#include <bits/stdc++.h> #include <map> using namespace std; /** defines and macros */ #define ll long long #define ull unsigned long long #define loop(n) for (int i = 0; i < n; i++) #define loop1(n) for (int i = 1; i <= n; i++) #define all(v) (v.begin(), v.end()) #define vi vector<int> #define pii pair<int, int> #def...
[["-", 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
150
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long length, num = 0; length = s.length(); for (long i = 0; i < length; i++) { int k = s[i] - '0'; num += k; num = num % 9; } if (num % 9 == 0) cout << "YES" << endl; else cout << "NO" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long length, num = 0; length = s.length(); for (long i = 0; i < length; i++) { int k = s[i] - '0'; num += k; num = num % 9; } if (num % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
[["-", 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, 0, 16, 31, 16, 12, 5, 0, 6]]
1
98
#include <bits/stdc++.h> using namespace std; using ll = long long; #define fr(i, n) for (int i = 0; i < (n); ++i) #define Fr(i, n) for (int i = 1; i <= (n); ++i) #define ifr(i, n) for (int i = (n)-1; i >= 0; --i) #define iFr(i, n) for (int i = (n); i > 0; --i) int main() { cin.tie(nullptr); ios::sync_with_stdio(f...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define fr(i, n) for (int i = 0; i < (n); ++i) #define Fr(i, n) for (int i = 1; i <= (n); ++i) #define ifr(i, n) for (int i = (n)-1; i >= 0; --i) #define iFr(i, n) for (int i = (n); i > 0; --i) int main() { cin.tie(nullptr); ios::sync_with_stdio(f...
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
119
N =int(input()) lst = [] N = str(N) list_num = list(N) N = [int(s) for s in list_num] ans = sum(N) if ans % 9 == 0: print("yes") else: print("No")
N =int(input()) lst = [] N = str(N) list_num = list(N) N = [int(s) for s in list_num] ans = sum(N) if ans % 9 == 0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
63
number = list(map(int,list(input()))) if sum(number)%9==0: print("YES") else: print("NO")
number = list(map(int,list(input()))) if sum(number)%9==0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
40
//#pragma GCC optimize "trapv" #include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define rand rng #define fios \ ios::sync_with_stdio(0); ...
//#pragma GCC optimize "trapv" #include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define rand rng #define fios \ ios::sync_with_stdio(0); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 338, 49, 352, 0, 67], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
114
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; if (n == "0") { cout << "Yes" << endl; return 0; } int cnt = 0; for (int i = 0; i < n.size(); i++) { cnt += n[i]; } if (cnt % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; if (n == "0") { cout << "Yes" << endl; return 0; } int cnt = 0; for (int i = 0; i < n.size(); i++) { cnt += n[i] - '0'; } if (cnt % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; return 0; ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
100
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define NUM 1000000007 #define MAX 100001 #define INF LLONG_MAX bool check(string s) { int n = s.length(); int sum = 0; for (int i = 0; i < n; i++) sum += (s[i] - '0'); return (sum % 9 == 0); } int main() { ios_base::s...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define NUM 1000000007 #define MAX 100001 #define INF LLONG_MAX bool check(string s) { int n = s.length(); int sum = 0; for (int i = 0; i < n; i++) sum += (s[i] - '0'); return (sum % 9 == 0); } int main() { ios_base::s...
[["-", 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, 0, 16, 31, 16, 12, 5, 0, 6]]
1
140
def nine(): N=int(input()) if N%9 != 0: return False else: t=(i for i in str(N)) sum=0 for i in t: sum+=int(i) if sum%9 == 0: return True print(nine())
def nine(): N=int(input()) if N%9 != 0: return "No" else: t=(i for i in str(N)) sum=0 for i in t: sum+=int(i) if sum%9 == 0: return "Yes" print(nine())
[["-", 8, 196, 0, 57, 64, 196, 0, 37, 0, 147], ["+", 0, 57, 64, 196, 0, 37, 0, 557, 0, 654], ["+", 0, 57, 64, 196, 0, 37, 0, 557, 0, 6], ["+", 0, 57, 64, 196, 0, 37, 0, 557, 0, 655], ["-", 8, 196, 0, 57, 64, 196, 0, 37, 0, 146]]
5
65
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.nextLine(); int min; int anc = 0; for (int i = 0; i < N.length(); i++) { min = (int)N.charAt(i); anc += min; } if (anc / 9 == 0) { System.ou...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.nextLine(); int min; int anc = 0; for (int i = 0; i < N.length(); i++) { min = (int)N.charAt(i); min -= 48; anc += min; } if (anc % 9 == 0) ...
[["+", 0, 7, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 17, 110], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 12, 499], ["+", 8, 196, 0, 7, 8, 196, 0, 1, 0, 35], ["-", 0, 57, 15, 15, 0, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 17, 109]]
3
123
#include <iostream> #include <map> #include <string> using namespace std; int main() { string s; cin >> s; int digit_sum = 0; int l = s.length(); for (int i = 0; i < l; ++i) { digit_sum += (s[i] - '0'); } cout << (!digit_sum || digit_sum % 9 ? "No" : "Yes"); }
#include <iostream> #include <map> #include <string> using namespace std; int main() { string s; cin >> s; int digit_sum = 0; int l = s.length(); for (int i = 0; i < l; ++i) { digit_sum += (s[i] - '0'); } cout << (digit_sum % 9 ? "No" : "Yes"); }
[["-", 12, 23, 0, 41, 15, 16, 31, 91, 17, 111], ["-", 0, 16, 12, 23, 0, 41, 15, 16, 17, 106], ["-", 12, 23, 0, 41, 15, 16, 12, 16, 31, 22]]
1
85
### 数列をいったん文字列に変換 numberString = input() print(numberString) sumNumber = 0 ### 文字列を分割、整数化 for i in range(len(numberString)): sumNumber += int(numberString[i]) ### 和を9を法とする式で計算。 if sumNumber % 9 == 0: print("Yes") else: print("No")
### 数列をいったん文字列に変換 numberString = input() sumNumber = 0 ### 文字列を分割、整数化 for i in range(len(numberString)): sumNumber += int(numberString[i]) ### 和を9を法とする式で計算。 if sumNumber % 9 == 0: print("Yes") else: print("No")
[["-", 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
56
#include <algorithm> //辞書順=next_permutation #include <cmath> #include <complex> #include <iomanip> #include <iostream> #include <locale> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stdio.h> #include <string.h> #include <string> //char 小文字のほうが32大きい #include <time.h> #...
#include <algorithm> //辞書順=next_permutation #include <cmath> #include <complex> #include <iomanip> #include <iostream> #include <locale> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stdio.h> #include <string.h> #include <string> //char 小文字のほうが32大きい #include <time.h> #...
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
791
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i < (int)(n); i++) typedef long long ll; using namespace std; int main() { string n; cin >> n; ll sum = 0; rep(i, n.length()) { sum += n[i] - '0'; } if (sum % 9 == 0) { cout << "yes" << endl;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i < (int)(n); i++) typedef long long ll; using namespace std; int main() { string n; cin >> n; ll sum = 0; rep(i, n.length()) { sum += n[i] - '0'; } if (sum % 9 == 0) { cout << "Yes" << endl;...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
101
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String s = scan.next(); long sum = 0; for (int i = 0; i < s.length(); i++) { int a = s.charAt(i); sum += a; } if (sum % 9 == 0) { System.out.println(...
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String s = scan.next(); long sum = 0; for (int i = 0; i < s.length(); i++) { int a = Character.getNumericValue(s.charAt(i)); sum += a; } if (sum % 9 == 0) {...
[["+", 8, 196, 0, 503, 49, 200, 51, 492, 500, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 0, 131], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 24], ["+", 51, 492, 3, 4, 0, 492, 3, 4, 0, 25]]
3
118
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String s = scan.next(); long sum = 0; for (int i = 0; i < s.length(); i++) { int a = s.charAt(i); sum += a; } if (sum % 9 == 0) { System.out.println(...
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String s = scan.next(); long sum = 0; for (int i = 0; i < s.length(); i++) { int a = s.charAt(i) - '0'; sum += a; } if (sum % 9 == 0) { System.out.pr...
[["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 33], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 252]]
3
118
if int(input())%9: print("NO") else: print("YES")
if int(input())%9: print("No") else: print("Yes")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
24
#include <algorithm> #include <cstdlib> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <typeinfo> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define INF 1001001 using namespace std; int main() { string s; int n = 0, result = 0; cin >> s; for (int i = ...
#include <algorithm> #include <cstdlib> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <typeinfo> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define INF 1001001 using namespace std; int main() { string s; int n = 0, result = 0; cin >> s; for (int i = ...
[["-", 12, 74, 51, 23, 0, 2, 63, 118, 119, 120], ["+", 12, 74, 51, 23, 0, 2, 63, 118, 119, 120], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
131
#include <bits/stdc++.h> #define pb push_back #define wrln cout << '\n'; using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int d = 0; int f[100]; for (int i = '0'; i <= '9'; i++) { f[i] = d++; } char a; string s; cin >> s; int sum = 0; for (auto a : s)...
#include <bits/stdc++.h> #define pb push_back #define wrln cout << '\n'; using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int d = 0; int f[100]; for (int i = '0'; i <= '9'; i++) { f[i] = d++; } char a; string s; cin >> s; int sum = 0; for (auto a : s)...
[["-", 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
130
#include <cctype> #include <iostream> #include <sstream> #include <string> using namespace std; int main() { string s; cin >> s; long long x = 0; long long n = s.length(); for (int i = 0; i < n; i++) x += (int)s[i] - '0'; if (x % 9 == 0) cout << "YES"; else cout << "NO"; }
#include <cctype> #include <iostream> #include <sstream> #include <string> using namespace std; int main() { string s; cin >> s; long long x = 0; long long n = s.length(); for (int i = 0; i < n; i++) x += (int)s[i] - '0'; if (x % 9 == 0) cout << "Yes"; else cout << "No"; }
[["-", 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
90
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> pii; #define endl "\n" #define sd(val) scanf("%d", &val) #define ss(val) scanf("%s", &val) #define sl(val) scanf("%lld", &val) #define debug(val) printf("check%d\n", val) #define all(v) v.begin(), v.end() #define PB push_back ...
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> pii; #define endl "\n" #define sd(val) scanf("%d", &val) #define ss(val) scanf("%s", &val) #define sl(val) scanf("%lld", &val) #define debug(val) printf("check%d\n", val) #define all(v) v.begin(), v.end() #define PB push_back ...
[["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
183
#include <bits/stdc++.h> using namespace std; #define MAXN 200005 char a[MAXN]; int main() { long long ans = 0; scanf("%s", a); for (int i = 0; i < strlen(a); i++) ans == a[i] - '0'; if (ans % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; #define MAXN 200005 char a[MAXN]; int main() { long long ans = 0; scanf("%s", a); for (int i = 0; i < strlen(a); i++) ans += a[i] - '0'; if (ans % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
[["-", 8, 9, 0, 7, 8, 1, 0, 16, 17, 60], ["+", 8, 9, 0, 7, 8, 1, 0, 11, 17, 107]]
1
89
#include <bits/stdc++.h> using namespace std; int ctoi(char c) { switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case...
#include <bits/stdc++.h> using namespace std; int ctoi(char c) { switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
189
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; int X = 0; int l = N.size(); for (int i = 0; i < l; i++) X += N.at(i); if (X % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; int X = 0; int l = N.size(); for (int i = 0; i < l; i++) X += N.at(i) - '0'; if (X % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
[["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 8, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
81
def digitSum(n): s = str(n) array = list(map(int, s)) return sum(array) a= int(input()) if digitSum(a) % 9 == 0: print(Yes) else: print(No)
def digitSum(n): s = str(n) array = list(map(int, s)) return sum(array) N = int(input()) if digitSum(N) % 9 == 0: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 15, 666, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
56
#include <bits/stdc++.h> using namespace std; #define take \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); \ freopen("error.txt", "w", std...
#include <bits/stdc++.h> using namespace std; #define take \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); \ freopen("error.txt", "w", std...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
111
N = line(input().rstrip()) sum = 0 for i in range(len(N)): sum += int(N[i]) if sum % 9 == 0: print("Yes") else: print("No")
N = list(input().rstrip()) sum = 0 for i in range(len(N)): sum += int(N[i]) if sum % 9 == 0: print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
56
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); long t = 0; long sum = 0; while (t < s.length()) { int num = Integer.parseInt(String.valueOf(s.charAt((int)t))); sum = sum + num; t++...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); long t = 0; long sum = 0; while (t < s.length()) { int num = Integer.parseInt(String.valueOf(s.charAt((int)t))); sum = sum + num; t++...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
133
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b)...
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b)...
[["+", 0, 43, 49, 50, 51, 16, 12, 103, 0, 104]]
1
281
#include <bits/stdc++.h> using namespace std; char n; int main() { int sum = 0; while (cin >> n) { n = (int)n; sum = sum + n; } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; char n; int main() { int sum = 0; while (cin >> n) { n = (int)n; sum = sum + n - 48; } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
65
#include <bits/stdc++.h> using namespace std; inline int rd() { int x = 0; bool f = 0; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = 1; c = getchar(); } while (isdigit(c)) { x = x * 10 + (c ^ 48); c = getchar(); } return f ? -x : x; } char s[20000007]; int main() {...
#include <bits/stdc++.h> using namespace std; inline int rd() { int x = 0; bool f = 0; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = 1; c = getchar(); } while (isdigit(c)) { x = x * 10 + (c ^ 48); c = getchar(); } return f ? -x : x; } char s[2000007]; int main() { ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 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]]
1
176
#include <bits/stdc++.h> using namespace std; #define ll long long bool fun(string s, ll l) { ll sum = 0, i = 0; while (i < l) { sum += (s[i] - '0'); i++; } if (sum % 9 == 0) return 1; else return 0; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s; ...
#include <bits/stdc++.h> using namespace std; #define ll long long bool fun(string s, ll l) { ll sum = 0, i = 0; while (i < l) { sum += (s[i] - '0'); i++; } if (sum % 9 == 0) return 1; else return 0; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s; ...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
136
n = int(input()) a = sum(list(str(n))) if a%9==0: print("Yes") else: print("No")
n = int(input()) a = sum(list(map(int,str(n)))) if a%9==0: print("Yes") else: print("No")
[["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
41
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { string n; cin >> n; int res = 0; for (int i = 0; i < n.size(); i++) res += n[i]; if (res % 9) puts("No"); else puts("Yes"); return 0; }
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { string n; cin >> n; int res = 0; for (int i = 0; i < n.size(); i++) res += n[i] - '0'; if (res % 9) puts("No"); else puts("Yes"); return 0; }
[["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 8, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
77
#include <bits/stdc++.h> #define ll long long int using namespace std; int main() { string s; cin >> s; ll l = s.size(); ll sum = 0; for (int i = 0; i < l; i++) { sum += int(s[i]); } if (sum % 9 == 0) { cout << "Yes"; } else cout << "No"; }
#include <bits/stdc++.h> #define ll long long int using namespace std; int main() { string s; cin >> s; ll l = s.size(); ll sum = 0; for (int i = 0; i < l; i++) { sum += int(s[i]) - 48; } // cout<<sum<<endl; if (sum % 9 == 0) { cout << "Yes"; } else cout << "No"; }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
85
#include <bits/stdc++.h> using namespace std; int main() { long long c, a; string n; cin >> n; for (long long i = 0; i < n.size(); i++) { c = n[0] - 48; a += c; } if (a % 9 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long c, a = 0; string n; cin >> n; for (long long i = 0; i < n.size(); i++) { c = n[i] - 48; a += c; } if (a % 9 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 11, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 22]]
1
91
import sys def main(): N = int(input()) if N%9 == 0 : print("yes") else: print("No") if __name__ == "__main__": main()
import sys def main(): N = int(input()) if N%9 == 0 : print("Yes") else: print("No") if __name__ == "__main__": main()
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
46
n=int(input()) l=[] for i in range(len(str(n))): l.append(int(n[i])) if((sum(l)%9)==0): print("Yes") else: print("No")
n=input() l=[] for i in range(len(str(n))): l.append(int(n[i])) if((sum(l)%9)==0): print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
66