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
change_count
int64
0
100
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { int a[101], m, x, y; bool b; m = 0; memset(a, 0, sizeof(int) * 101); while (cin >> x >> y) { if (!x && !y) { if (a[1] & 1 && a[2] & 1) { for (int i = 3; i <= m; i++) { if (a[i] & 1) { ...
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { int a[101], m, x, y; bool b; m = 0; memset(a, 0, sizeof(int) * 101); while (cin >> x >> y) { if (!x && !y) { if (a[1] & 1 && a[2] & 1) { b = true; for (int i = 3; i <= m; i++) { i...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 146], ["+", 64, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
195
4
route = Array.new(100,0) readlines.each do |line| frm,to = line.split.map(&:to_i) if frm == 0 && to == 0 if route[1].odd? && route[2].odd? && route.drop(3).all?(&:even?) puts"OK" else puts"NG" end nodes = Array.new(100){0} else route[frm] +=1 route[to] +=1 end end
route = Array.new(100,0) readlines.each do |line| frm,to = line.split.map(&:to_i) if frm == 0 && to == 0 if route[1].odd? && route[2].odd? && route.drop(3).all?(&:even?) puts"OK" else puts"NG" end route = Array.new(100){0} else route[frm] +=1 route[to] +=1 end end
[["-", 8, 736, 0, 121, 64, 749, 0, 662, 31, 22], ["+", 8, 736, 0, 121, 64, 749, 0, 662, 31, 22]]
4
101
2
while true pts = [] while true line = gets exit if line.nil? p0, p1 = line.chomp.split(" ").map{|s| s.to_i} break if p0 == 0 && p1 == 0 p0 -= 1 p1 -= 1 pts[p0] = pts[p0].nil? ? 1 : (pts[p0] + 1) pts[p1] = pts[p1].nil? ? 1 : (pts[p1] + 1) end #p pts ok = true if pts[0] %...
while true pts = [] while true line = gets exit if line.nil? p0, p1 = line.chomp.split(" ").map{|s| s.to_i} break if p0 == 0 && p1 == 0 p0 -= 1 p1 -= 1 pts[p0] = pts[p0].nil? ? 1 : (pts[p0] + 1) pts[p1] = pts[p1].nil? ? 1 : (pts[p1] + 1) end #p pts ok = true if pts[0] %...
[["-", 8, 170, 0, 121, 64, 749, 0, 94, 0, 94], ["-", 0, 493, 0, 89, 8, 170, 0, 121, 0, 444], ["+", 0, 89, 8, 170, 0, 121, 75, 95, 0, 95], ["+", 75, 95, 0, 88, 8, 170, 0, 121, 0, 444]]
4
163
4
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { char ch[] = in.nextLine().toCharArray(); String st = ""; String ans = ""; for (int i = 0; i < ch.length; i++) { if (ch[i] == ' ') ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { char ch[] = in.nextLine().toCharArray(); String st = ""; String ans = ""; for (int i = 0; i < ch.length; i++) { if (ch[i] == ' ') ...
[["-", 75, 57, 64, 1, 0, 11, 12, 5, 0, 491], ["+", 75, 57, 64, 1, 0, 11, 12, 5, 0, 491]]
3
1,242
6
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; public class Main { public static void main(String[] args) throws IOException { Main instance = new Main(); instance.execute(); } private void execute() throws IOE...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; public class Main { public static void main(String[] args) throws IOException { Main instance = new Main(); instance.execute(); } private void execute() throws IOE...
[["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
1,173
1
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { private static BufferedReader br = null; static { br = new BufferedReader(new InputStreamReader(System.in)); } /** * @param args */ public static void main(String[] args) { // TODO Auto-...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { private static BufferedReader br = null; static { br = new BufferedReader(new InputStreamReader(System.in)); } /** * @param args */ public static void main(String[] args) { // TODO Auto-...
[["-", 8, 196, 0, 7, 15, 16, 12, 492, 500, 22], ["+", 8, 196, 0, 7, 15, 16, 12, 492, 500, 22]]
3
972
2
#include <stdio.h> #include <string.h> int main() { char c[] = {" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?"}; char w[][9] = {"101", "000000", "000011", "10010001", "010001", "000001", "100101", "10011010", "01010", "0001", "110", "01001", "10011011", "010000", ...
#include <stdio.h> #include <string.h> int main() { char c[] = {" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?"}; char w[][9] = {"101", "000000", "000011", "10010001", "010001", "000001", "100101", "10011010", "0101", "0001", "110", "01001", "10011011", "010000", ...
[["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6]]
0
357
4
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char str[200] = "", code[100000] = ""; char *pstr, *pcode; int x, b, base; while (fgets(str, sizeof(str), stdin) != NULL) { pstr = &str[0]; pcode = &code[0]; while (*pst...
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char str[200] = "", code[100000] = ""; char *pstr, *pcode; int x, b, base; while (fgets(str, sizeof(str), stdin) != NULL) { pstr = &str[0]; pcode = &code[0]; while (*pst...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
831
4
char *C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?", *strchr(), *L = "68443586484588538455886888366866"; char B[] = {0x25, 0x9a, 0x05, 0x01, 0x06, 0x09, 0x9b, 0x10, 0x07, 0x98, 0x06, 0x04, 0x99, 0x9e, 0x05, 0x07, 0x9f, 0x08, 0x06, 0x07, 0x9c, 0x9d, 0x02, 0x92, 0x93, 0x90, 0x05, 0x11, 0x03, 0x91, 0...
char *C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?", *strchr(), *L = "68443586484588538455886888366866"; B[] = {0x25, 0x9a, 0x05, 0x01, 0x06, 0x09, 0x9b, 0x10, 0x07, 0x98, 0x06, 0x04, 0x99, 0x9e, 0x05, 0x07, 0x9f, 0x08, 0x06, 0x07, 0x9c, 0x9d, 0x02, 0x92, 0x93, 0x90, 0x05, 0x11, 0x03, 0x91, 0x00, 0x01}; b, ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 0, 30, 0, 42, 0, 69, 0, 70, 0, 22], ["+", 31, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 11, 12, 16, 31, 16, 12, 23, 0, 25], ["+", 0, 9, 0, 14, 8, 9, 0, 46, 0, 46]]
0
212
5
char *C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?", *strchr(), *L = "68443586484588538455886888366866"; char B[] = {0x25, 0x9a, 0x05, 0x01, 0x06, 0x09, 0x9b, 0x10, 0x07, 0x98, 0x06, 0x04, 0x99, 0x9e, 0x05, 0x07, 0x9f, 0x08, 0x06, 0x07, 0x9c, 0x9d, 0x02, 0x92, 0x93, 0x90, 0x05, 0x11, 0x03, 0x91, 0...
char *C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?", *strchr(), *L = "68443586484588538455886888366866"; unsigned char B[] = {0x25, 0x9a, 0x05, 0x01, 0x06, 0x09, 0x9b, 0x10, 0x07, 0x98, 0x06, 0x04, 0x99, 0x9e, 0x05, 0x07, 0x9f, 0x08, 0x06, 0x07, 0x9c, 0x9d, 0x02, 0x92, ...
[["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 87]]
0
214
1
/* AizuOnline A0088 The Code A Doctor Loved */ #include <stdio.h> // Select Below //#include <stdlib.h> #include <string.h> //#include <float.h> //#include <math.h> // Global data section char heibun[1000]; char s1[10000]; char s2[2000]; char *step1table[] = { // SP ' , - . ? "101", "000000", "000011", "1001...
/* AizuOnline A0088 The Code A Doctor Loved 2012/12/31 WA */ #include <stdio.h> // Select Below //#include <stdlib.h> #include <string.h> //#include <float.h> //#include <math.h> // Global data section char heibun[1000]; char s1[10000]; char s2[2000]; char *step1table[] = { // SP ' , - . ? "101", "000000", "...
[["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 15, 16, 12, 16, 31, 23, 0, 16, 17, 85], ["+", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 48], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
512
6
#include <stdio.h> #include <string.h> char encode[96][8]; char decode[32]; int main(void) { strcpy(encode[' '], "101"); strcpy(encode['\n'], ""); strcpy(encode['\''], "000000"); strcpy(encode[','], "000011"); strcpy(encode['-'], "10010001"); strcpy(encode['.'], "010001"); strcpy(encode['?'], "000001"); ...
#include <stdio.h> #include <string.h> char encode[96][9]; char decode[32]; int main(void) { strcpy(encode[' '], "101"); strcpy(encode['\n'], ""); strcpy(encode['\''], "000000"); strcpy(encode[','], "000011"); strcpy(encode['-'], "10010001"); strcpy(encode['.'], "010001"); strcpy(encode['?'], "000001"); ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 15, 23, 0, 16, 31, 2, 3, 4, 0, 13], ["+", 15, 23, 0, 16, 31, 2, 3, 4, 0, 13]]
0
800
4
#include <iostream> #include <map> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; vector<string> split(string &str, char delim) { vector<string> res; size_t current = 0, found; while ((found = str.find_first_of(delim, current)) != string::npos) { res....
#include <iostream> #include <map> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; vector<string> split(string &str, char delim) { vector<string> res; size_t current = 0, found; while ((found = str.find_first_of(delim, current)) != string::npos) { res....
[["-", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6]]
1
966
4
// The Code A Doctor Loved #include <bits/stdc++.h> using namespace std; string p(string s, string t) { for (int i = 0; i < t.length(); i++) { if (s.length() % 6 == 5) s += ' '; s += t[i]; } return s; } string into(string s) { string t = ""; for (int i = 0; i < s.length(); i++) { if (s[i] ...
// The Code A Doctor Loved #include <bits/stdc++.h> using namespace std; string p(string s, string t) { for (int i = 0; i < t.length(); i++) { if (s.length() % 6 == 5) s += ' '; s += t[i]; } return s; } string into(string s) { string t = ""; for (int i = 0; i < s.length(); i++) { if (s[i] ...
[["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["-", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125]]
1
1,334
4
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
[["-", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22]]
1
904
4
#include <bits/stdc++.h> using namespace std; int main() { map<char, string> P; P[32] = "101"; P[39] = "000000"; P[44] = "000011"; P[45] = "10010001"; P[46] = "010001"; P[63] = "000001"; P[65] = "100101"; // A P[66] = "10011010"; P[67] = "0101"; P[68] = "0001"; P[69] = "110"; P[70] = "01001...
#include <bits/stdc++.h> using namespace std; int main() { map<char, string> P; P[32] = "101"; P[39] = "000000"; P[44] = "000011"; P[45] = "10010001"; P[46] = "010001"; P[63] = "000001"; P[65] = "100101"; // A P[66] = "10011010"; P[67] = "0101"; P[68] = "0001"; P[69] = "110"; P[70] = "01001...
[["-", 8, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["-", 8, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 8, 9, 0, 1, 0, 11, 12, 5, 0, 62]]
1
817
4
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include ...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include ...
[["-", 0, 30, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 0, 30, 0, 43, 49, 50, 51, 5, 0, 6]]
1
896
2
#include <algorithm> #include <cmath> #include <queue> #include <stack> #include <stdio.h> using namespace std; using namespace std; int main() { char base[205], middle[900], result[900]; int p, tmp; while (fgets(base, 205, stdin) != 0) { p = 0; for (int i = 0; base[i] != '\0'; i++) { switch (...
#include <algorithm> #include <cmath> #include <queue> #include <stack> #include <stdio.h> using namespace std; using namespace std; int main() { char base[205], middle[900], result[900]; int p, tmp; while (fgets(base, 205, stdin) != 0) { p = 0; for (int i = 0; base[i] != '\0'; i++) { switch (...
[["-", 0, 99, 8, 9, 0, 100, 51, 103, 0, 125], ["+", 0, 99, 8, 9, 0, 100, 51, 103, 0, 125], ["-", 0, 100, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 100, 0, 1, 0, 11, 12, 103, 0, 125]]
1
2,647
4
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; string DoctorTableAD(char c) { string s; switch (c) { case ' ': s = "101"; break; case 0x27: s = "000000"; break; case ',': s = "000011"; break; case '-': s = "10010001"; break;...
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; string DoctorTableAD(char c) { string s; switch (c) { case ' ': s = "101"; break; case 0x27: s = "000000"; break; case ',': s = "000011"; break; case '-': s = "10010001"; break;...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
803
28
#include <algorithm> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c)....
#include <algorithm> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c)....
[["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 8, 9, 0, 52, 8, 9, 0, 9, 0, 45], ["-", 8, 9, 0, 52, 8, 9, 0, 9, 0, 46], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 31, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33]]
1
460
5
#include <algorithm> #include <iostream> #include <map> #include <string> using namespace std; string i_to_05b(unsigned int n) { string s = ""; do { char c = (n & 1U) + '0'; s.push_back(c); n >>= 1; } while (n != 0); while (s.size() < 5) s.push_back('0'); reverse(s.begin(), s.end()); retu...
#include <algorithm> #include <iostream> #include <map> #include <string> using namespace std; string i_to_05b(unsigned int n) { string s = ""; do { char c = (n & 1U) + '0'; s.push_back(c); n >>= 1; } while (n != 0); while (s.size() < 5) s.push_back('0'); reverse(s.begin(), s.end()); retu...
[["+", 8, 9, 0, 52, 15, 339, 51, 2, 63, 22], ["+", 0, 52, 15, 339, 51, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 152], ["+", 0, 52, 15, 339, 51, 2, 3, 4, 0, 21], ["+", 0, 52, 15, 339, 51, 2, 3, 4, 0, 25]]
1
787
5
#include <iostream> #include <map> #include <string> using namespace std; int main() { string str; map<string, string> encode; map<string, string> decode; encode[" "] = "101"; encode["'"] = "000000"; encode[","] = "000011"; encode["-"] = "10010001"; encode["."] = "010001"; encode["?"] = "000001"...
#include <iostream> #include <map> #include <string> using namespace std; int main() { string str; map<string, string> encode; map<string, string> decode; encode[" "] = "101"; encode["'"] = "000000"; encode[","] = "000011"; encode["-"] = "10010001"; encode["."] = "010001"; encode["?"] = "000001"...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
848
2
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep...
[["-", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22]]
1
602
2
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <sstream> #include <string> using namespace std; string mkzero(int len) { char str[80]; sprintf(str, "%0*d", len, 0); return string(str); } int main() { const char *fromA = " ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <sstream> #include <string> using namespace std; string mkzero(int len) { char str[80]; sprintf(str, "%0*d", len, 0); return string(str); } int main() { const char *fromA = " ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";...
[["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6]]
1
694
2
#include <iostream> #include <string> using namespace std; char c1[32] = {' ', '\'', ',', '-', '.', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; string s1[32] = {"101", "000000", "000011",...
#include <iostream> #include <string> using namespace std; char c1[32] = {' ', '\'', ',', '-', '.', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; string s1[32] = {"101", "000000", "000011",...
[["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 79], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
759
4
#include <iostream> #include <map> using namespace std; map<char, string> t; void make_table() { t[' '] = "101"; t['\''] = "000000"; t[','] = "000011"; t['-'] = "10010001"; t['.'] = "010001"; t['?'] = "000001"; t['A'] = "100101"; t['B'] = "10011010"; t['C'] = "0101"; t['D'] = "0001"; t['E'] = "1...
#include <iostream> #include <map> using namespace std; map<char, string> t; void make_table() { t[' '] = "101"; t['\''] = "000000"; t[','] = "000011"; t['-'] = "10010001"; t['.'] = "010001"; t['?'] = "000001"; t['A'] = "100101"; t['B'] = "10011010"; t['C'] = "0101"; t['D'] = "0001"; t['E'] = "1...
[["-", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6]]
1
598
2
def main(input = STDIN) plane = {" " => "101", "'" => "000000", "," => "000011", "-" => "10010001", "." => "010001", "?" => "000001", "A" => "100101", "B" => "10011010", "C" => "0101", "D" => "0001", "E" => "110", "F" => "01001", "G" => "10011011", "H" => "010000", "I" => "0111", "J" => "10011000", "K" => "0110", "L"...
def main(input = STDIN) plane = {" " => "101", "'" => "000000", "," => "000011", "-" => "10010001", "." => "010001", "?" => "000001", "A" => "100101", "B" => "10011010", "C" => "0101", "D" => "0001", "E" => "110", "F" => "01001", "G" => "10011011", "H" => "010000", "I" => "0111", "J" => "10011000", "K" => "0110", "L"...
[["-", 12, 739, 0, 738, 31, 748, 439, 739, 0, 24], ["-", 0, 738, 31, 748, 439, 739, 0, 738, 17, 72], ["-", 0, 738, 31, 748, 439, 739, 0, 738, 12, 612], ["-", 12, 739, 0, 738, 31, 748, 439, 739, 0, 25], ["-", 8, 170, 0, 88, 51, 267, 0, 475, 17, 757], ["+", 8, 170, 0, 88, 51, 267, 0, 475, 17, 389]]
4
409
6
code_a = Hash[ *%w( ' 000000 , 000011 - 10010001 . 010001 ? 000001 A 100101 B 10011010 C 0101 D 0001 E 110 F 01001 G 10011011 H 010000 I 0111 J 10011000 K 0110 L 00100 M 10011001 N 10011110 O 00101 P 111 Q 10011111 R 1000 S 00110 T 00111 U 10011100 V 10011101 W 000010 X 10010010 Y 10010011 Z 10010000 )] code_a[' '] = '...
code_a = Hash[ *%w( ' 000000 , 000011 - 10010001 . 010001 ? 000001 A 100101 B 10011010 C 0101 D 0001 E 110 F 01001 G 10011011 H 010000 I 0111 J 10011000 K 0110 L 00100 M 10011001 N 10011110 O 00101 P 111 Q 10011111 R 1000 S 00110 T 00111 U 10011100 V 10011101 W 000010 X 10010010 Y 10010011 Z 10010000 )] code_a[' '] = '...
[["+", 196, 196, 8, 734, 0, 742, 0, 738, 31, 22], ["+", 196, 196, 8, 734, 0, 742, 0, 738, 17, 72], ["-", 196, 196, 8, 734, 0, 742, 0, 738, 17, 72], ["-", 196, 196, 8, 734, 0, 742, 0, 738, 12, 22]]
4
190
4
words = [" ", "\'", ",", "-", ".", "?"] words += %{ABCDEFGHIJKLMNOPQRSTUVWXYZ}.split("") code = %w{101 000000 000011 10010001 010001 000001 100101 10011010 0101 0001 110 01001 10011011 010000 0111 10011000 0110 00100 10011001 10011110 00101 111 10011111 1000 00110 00111 10011100 10011101 000010 100100...
words = [" ", "\'", ",", "-", ".", "?"] words += %{ABCDEFGHIJKLMNOPQRSTUVWXYZ}.split("") code = %w{101 000000 000011 10010001 010001 000001 100101 10011010 0101 0001 110 01001 10011011 010000 0111 10011000 0110 00100 10011001 10011110 00101 111 10011111 1000 00110 00111 10011100 10011101 000010 100100...
[["+", 8, 170, 0, 652, 486, 652, 486, 652, 735, 22], ["+", 0, 89, 8, 170, 0, 652, 486, 652, 17, 131]]
4
202
2
mp = {} mp[" "] = "101" mp["'"] = "000000" mp[","] = "000011" mp["-"] = "10010001" mp["."] = "010001" mp["?"] = "000001" mp["A"] = "100101" mp["B"] = "10011010" mp["C"] = "0101" mp["D"] = "0001" mp["E"]="110" mp["F"]="01001" mp["G"]="10011011" mp["H"]="010000" mp["I"]="0111" mp["J"]="10011000" mp["K"]="0110" mp["L"]="0...
mp = {} mp[" "] = "101" mp["'"] = "000000" mp[","] = "000011" mp["-"] = "10010001" mp["."] = "010001" mp["?"] = "000001" mp["A"] = "100101" mp["B"] = "10011010" mp["C"] = "0101" mp["D"] = "0001" mp["E"]="110" mp["F"]="01001" mp["G"]="10011011" mp["H"]="010000" mp["I"]="0111" mp["J"]="10011000" mp["K"]="0110" mp["L"]="0...
[["-", 0, 493, 0, 662, 31, 742, 0, 557, 0, 6], ["+", 0, 493, 0, 662, 31, 742, 0, 557, 0, 6]]
4
447
4
T = { ' ' => '101', ?' => '000000', ?, => '000011', ?- => '10010001', ?. => '010001', ?? => '000001', ?A => '100101', ?B => '10011010', ?C => '0101', ?D => '0001', ?E => '110', ?F => '01001', ?G => '10011011', ?H => '010000', ?I => '0111', ?J => '10011000', ?K => '0110', ?L => '00100...
T = { ' ' => '101', ?' => '000000', ?, => '000011', ?- => '10010001', ?. => '010001', ?? => '000001', ?A => '100101', ?B => '10011010', ?C => '0101', ?D => '0001', ?E => '110', ?F => '01001', ?G => '10011011', ?H => '010000', ?I => '0111', ?J => '10011000', ?K => '0110', ?L => '00100...
[["+", 12, 738, 12, 739, 0, 738, 31, 739, 0, 24], ["+", 12, 738, 12, 739, 0, 738, 31, 739, 0, 25]]
4
404
2
class String @@encode = {} @@decode = {} def encode res = split('').map{ |c| @@encode[c] }.join res + '0' * (5 - res.size % 5) % 5 end def decode scan(/.{5}/).map{ |s| @@decode[s] }.join end @@encode[" "] = "101" @@encode["'"] = "000000" @@encode[","] = "000011" @@encode["-"] = "1001...
class String @@encode = {} @@decode = {} def encode res = split('').map{ |c| @@encode[c] }.join res + '0' * ((5 - res.size % 5) % 5) end def decode scan(/.{5}/).map{ |s| @@decode[s] }.join end @@encode[" "] = "101" @@encode["'"] = "000000" @@encode[","] = "000011" @@encode["-"] = "10...
[["+", 12, 738, 12, 739, 0, 738, 31, 739, 0, 24], ["+", 8, 736, 0, 738, 12, 738, 12, 739, 0, 25]]
4
724
2
dic1 = {" ":"101", "'":"000000", ",":"000011", "-":"10010001", ".":"010001", "?":"000001", "A":"100101", "B":"10011010", "C":"0101", "D":"0101", "E":"110", "F":"01001", "G":"10011011", "H":"010000", "I":"0111", "J":"10011000", "K":"0110", "L":"00100", "M":"10011001", "N":"10011110", "O":"00101",...
dic1 = {" ":"101", "'":"000000", ",":"000011", "-":"10010001", ".":"010001", "?":"000001", "A":"100101", "B":"10011010", "C":"0101", "D":"0001", "E":"110", "F":"01001", "G":"10011011", "H":"010000", "I":"0111", "J":"10011000", "K":"0110", "L":"00100", "M":"10011001", "N":"10011110", "O":"00101",...
[["-", 0, 662, 12, 680, 0, 569, 51, 557, 0, 6], ["+", 0, 662, 12, 680, 0, 569, 51, 557, 0, 6]]
5
635
2
encode = { ' ':'101', "'":'000000', ',':'000011', '-':'10010001', '.':'010001', '?':'000001', 'A':'100101', 'B':'10011010', 'C':'0101', 'D':'0001', 'E':'110', 'F':'01001', 'G':'10011011', 'H':'010000', 'I':'0111', 'J':'10011000', 'K':'0110', 'L':'00100', 'M':'10011001', 'N':'10011110', 'O':'00101', ...
encode = { ' ':'101', "'":'000000', ',':'000011', '-':'10010001', '.':'010001', '?':'000001', 'A':'100101', 'B':'10011010', 'C':'0101', 'D':'0001', 'E':'110', 'F':'01001', 'G':'10011011', 'H':'010000', 'I':'0111', 'J':'10011000', 'K':'0110', 'L':'00100', 'M':'10011001', 'N':'10011110', 'O':'00101', ...
[["-", 0, 52, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
631
4
import sys A=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ" B="101 000000 000011 10010001 010001 000001 100101 10011010 "\ "0101 0001 110 01001 10011011 010000 0111 10011000 "\ "0110 00100 10011001 10011110 00101 111 10011111 1000 "\ "00110 00111 10011100 10011101 000010 10010010 10010011 10010000".split() C="ABCDEFGHIJKLMNO...
import sys A=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ" B="101 000000 000011 10010001 010001 000001 100101 10011010 "\ "0101 0001 110 01001 10011011 010000 0111 10011000 "\ "0110 00100 10011001 10011110 00101 111 10011111 1000 "\ "00110 00111 10011100 10011101 000010 10010010 10010011 10010000".split() C="ABCDEFGHIJKLMNO...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
140
2
<?php class Node { public $left; public $right; public $value; public $largest; public function __construct($value) { $this->value = $value; } public function max_value() { if ($this->largest !== null) { return $this->largest; } if (is_null($this->left) && is_null($this->right)) { return $this->...
<?php class Node { public $left; public $right; public $value; public $largest; public function __construct($value) { $this->value = $value; } public function max_value() { if ($this->largest !== null) { return $this->largest; } if (is_null($this->left) && is_null($this->right)) { return $this->...
[["-", 12, 613, 3, 3, 0, 28, 0, 606, 0, 141], ["+", 12, 613, 3, 3, 0, 28, 0, 606, 0, 141], ["-", 3, 3, 0, 28, 0, 69, 0, 606, 0, 141], ["+", 3, 3, 0, 28, 0, 69, 0, 606, 0, 141], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 12, 612]]
6
528
6
import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().main(); } void main() { Scanner sc = new Scanner(System.in); int[][] a = new int[100][100]; int i = 0; while (sc.hasNextLine()) { String s = sc.nextLine(); String[] temp = s.split(","); ...
import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().main(); } void main() { Scanner sc = new Scanner(System.in); int[][] a = new int[100][100]; int i = 0; while (sc.hasNext()) { String s = sc.nextLine(); String[] temp = s.split(","); ...
[["-", 8, 196, 0, 52, 15, 15, 0, 492, 141, 22], ["+", 8, 196, 0, 52, 15, 15, 0, 492, 141, 22], ["-", 8, 196, 0, 1, 0, 11, 12, 492, 141, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 141, 22], ["+", 51, 492, 3, 4, 0, 16, 31, 16, 17, 72], ["+", 51, 492, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 0, 16, 12, 23, 0, 16, 31, 16, 17, 72]...
3
454
8
#include <stdio.h> #include <string.h> int a[110][110], n = 0, c, d[110][110]; char s[110][200]; int main() { int i, j; n = 0; while (scanf("%s", s[n]) != EOF) { c = 0; a[n][c] = 0; for (i = 0; i < strlen(s[n]); i++) { if (s[n][i] == ',') { a[n][c] /= 10; c++; a[n][c] =...
#include <stdio.h> #include <string.h> int a[110][110], n = 0, c, d[110][110]; char s[110][200]; int main() { int i, j; n = 0; while (scanf("%s", s[n]) != EOF) { c = 0; a[n][c] = 0; for (i = 0; i < strlen(s[n]); i++) { if (s[n][i] == ',') { a[n][c] /= 10; c++; a[n][c] =...
[["-", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 7, 15, 16, 12, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 85], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
509
6
#include <stdio.h> char data[99][50]; int max(int x, int y) { if (x > y) { return (x); } return (y); } int judge(int n) { int i, j; int dp[100][50]; for (i = 1; i <= n; i++) { for (j = 1; j <= i; j++) { if (i <= n / 2 + 1) { dp[i][j] = data[i][j] + max(dp[i - 1][j], dp[i - 1][j - ...
#include <stdio.h> char data[99][50]; int max(int x, int y) { if (x > y) { return (x); } return (y); } int judge(int n) { int i, j; int dp[100][50]; for (i = 1; i <= n; i++) { for (j = 1; j <= i; j++) { if (i <= n / 2 + 1) { dp[i][j] = data[i][j] + max(dp[i - 1][j], dp[i - 1][j - ...
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
0
337
2
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define FOR(i, a, b) fo...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define FOR(i, a, b) fo...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
551
2
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
[["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
570
3
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define lol(i, n) for (int i = 0; i < n; i++) #define mod 1000000007 typedef long long ll; using namespace std; vector<int> v[110]; int dp[110][110]; int main() { int n = 0, maxi = 0; string z; while (cin >> z) { z.push_back(','); ...
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define lol(i, n) for (int i = 0; i < n; i++) #define mod 1000000007 typedef long long ll; using namespace std; vector<int> v[110]; int dp[110][110]; int main() { int n = 0, maxi = 0; string z; while (cin >> z) { z.push_back(','); ...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
402
2
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; // const int INF = 1e8; using namespace std; vector<string> split(string in, char sp = ',') { vecto...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; // const int INF = 1e8; using namespace std; vector<string> split(string in, char sp = ',') { vecto...
[["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 72], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13]]
1
457
2
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; int main() { vector<string> line(100); int l, k; char cc; stringstream ss; for (l = 0; getline(cin, line[l], '\n'); l++) ; int path[(l + 1) / 2 + 2][l]; for (int i = 0; i < (l + 1) / 2 ...
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; int main() { vector<string> line(100); int l, k; char cc; stringstream ss; for (l = 0; getline(cin, line[l], '\n'); l++) ; int path[(l + 1) / 2 + 2][l]; for (int i = 0; i < (l + 1) / 2 ...
[["-", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["-", 51, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["-", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 15, 339, 51, 16, 12, 16, 31, 23, 0, 25]]
1
350
4
import static java.lang.Math.*; import static java.util.Arrays.*; import java.util.*; // AOJ 0093 public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { boolean isFirst = true; while (true) { int a, b; a = sc.nextInt(); b = sc.nextInt();...
import static java.lang.Math.*; import static java.util.Arrays.*; import java.util.*; // AOJ 0093 public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { boolean isFirst = true; while (true) { int a, b; a = sc.nextInt(); b = sc.nextInt();...
[["-", 64, 196, 0, 57, 15, 15, 0, 16, 17, 79], ["+", 64, 196, 0, 57, 15, 15, 0, 16, 17, 60], ["-", 0, 57, 15, 15, 0, 16, 31, 16, 12, 499], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 12, 499]]
3
218
4
import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { Scanner cin = new Scanner(System.in); boolean first = true; while (true) { int a = cin.nextInt(); int b = cin.nextInt(); if (a + b == 0) { break; } if...
import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { Scanner cin = new Scanner(System.in); boolean first = true; while (true) { int a = cin.nextInt(); int b = cin.nextInt(); if (a + b == 0) { break; } if...
[["-", 0, 7, 502, 503, 49, 200, 51, 16, 17, 72], ["-", 0, 7, 502, 503, 49, 200, 51, 16, 12, 499], ["-", 0, 52, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 196, 0, 7, 15, 16, 17, 19]]
3
214
4
import java.io.*; import java.util.*; public class Main { public static boolean isLeap(int year) { if (year % 400 == 0) { return true; } else if (year % 100 == 0) { return false; } else return year % 4 == 0; } public static void main(String[] args) throws IOException { Buffer...
import java.io.*; import java.util.*; public class Main { public static boolean isLeap(int year) { if (year % 400 == 0) { return true; } else if (year % 100 == 0) { return false; } else return year % 4 == 0; } public static void main(String[] args) throws IOException { Buffer...
[["-", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
296
2
import java.util.*; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); boolean firstFlag = true; while (stdIn.hasNext()) { int a = stdIn.nextInt(); int b = stdIn.nextInt(); if (a == 0 && b == 0) { break; } if (!firstFl...
import java.util.*; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); boolean firstFlag = true; while (stdIn.hasNext()) { int a = stdIn.nextInt(); int b = stdIn.nextInt(); if (a == 0 && b == 0) { break; } if (!firstFl...
[["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 12, 147], ["+", 8, 196, 0, 52, 8, 196, 0, 1, 0, 35]]
3
173
4
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = ""; ArrayList<String> ds = new Arra...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = ""; ArrayList<String> ds = new Arra...
[["-", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
339
2
#include <stdio.h> int main() { int ya, yb; int i, a = 0, s; while (1) { s = 0; scanf("%d %d", &ya, &yb); if (ya == 0 && yb == 0) break; if (a == 1) printf("\n"); for (i = ya; i < yb; i++) { if (i % 400 == 0 || (!(i % 100 == 0) && i % 4 == 0)) { printf("%d\n", i); ...
#include <stdio.h> int main() { int ya, yb; int i, a = 0, s; while (1) { s = 0; scanf("%d %d", &ya, &yb); if (ya == 0 && yb == 0) break; if (a == 1) printf("\n"); for (i = ya; i <= yb; i++) { if (i % 400 == 0 || (!(i % 100 == 0) && i % 4 == 0)) { printf("%d\n", i); ...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
0
147
2
#include <stdio.h> int main(void) { int a, b, c, x = 0, i = 0; while (1) { scanf("%d %d", &a, &b); if (a == 0 && b == 0) break; if (x != 0) printf("\n"); else x = 1; for (c = a; c <= b; c++) { if ((c % 4 == 0 && c % 100 != 0) || c % 400) { printf("%d\n", c); ...
#include <stdio.h> int main(void) { int a, b, c, x = 0, i = 0; while (1) { scanf("%d %d", &a, &b); if (a == 0 && b == 0) break; if (x != 0) printf("\n"); else x = 1; for (c = a; c <= b; c++) { if ((c % 4 == 0 && c % 100 != 0) || c % 400 == 0) { printf("%d\n", c);...
[["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
0
147
4
#include <stdio.h> int main() { int a, b; int i; int flg; int first = 1; while (1) { flg = 0; scanf("%d %d", &a, &b); if (a == 0 && b == 0) break; if (first) first = 0; else printf("\n"); for (i = a; i <= b; i++) if ((i % 4 == 0 && i % 100 != 0) || (i % 4 ==...
#include <stdio.h> int main() { int a, b; int i; int flg; int first = 1; while (1) { flg = 0; scanf("%d %d", &a, &b); if (a == 0 && b == 0) break; if (first) first = 0; else printf("\n"); for (i = a; i <= b; i++) if ((i % 4 == 0 && i % 100 != 0) || (i % 4 ==...
[["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
150
1
#include <stdio.h> int main(void) { int start, end; int year; int flg_null; int flg_dsp; flg_null = 0; while (1) { scanf("%d%d", &start, &end); if (start == 0 && end == 0) { break; } if (flg_null == 1) { printf("\n"); flg_null = 1; } flg_dsp = 0; for (year = s...
#include <stdio.h> int main(void) { int start, end; int year; int flg_null; int flg_dsp; flg_null = 0; while (1) { scanf("%d%d", &start, &end); if (start == 0 && end == 0) { break; } if (flg_null == 1) { printf("\n"); } flg_null = 1; flg_dsp = 0; for (year = sta...
[["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
0
159
2
a, b, i, c, k[3100]; main() { scanf("%d%d", &a, &b); for (;; puts("")) { c = 0; for (i = a; i <= b; i++) if (i % 400 == 0 || (i % 100 != 0 && i % 4 == 0)) k[c++] = i; if (~c) puts("NA"); else { for (i = 0; i < c;) printf("%d\n", k[i++]); } scanf("%d%d", &a, ...
a, b, i, c, k[3100]; main() { scanf("%d%d", &a, &b); for (;; puts("")) { c = 0; for (i = a; i <= b; i++) if (i % 400 == 0 || (i % 100 != 0 && i % 4 == 0)) k[c++] = i; if (!c) puts("NA"); else { for (i = 0; i < c;) printf("%d\n", k[i++]); } scanf("%d%d", &a,...
[["-", 8, 9, 0, 57, 15, 23, 0, 91, 17, 92], ["+", 8, 9, 0, 57, 15, 23, 0, 91, 17, 111]]
0
154
4
x, a, b, i; main(c) { for (; scanf("%d%d", &a, &b), a;) { x &&puts(""); c = 0; for (x = i = a; i <= b; i++) if (i % 400 == 0 || (i % 100 && i % 4 == 0)) c = printf("%d\n", i); c &&puts("NA"); } exit(0); }
x, a, b, i; main(c) { for (; scanf("%d%d", &a, &b), a;) { x &&puts(""); c = 0; for (x = i = a; i <= b; i++) if (i % 400 == 0 || (i % 100 && i % 4 == 0)) c = printf("%d\n", i); c || puts("NA"); } exit(0); }
[["-", 0, 7, 8, 9, 0, 1, 0, 16, 17, 98], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 106]]
0
108
2
#include <stdio.h> int leap(int x) { if (x % 400 == 0) return 1; if (x % 100 == 0) return 0; if (x % 4 == 0) return 1; return 0; } int main() { int a, b, num, i, first = 1; while (1) { scanf("%d%d", &a, &b); if (a == 0 && b == 0) return 0; if (!first) puts(""); firs...
#include <stdio.h> int leap(int x) { if (x % 400 == 0) return 1; if (x % 100 == 0) return 0; if (x % 4 == 0) return 1; return 0; } int main() { int a, b, num, i, first = 1; while (1) { scanf("%d%d", &a, &b); if (a == 0 && b == 0) return 0; if (!first) puts(""); firs...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
167
1
a, b, f; main(e) { for (; scanf("%d%d", &a, &b) * a;) { if (f) puts(""); e = 1; for (a = -~a / 4 * 4 + 4; a <= b; a += 4) if (!(a % 4) && a % 25 || !(a % 400)) { printf("%d\n", a); e = 0; } if (e) puts("NA"); f = 1; } } ////////////////////////////////////...
a, b, f; main(e) { for (; scanf("%d%d", &a, &b) * a;) { if (f) puts(""); e = 1; for (a = ~-a / 4 * 4 + 4; a <= b; a += 4) if (!(a % 4) && a % 25 || !(a % 400)) { printf("%d\n", a); e = 0; } if (e) puts("NA"); f = 1; } } ////////////////////////////////////...
[["-", 12, 16, 31, 16, 31, 16, 31, 91, 17, 33], ["+", 31, 16, 31, 16, 31, 91, 28, 91, 17, 33]]
0
121
2
e; main(a, b) { for (; scanf("%d%d", &a, &b) * a; e > 1 && puts("NA"), e = 1) for (e &&puts(""); a <= b; a++) a % 4 | a % 25 < 1 && a % 400 || printf("%d\n", e = a); }
e; main(a, b) { for (; scanf("%d%d", &a, &b) * a; e > 1 || puts("NA"), e = 1) for (e &&puts(""); a <= b; a++) a % 4 | a % 25 < 1 && a % 400 || printf("%d\n", e = a); }
[["-", 0, 9, 0, 7, 26, 34, 31, 16, 17, 98], ["+", 0, 9, 0, 7, 26, 34, 31, 16, 17, 106]]
0
87
2
#include <stdio.h> int uruu(int year) { if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 1; return 0; } int main(void) { int a, b; int cnt = 0; while (1) { scanf("%d %d", &a, &b); if (a == 0 && b == 0) break; if (cnt) { cnt = 0; } for (; a <= b; a++) { ...
#include <stdio.h> int uruu(int year) { if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 1; return 0; } int main(void) { int a, b; int cnt = 0; while (1) { scanf("%d %d", &a, &b); if (a == 0 && b == 0) break; if (cnt) puts(""); cnt = 0; for (; a <= b; a++)...
[["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 52, 8, 9, 0, 57, 64, 1, 0, 35], ["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
0
154
8
#include <stdio.h> int main() { int a, b, i, is_first = 0; while (1) { int is_NA = 1; scanf("%d %d", &a, &b); if (a == 0 && b == 0) { break; } if (is_first) { printf("\n"); } for (i = a; i <= b; i++) { if ((i % 4) == 0) { if ((i % 100) == 0) { if ((i %...
#include <stdio.h> int main() { int a, b, i, is_first = 0; while (1) { int is_NA = 1; scanf("%d %d", &a, &b); if (a == 0 && b == 0) { break; } if (is_first) { printf("\n"); } for (i = a; i <= b; i++) { if ((i % 4) == 0) { if ((i % 100) == 0) { if ((i %...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13]]
0
173
2
#include <stdbool.h> #include <stdio.h> bool is_leap_year(int y); int get_leap_years(int list[], int begin, int end); int main(void) { int leap_years_list[1000]; // A.D. 0 - A.D. 3000 // の間に閏年は高々1000個しかない bool first_set = true; //一つ目のセットの前にだけは改行を入れてはいけないので while (true) { int y...
#include <stdbool.h> #include <stdio.h> bool is_leap_year(int y); int get_leap_years(int list[], int begin, int end); int main(void) { int leap_years_list[1000]; // A.D. 0 - A.D. 3000 // の間に閏年は高々1000個しかない bool first_set = true; //一つ目のセットの前にだけは改行を入れてはいけないので while (true) { int y...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
273
2
/* 2014.07.04 1230~1243 C language Lecture week ∞ */ #include <stdio.h> int leap_chk(int year); int main(void) { int init; int last; int rcode = 0; int count; while (1) { count = 0; scanf("%d", &init); scanf("%d", &last); if (init == 0 && last == 0) { break; } ...
/* 2014.07.04 1230~1243 C language Lecture week ∞ */ #include <stdio.h> int leap_chk(int year); int main(void) { int init; int last; int rcode = 0; int count; while (1) { count = 0; scanf("%d", &init); scanf("%d", &last); if (init == 0 && last == 0) { break; } ...
[["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 52, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45]]
1
210
3
#include <stdbool.h> #include <stdio.h> bool is_leap_year(int y); int get_leap_years(int *leap_year_array, int start_year, int final_year); int main() { int leap_years_list[1000]; // A.D. 0 - A.D. 3000 // の間に閏年は高々1000個しかない bool first_set = true; //一つ目のセットの前にだけは改行を入れてはいけないので while ...
#include <stdbool.h> #include <stdio.h> bool is_leap_year(int y); int get_leap_years(int *leap_year_array, int start_year, int final_year); int main() { int leap_years_list[1000]; // A.D. 0 - A.D. 3000 // の間に閏年は高々1000個しかない bool first_set = true; //一つ目のセットの前にだけは改行を入れてはいけないので while ...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 72], ["-", 0, 14, 8, 9, 0, 37, 0, 16, 12, 13]]
1
274
2
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <string> #include <vector> #define pb push_back #define mp make_pair #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, b) loop(i, 0, b) #define all(in) in.begin(), in.end() const double ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <string> #include <vector> #define pb push_back #define mp make_pair #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, b) loop(i, 0, b) #define all(in) in.begin(), in.end() const double ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
165
3
#include <iostream> using namespace std; int main() { bool f = 0; int a, b; while (cin >> a >> b) { if (a == b && a == 0) break; if (f) cout << endl; for (f = 0; a <= b; a++) { if ((a % 4 == 0) && ((a % 400 != 0) || (a % 400 == 0))) { cout << a << endl; f = 1; }...
#include <iostream> using namespace std; int main() { bool f = 0; int a, b; while (cin >> a >> b) { if (a == b && a == 0) break; if (f) cout << endl; for (f = 0; a <= b; a++) { if ((a % 4 == 0) && ((a % 100 != 0) || (a % 400 == 0))) { cout << a << endl; f = 1; }...
[["-", 0, 16, 31, 23, 0, 16, 31, 16, 12, 13], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 12, 13]]
1
127
2
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int stoi(string x) { stringstream ss; ss << x; int tmp; ss >> tmp; return tmp; } string itos(int x) { stringstream ss; ...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int stoi(string x) { stringstream ss; ss << x; int tmp; ss >> tmp; return tmp; } string itos(int x) { stringstream ss; ...
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13]]
1
183
2
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vii; #define rrep(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define erep(i, m, n) for (int(i) = (m); (i) <= (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) <...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vii; #define rrep(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define erep(i, m, n) for (int(i) = (m); (i) <= (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) <...
[["-", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22]]
1
364
2
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> int main() { int a, b; bool isF = true; while (true) { scanf("%d%d", &a, &b); if (a == 0 && b == 0) { break; } if (isF) { printf("\n"); isF = false; } bool isN = true; for (int i = a; i <= b;...
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> int main() { int a, b; bool isF = true; while (true) { scanf("%d%d", &a, &b); if (a == 0 && b == 0) { break; } if (!isF) { printf("\n"); } isF = false; bool isN = true; for (int i = a; i <= b; ...
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
1
156
3
#include <bits/stdc++.h> using namespace std; int main() { int a, b; int j = 0; while (1) { cin >> a >> b; if (!a && !b) { break; } if (j != 0) cout << endl; int cnt = 0; for (int i = a; i < b; i++) { if (i % 4 == 0) { if (i % 400 == 0) { cout << i << e...
#include <bits/stdc++.h> using namespace std; int main() { int a, b; int j = 0; while (1) { cin >> a >> b; if (!a && !b) { break; } if (j != 0) cout << endl; int cnt = 0; for (int i = a; i <= b; i++) { if (i % 4 == 0) { if (i % 400 == 0) { cout << i <<...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
144
2
#include <iostream> using namespace std; int main() { int a, b, m = 0; while (cin >> a >> b) { if (!(a || b)) break; if (m > 0) cout << endl; m++; int c = 0; for (int i = a; i <= b; i++) if ((i % 4 == 0) && (i % 100 != 0 || i % 400)) { cout << i << endl; c++; ...
#include <iostream> using namespace std; int main() { int a, b, m = 0; while (cin >> a >> b) { if (!(a || b)) break; if (m > 0) cout << endl; m++; int c = 0; for (int i = a; i <= b; i++) if ((i % 4 == 0) && (i % 100 != 0 || i % 400 == 0)) { cout << i << endl; ...
[["+", 51, 16, 12, 23, 0, 16, 12, 16, 17, 60], ["+", 51, 16, 12, 23, 0, 16, 12, 16, 12, 13]]
1
120
2
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define pb(n) push_back(n) #define mp(n, m) make_pair(n, m) #def...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define pb(n) push_back(n) #define mp(n, m) make_pair(n, m) #def...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
305
2
#include <iostream> using namespace std; int main(void) { int a, b, count = 0; while (cin >> a >> b, a || b) { if (count) cout << endl; bool NAflag = 0; for (int i = a; i < b; i += 4 - i % 4) { bool flag; if (i % 4 == 0) { if (i % 100 == 0) { if (i % 400 == 0) { ...
#include <iostream> using namespace std; int main(void) { int a, b, count = 0; while (cin >> a >> b, a || b) { if (count) cout << endl; bool NAflag = 0; for (int i = a; i <= b; i += 4 - i % 4) { bool flag; if (i % 4 == 0) { if (i % 100 == 0) { if (i % 400 == 0) { ...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
163
2
#include <iostream> using namespace std; bool isUruu(int y) { if (y % 4 == 0) { if (y % 100 == 0) { if (y % 400 == 0) return true; return false; } return true; } return false; } int main() { int a, b; bool first = true; while (std::cin >> a >> b, a) { if (first) s...
#include <iostream> using namespace std; bool isUruu(int y) { if (y % 4 == 0) { if (y % 100 == 0) { if (y % 400 == 0) return true; return false; } return true; } return false; } int main() { int a, b; bool first = false; while (std::cin >> a >> b, a) { if (first) ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 146], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 147], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 147], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 146]]
1
165
26
#include <iostream> using namespace std; int main() { int a, b; int line = 0; while (++line) { cin >> a >> b; if (a == 0 && b == 0) break; int count = 0; if (line > 1) cout << "\n"; for (int i = a; i < b; i++) { if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) { cou...
#include <iostream> using namespace std; int main() { int a, b; int line = 0; while (++line) { cin >> a >> b; if (a == 0 && b == 0) break; int count = 0; if (line > 1) cout << "\n"; for (int i = a; i <= b; i++) { if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) { co...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
131
2
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <vector> using namespace std; #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <vector> using namespace std; #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
208
4
#include <iostream> using namespace std; int uruu(int i) { if (i % 4 != 0) return 0; else if (i % 400 == 0) return 1; else if (i % 100 == 0) return 0; return 1; } int main() { int a, b, k = 11111; while (1) { cin >> a >> b; if (a == 0) break; if (k != 11111) cout << end...
#include <iostream> using namespace std; int uruu(int i) { if (i % 4 != 0) return 0; else if (i % 400 == 0) return 1; else if (i % 100 == 0) return 0; return 1; } int main() { int a, b, k = 11111; while (1) { cin >> a >> b; if (a == 0) break; if (k != 11111) cout << end...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
154
4
#include <iostream> using namespace std; #define p(dis) cout << dis << endl int func(int a, int b) { int f = 1; for (int i = a; i <= b; i++) { if (i % 4 == 0) { if (i % 100 == 0) { if (i % 400 == 0) p(i), f = 0; continue; } p(i), f = 0; } } return f; } int m...
#include <iostream> using namespace std; #define p(dis) cout << dis << endl int func(int a, int b) { int f = 1; for (int i = a; i <= b; i++) { if (i % 4 == 0) { if (i % 100 == 0) { if (i % 400 == 0) p(i), f = 0; continue; } p(i), f = 0; } } return f; } int m...
[["-", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
160
4
#include <iostream> using namespace std; int main() { int a, b, x = 0, num = 0; ; while (cin >> a >> b) { if (a == 0 && b == 0) break; if (num == 0) cout << endl; for (int i = a; i <= b; i++) { if (i % 400 == 0) { cout << i << endl; x = 1; } else if (i % 100 == ...
#include <iostream> using namespace std; int main() { int a, b, x = 0, num = 0; ; while (cin >> a >> b) { if (a == 0 && b == 0) break; if (num != 0) cout << endl; for (int i = a; i <= b; i++) { if (i % 400 == 0) { cout << i << endl; x = 1; } else if (i % 100 == ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
151
2
#include <bits/stdc++.h> #define stirng string #define vvi vector<vector<int>> #define vi vector<int> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; const int inf = 1e9 + 7; /*int main() { string a; cin >> a; string s = ""; for (int i = 0; i < 10; i++) { s += a[i]; } for (int i ...
#include <bits/stdc++.h> #define stirng string #define vvi vector<vector<int>> #define vi vector<int> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; const int inf = 1e9 + 7; /*int main() { string a; cin >> a; string s = ""; for (int i = 0; i < 10; i++) { s += a[i]; } for (int i ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
1
187
4
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include...
[["-", 8, 9, 0, 7, 15, 34, 12, 16, 17, 67], ["+", 8, 9, 0, 7, 15, 34, 12, 16, 17, 106]]
1
202
2
import sys from collections import defaultdict data_list = [] for line in sys.stdin: data_list.append(list(map(int, line.split()))) def is_half_euler_graph(node_list): isBool = True for node in node_list: for dic_key, dic_value in node.items(): if dic_key != 1 and dic_key != 2: ...
import sys from collections import defaultdict data_list = [] for line in sys.stdin: data_list.append(list(map(int, line.split()))) def is_half_euler_graph(node_list): for node in node_list: isBool = True for dic_key, dic_value in node.items(): if dic_key != 1 and dic_key != 2: ...
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 14, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 146], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 12, 146]]
5
259
6
import sys v=[0]*101 for e in sys.stdin: a,b=map(int,e.split()) if a==0: print(['ng','ok'][1&v[1]and 1&v[2]and sum(x&1 for x in v[3:])==0]) v=[0]*101 v[a]+=1;v[b]+=1
import sys v=[0]*101 for e in sys.stdin: a,b=map(int,e.split()) if a==0: print(['NG','OK'][1&v[1]and 1&v[2]and sum(x&1 for x in v[3:])==0]) v=[0]*101 v[a]+=1;v[b]+=1
[["-", 3, 4, 0, 206, 51, 634, 0, 557, 0, 6], ["+", 3, 4, 0, 206, 51, 634, 0, 557, 0, 6]]
5
99
4
import sys v=[0]*101 for e in sys.stdin: a,b=map(int,e.split()) v[a]+=1;v[b]+=1 if a==0: print(['NG','OK'][v[1]&1*v[2]&1*sum(x&1 for x in v)==2]) v=[0]*101
import sys v=[0]*101 for e in sys.stdin: a,b=map(int,e.split()) v[a]+=1;v[b]+=1 if a==0: print(['NG','OK'][(v[1]&1)*(v[2]&1)*sum(x&1 for x in v)==2]) v=[0]*100
[["+", 206, 666, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 206, 666, 0, 657, 31, 657, 31, 23, 0, 25], ["+", 206, 666, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 206, 666, 0, 657, 31, 657, 12, 23, 0, 25], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
95
6
while True: try: cross=[0]*101 while True: a,b=list(map(int,input().split())) if (a,b)==(0,0): break cross[a]+=1 cross[b]+=1 if cross[1]%2==cross[2]%2 and len([x for x in cross[3:] if x%2==1])==0: print("OK") ...
while True: try: cross=[0]*101 while True: a,b=list(map(int,input().split())) if (a,b)==(0,0): break cross[a]+=1 cross[b]+=1 if cross[1]%2==cross[2]%2==1 and len([x for x in cross[3:] if x%2==1])==0: print("OK") ...
[["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
115
4
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (division, absolute_import, print_function, unicode_literals) from sys import stdin from collections import Counter cnt = Counter() for line in stdin: start, end = (int(s) for s in line.split()) if start or end: ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (division, absolute_import, print_function, unicode_literals) from sys import stdin from collections import Counter cnt = Counter() for line in stdin: start, end = (int(s) for s in line.split()) if start or end: ...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
126
2
import java.util.*; public class Main { Scanner sc = new Scanner(System.in); void doIt() { while (sc.hasNext()) { Stack<Double> st = new Stack<Double>(); String str[] = sc.nextLine().split(" "); for (int i = 0; i < str.length; i++) { if (str[i].equals("+")) { double x1 = st....
import java.util.*; public class Main { Scanner sc = new Scanner(System.in); void doIt() { while (sc.hasNext()) { Stack<Double> st = new Stack<Double>(); String str[] = sc.nextLine().split(" "); for (int i = 0; i < str.length; i++) { if (str[i].equals("+")) { double x1 = st....
[["-", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22], ["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 21]]
3
326
6
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Deque; import java.util.LinkedList; import java.util.StringTokenizer; import java.util.regex.Pattern; public class Main { Boolean isNumber(String s) { return Pattern.matches("\\A[0-9]+.?[0-9]*\\z", s); ...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Deque; import java.util.LinkedList; import java.util.StringTokenizer; import java.util.regex.Pattern; public class Main { boolean isNumber(String s) { return Pattern.matches("\\A-?[0-9]+.?[0-9]*\\z", s)...
[["-", 0, 493, 0, 235, 8, 498, 0, 195, 39, 78], ["+", 0, 493, 0, 235, 8, 498, 0, 195, 39, 523], ["-", 0, 37, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 37, 0, 492, 3, 4, 0, 5, 0, 491]]
3
328
4
#include <ctype.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> int main() { char num[100] = {'\0'}; char *tp; double stack[220] = {0}; int i, j; while (fgets(num, sizeof(num), stdin) != NULL) { i = 0; tp = strtok(num, " "); ...
#include <ctype.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> int main() { char num[100] = {'\0'}; char *tp; double stack[220] = {0}; int i, j; while (fgets(num, sizeof(num), stdin) != NULL) { i = 0; tp = strtok(num, " "); ...
[["-", 15, 23, 0, 16, 12, 23, 0, 16, 17, 98], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 106]]
0
363
2
double *q, s[99], *p = s + 2, v; short t[9]; main(c) { for (; ~scanf("%[^ \n]%c", t, &c); c - 10 || printf("%f\n", *--p)) v = *--p, q = p - 1, *q = *t - 43 ? *t - 45 ? *t - 42 ? *t - 47 ? (p++, *p++ = atof(t), *q) : *q / v : *q * v ...
double *q, s[99], *p = s + 2, v, atof(); short t[9]; main(c) { for (; ~scanf("%[^ \n]%c", t, &c); c - 10 || printf("%f\n", *--p)) v = *--p, q = p - 1, *q = *t - 43 ? *t - 45 ? *t - 42 ? *t - 47 ? (p++, *p++ = atof(t), *q) : *q / v : *q * v ...
[["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 0, 30, 0, 43, 49, 53, 49, 22], ["+", 0, 30, 0, 43, 49, 53, 54, 55, 0, 24], ["+", 0, 30, 0, 43, 49, 53, 54, 55, 0, 25]]
0
136
10
float *q, s[99], *p = s, v, atof(); t; main(c) { for (; t = 0, ~scanf("%s%c", &t, &c); c & 2 && printf("%f \n", *--p)) t < 48 ? v = *--p, q = p - 1, *q = t & 1 ? t & 2 ? t & 4 ? *q / v : *q + v : *q - v : *q * v : (*p++ = atof(&t)); }
double *q, s[99], *p = s, v, atof(); t; main(c) { for (; t = 0, ~scanf("%s%c", &t, &c); c & 2 && printf("%f \n", *--p)) t < 48 ? v = *--p, q = p - 1, *q = t & 1 ? t & 2 ? t & 4 ? *q / v : *q + v : *q - v : *q * v : (*p++ = atof(&t)); }
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]]
0
128
2
#include <math.h> #include <stdio.h> double stack[200]; int sp; void push(double n) { stack[sp++] = n; } double pop(void) { return (stack[--sp]); } int main(void) { char str[1000]; char *p; double a, b; while (fgets(str, 1000, stdin) != NULL) { p = str; sp = 0; while (*p != '\0' && *p != '\n') ...
#include <math.h> #include <stdio.h> double stack[200]; int sp; void push(double n) { stack[sp++] = n; } double pop(void) { return (stack[--sp]); } int main(void) { char str[1000]; char *p; double a, b; while (fgets(str, 1000, stdin) != NULL) { p = str; sp = 0; while (*p != '\0' && *p != '\n') ...
[["-", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22]]
0
362
4
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <typeinfo> #include <vector> #define PI 3.14159265359 #define INF 99999999; #define rep(i, ...
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <typeinfo> #include <vector> #define PI 3.14159265359 #define INF 99999999; #define rep(i, ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
462
2
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; #define rep2(x, from, to) for (int x = (from); x < (to); ++(x)) #define rep(x, to) rep2(x, 0, to) int main() { string str; while (getline(cin, str)) { stack<doub...
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; #define rep2(x, from, to) for (int x = (from); x < (to); ++(x)) #define rep(x, to) rep2(x, 0, to) int main() { string str; while (getline(cin, str)) { stack<doub...
[["-", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["-", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120]]
1
241
4
#include <bits/stdc++.h> #define range(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define rep(i, n) range(i, 0, n) using namespace std; int main(void) { while (1) { string s; getline(cin, s); if (cin.eof()) break; stringstream ss(s); vector<double> stk; while (1) { if (ss.eof()...
#include <bits/stdc++.h> #define range(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define rep(i, n) range(i, 0, n) using namespace std; int main(void) { while (1) { string s; getline(cin, s); if (cin.eof()) break; stringstream ss(s); vector<double> stk; while (1) { if (ss.eof()...
[["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40]]
1
258
4
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <stack> using namespace std; int main() { string str; while (getline(cin, str)) { stack<double> S; double now = 0; for (int i = 0; i < str.size(); i++) { if ('0' <= str[i] && str[i] <= '9' && now < 0) { no...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <stack> using namespace std; int main() { string str; while (getline(cin, str)) { stack<double> S; double now = 0; for (int i = 0; i < str.size(); i++) { if ('0' <= str[i] && str[i] <= '9' && now < 0) { no...
[["-", 75, 76, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 75, 76, 0, 57, 64, 9, 0, 43, 39, 40]]
1
404
2
#include <iomanip> #include <iostream> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define MAX_DATA_NUM 10000000 int S[MAX_DATA_NUM]; int head; void push(double num) { S[head] = num; head++; if (head == MAX_DATA_NUM) head = 0; } double pop() { head--; ...
#include <iomanip> #include <iostream> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define MAX_DATA_NUM 10000000 double S[MAX_DATA_NUM]; int head; void push(double num) { S[head] = num; head++; if (head == MAX_DATA_NUM) head = 0; } double pop() { head--;...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]]
1
381
2
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; // const int INF = 1e8; using namespace std; vector<string> split(string in, char sp = ' ') { vecto...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; // const int INF = 1e8; using namespace std; vector<string> split(string in, char sp = ' ') { vecto...
[["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40]]
1
294
4
#include <iostream> #include <stack> #include <stdio.h> #include <vector> using namespace std; typedef long double ldouble; string in; int main() { while (getline(cin, in)) { stack<ldouble> st; for (int i = 0; i < in.size(); i++) { if (i < in.size() - 1 && in[i] == '-' && in[i + 1] >= '0' && ...
#include <iostream> #include <stack> #include <stdio.h> #include <vector> using namespace std; typedef long double ldouble; string in; int main() { while (getline(cin, in)) { stack<ldouble> st; for (int i = 0; i < in.size(); i++) { if (i < in.size() - 1 && in[i] == '-' && in[i + 1] >= '0' && ...
[["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["-", 75, 76, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 75, 76, 0, 57, 64, 9, 0, 43, 39, 40]]
1
502
6
#include <cstdio> #include <cstring> #include <iostream> #include <stack> using namespace std; char in[100]; int main() { while (cin.getline(in, 99) && in[0]) { stack<long double> s; char *c = in; do { if ('0' <= *c && *c <= '9' || *c == '-' && '0' < c[1] && c[1] <= '9') { int a = 0; ...
#include <cstdio> #include <cstring> #include <iostream> #include <stack> using namespace std; char in[100]; int main() { while (cin.getline(in, 99) && in[0]) { stack<long double> s; char *c = in; do { if ('0' <= *c && *c <= '9' || *c == '-' && '0' < c[1] && c[1] <= '9') { int a = 0; ...
[["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]]
1
330
2
#include <algorithm> #include <cctype> #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; int main() { string s; while (getline(cin, s)) { stringstream ss(s); stack<double> stk; while (ss >> s) { if (isdigit(s[0])) {...
#include <algorithm> #include <cctype> #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; int main() { string s; while (getline(cin, s)) { stringstream ss(s); stack<double> stk; while (ss >> s) { if (isdigit(*s.rbegi...
[["+", 15, 339, 51, 2, 3, 4, 0, 66, 17, 48], ["-", 51, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 51, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["-", 51, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 3, 4, 0, 66, 28, 2, 63, 118, 17, 131], ["+", 3, 4, 0, 66, 28, 2, 63, 118, 119, 120], ["+", 3, 4, 0, 66, 28, 2, 3, 4, 0, 24], ["+", 3, 4, ...
1
209
8