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 |
|---|---|---|---|---|---|
from sys import stdin
if __name__ == '__main__':
for n in stdin:
if int(n) == 0:
break
bottom_total = []
right_total = []
for _ in range(int(n)):
line = input().split(' ')
total = 0
for i, v in enumerate(line):
print(r... | from sys import stdin
if __name__ == '__main__':
# is_begin = False
for n in stdin:
if int(n) == 0:
break
# else:
# if is_begin:
# print()
# is_begin = True
bottom_total = []
right_total = []
for _ in range(int(n)):
... | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["-", 8, 196, 0, 1, 0, 677, 31, 206, 206, 22], ["+", 8, 196, 0, 1, 0, 677, 31, 206, 206, 22], ["-", 500, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 500, 652, 3, 4, 0, 652, 3, 4, 0, 22]] | 5 | 183 | 6 |
while 1:
n=int(input())
if n==0:break;
a=[]
for i in range(n):
a[i]=[list(map(int,input().split()))]
a[i]+=[sum(a[i])]
for s in a[i]:print("%5d"%s,end='')
print()
for c in zip(*a):print("%5d"%sum(c),end='')
print()
| while 1:
n=int(input())
if n==0:break;
a=[]
for i in range(n):
a+=[list(map(int,input().split()))]
a[i]+=[sum(a[i])]
for s in a[i]:print("%5d"%s,end='')
print()
for c in zip(*a):print("%5d"%sum(c),end='')
print()
| [["-", 8, 196, 0, 1, 0, 662, 31, 206, 0, 70], ["-", 8, 196, 0, 1, 0, 662, 31, 206, 206, 22], ["-", 8, 196, 0, 1, 0, 662, 31, 206, 0, 73], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107]] | 5 | 118 | 19 |
<?php
$inning = trim(fgets(STDIN));
$scores = array();
for($i = 0; $i < $inning; ++$i) {
$scores[$i] = 0;
}
$outcount = 0;
$base = 0;
while(true) {
$turn = floor($outcount / 3);
$key = trim(fgets(STDIN));
switch($key) {
case 'HIT':
$scores[$turn] += $base & 1;
$base = ($base >> 1) | 4;
br... | <?php
$inning = trim(fgets(STDIN));
$scores = array();
for($i = 0; $i < $inning; ++$i) {
$scores[$i] = 0;
}
$outcount = 0;
$base = 0;
while(true) {
$turn = floor($outcount / 3);
$key = trim(fgets(STDIN));
switch($key) {
case 'HIT':
$scores[$turn] += $base & 1;
$base = ($base >> 1) | 4;
br... | [["-", 0, 100, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 109], ["+", 0, 100, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 100, 0, 57, 15, 23, 0, 16, 12, 612]] | 6 | 214 | 4 |
import java.util.Scanner;
// import java.io.*;
// import java.util.Arrays;
public class Main {
public static void main(String[] args) throws java.io.IOException {
Scanner scan = new Scanner(System.in);
// InputStreamReader is = new InputStreamReader(System.in);
// BufferedReader br = new BufferedReader(is... | import java.util.Scanner;
// import java.io.*;
// import java.util.Arrays;
public class Main {
public static void main(String[] args) throws java.io.IOException {
Scanner scan = new Scanner(System.in);
// InputStreamReader is = new InputStreamReader(System.in);
// BufferedReader br = new BufferedReader(is... | [["-", 75, 196, 0, 1, 0, 11, 31, 504, 71, 499], ["+", 75, 196, 0, 1, 0, 11, 31, 504, 71, 22]] | 3 | 205 | 2 |
import java.util.*;
class Main {
public static void main(String[] z) {
Scanner s = new Scanner(System.in);
String x;
for (int t = s.nextInt(), r, p, o, b; t-- > 0; System.out.println(p))
for (r = p = o = 0; !(x = s.next()).equals("OUT") || ++o < 3;) {
if (x.equals("HIT")) {
b = r >... | import java.util.*;
class Main {
public static void main(String[] z) {
Scanner s = new Scanner(System.in);
String x;
for (int t = s.nextInt(), r, p, o, b; t-- > 0; System.out.println(p))
for (r = p = o = 0; !(x = s.next()).equals("OUT") || ++o < 3;) {
if (x.equals("HIT")) {
b = r >... | [["-", 64, 196, 0, 1, 0, 11, 12, 510, 64, 499], ["+", 64, 196, 0, 1, 0, 11, 12, 510, 64, 499]] | 3 | 168 | 2 |
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc;
static final int INF = 1 << 28;
static final double EPS = 1e-9;
void run() {
sc = new Scanner(System.in);
int n = sc.nextIn... | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc;
static final int INF = 1 << 28;
static final double EPS = 1e-9;
void run() {
sc = new Scanner(System.in);
int n = sc.nextIn... | [["-", 8, 196, 0, 57, 15, 15, 0, 504, 71, 22], ["+", 8, 196, 0, 57, 15, 15, 0, 504, 71, 22], ["-", 8, 196, 0, 1, 0, 11, 31, 504, 71, 22], ["+", 8, 196, 0, 1, 0, 11, 31, 504, 71, 22]] | 3 | 328 | 4 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
List<Integer> result = new ArrayList<Integer>();
int n = stdIn.nextInt();
int count = 0;
int[] base = new int[4];
while (n != 0) {
String str = stdIn.next();
i... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
List<Integer> result = new ArrayList<Integer>();
int n = stdIn.nextInt();
int count = 0;
int[] base = new int[4];
while (n != 0) {
String str = stdIn.next();
i... | [["+", 0, 57, 64, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 12, 499], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35]] | 3 | 253 | 4 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
final String HIT = "HIT", HOMERUN = "HOMERUN", OUT = "OUT";
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int out, point, rui;
String j;
for (int i = 0; i < n; i++) {
out = 0;
poin... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
final String HIT = "HIT", HOMERUN = "HOMERUN", OUT = "OUT";
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int out, point, rui;
String j;
for (int i = 0; i < n; i++) {
out = 0;
poin... | [["-", 0, 7, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 492, 141, 22]] | 3 | 193 | 2 |
#include <stdio.h>
#include <string.h>
int main(void) {
int n, rui, out, score;
char ive[30];
scanf("%d", &n);
if (n == 0)
return (0);
while (n != 0) {
n--;
rui = 0;
out = 0;
score = 0;
while (out < 3) {
scanf("%s", ive);
if (strcmp(ive, "HIT") == 0) {
rui++;
... | #include <stdio.h>
#include <string.h>
int main(void) {
int n, rui, out, score;
char ive[30];
scanf("%d", &n);
if (n == 0)
return (0);
while (n != 0) {
n--;
rui = 0;
out = 0;
score = 0;
while (out < 3) {
scanf("%s", ive);
if (strcmp(ive, "HIT") == 0) {
rui++;
... | [["-", 64, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 23, 0, 16, 12, 13]] | 0 | 182 | 2 |
#include <stdio.h>
int main() {
int n, hitcount = 0, outcount = 0, point = 0;
char s[8];
scanf("%d", &n);
while (1) {
scanf("%s", &s);
if (s[1] == 'U')
outcount++;
if (outcount == 3) {
printf("%d\n", point);
point = 0;
n--;
outcount = 0;
}
if (!n)
break;
... | #include <stdio.h>
int main() {
int n, hitcount = 0, outcount = 0, point = 0;
char s[8];
scanf("%d", &n);
while (1) {
scanf("%s", &s);
if (s[1] == 'U')
outcount++;
if (outcount == 3) {
printf("%d\n", point);
point = 0;
n--;
outcount = 0;
hitcount = 0;
}
if... | [["+", 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, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 0 | 161 | 4 |
#include <stdio.h>
#include <string.h>
int main() {
int n;
scanf("%d", &n);
int coutOUT = 0, coutHIT = 0, point = 0;
;
char event[10];
while (n) {
while (coutOUT < 3) {
scanf("%s", event);
if (strcmp(event, "HIT") == 0) {
coutHIT += 1;
if (coutHIT == 4) {
point += ... | #include <stdio.h>
#include <string.h>
int main() {
int n;
scanf("%d", &n);
int coutOUT = 0, coutHIT = 0, point = 0;
;
char event[10];
while (n) {
while (coutOUT < 3) {
scanf("%s", event);
if (strcmp(event, "HIT") == 0) {
coutHIT += 1;
if (coutHIT == 4) {
point += ... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13]] | 0 | 174 | 2 |
o, x, b;
main(a) {
for (scanf("%d"); ~scanf("%s", &a);
o == 3 ? o = b = x = !printf("%d\n", x) : 0)
for (a %= 8, a - 7 ? b = b * 2 + 1, x += b / 8, b &= 7 : o++; !a & b;
b /= 2)
x++;
} | o, x, b;
main(a) {
for (scanf("%d"); ~scanf("%s", &a);
o == 3 ? o = b = x = !printf("%d\n", x) : 0)
for (a %= 6, a - 5 ? b = b * 2 + 1, x += b / 8, b &= 7 : o++; !a & b;
b /= 2)
x++;
} | [["-", 0, 7, 8, 7, 10, 34, 31, 11, 12, 13], ["+", 0, 7, 8, 7, 10, 34, 31, 11, 12, 13], ["-", 8, 7, 10, 34, 12, 34, 31, 16, 12, 13], ["+", 8, 7, 10, 34, 12, 34, 31, 16, 12, 13]] | 0 | 98 | 4 |
o, x, b;
main(a) {
for (scanf("%d"); ~scanf("%s", &a); !a ? x += b + 1,
b = 0 : a - 5 ? x += ++b > 3 ? x = 3,
1
: 0
: ++o == 3 ? o = b = x = !printf("%d\... | o, x, b;
main(a) {
for (scanf("%d"); ~scanf("%s", &a); !a ? x += b + 1,
b = 0 : a - 5 ? x += ++b > 3 ? b = 3,
1
: 0
: ++o == 3 ? o = b = x = !printf("%d\... | [["-", 64, 11, 12, 41, 0, 42, 0, 11, 31, 22], ["+", 64, 11, 12, 41, 0, 42, 0, 11, 31, 22]] | 0 | 92 | 2 |
// AOJ Volume 1 Problem 0103
#include <stdio.h>
#include <string.h>
int main(void) {
int n;
char event[8];
int base1, base2, base3;
int out;
int score;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
base1 = base2 = base3 = out = score = 0;
while (1) {
scanf("%s", event);
if (st... | // AOJ Volume 1 Problem 0103
#include <stdio.h>
#include <string.h>
int main(void) {
int n;
char event[8];
int base1, base2, base3;
int out;
int score;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
base1 = base2 = base3 = out = score = 0;
while (1) {
scanf("%s", event);
if (st... | [["-", 0, 1, 0, 11, 12, 11, 12, 11, 31, 22], ["+", 0, 1, 0, 11, 12, 11, 12, 11, 31, 22]] | 0 | 187 | 2 |
#include <stdio.h>
int main(void) {
int game_no;
int base;
int out;
int point;
char event[3];
scanf("%d", &game_no);
while (game_no--) {
point = base = out = 0;
while (out - 3) {
scanf("%2s", event);
if (event[0] == 'H') {
if (++base > 3) {
point++;
base... | #include <stdio.h>
int main(void) {
int game_no;
int base;
int out;
int point;
char event[9];
scanf("%d", &game_no);
while (game_no--) {
point = base = out = 0;
while (out - 3) {
scanf("%7s", event);
if (event[0] == 'H') {
if (++base > 3) {
point++;
base... | [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 138 | 4 |
b, o, s;
main(a) {
for (scanf("%d"); ~scanf("%s", &a);)
b = a % 3 ? a & 1
? ++o % 3 ? b : (s = !printf("%d\n", b > 3 ? s + b - 3 : s))
: b + 1
: (s += b + 1);
} | b, o, s;
main(a) {
for (scanf("%d"); ~scanf("%s", &a);)
b = a % 3 ? a & 1
? ++o % 3 ? b : (s = !printf("%d\n", b > 3 ? s + b - 3 : s))
: b + 1
: !(s += b + 1);
} | [["+", 8, 1, 0, 11, 12, 41, 75, 91, 17, 111]] | 0 | 87 | 14 |
b, o, s;
main(a) {
for (; ~scanf("%s", &a);)
a - 249 &&
(b = a % 3 ? a & 1 ? ++o % 3
? b
: (s = !printf("%d\n", b > 3 ? s + b - 3 : s))
: b + 1
: !(s -= ~b));
} | b, o, s;
main(a) {
for (; ~scanf("%s", &a);)
a < 1e5
?: (b = a % 3 ? a & 1
? ++o % 3
? b
: (s = !printf("%d\n", b > 3 ? s + b - 3 : s))
: b + 1
: !(s -= ~b));
} | [["-", 0, 7, 8, 1, 0, 16, 31, 16, 17, 33], ["-", 0, 7, 8, 1, 0, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 1, 0, 16, 17, 98], ["+", 0, 7, 8, 1, 0, 41, 15, 16, 17, 18], ["+", 0, 7, 8, 1, 0, 41, 15, 16, 12, 13], ["+", 8, 9, 0, 7, 8, 1, 0, 41, 0, 101], ["+", 8, 9, 0, 7, 8, 1, 0, 41, 0, 102]] | 0 | 87 | 7 |
#include <stdio.h>
#include <string.h>
int main() {
int a, n, run = 0, point = 0, out = 0;
char eve[10];
scanf("%d", &n);
for (a = 0; a < n;) {
scanf("%s", eve);
if (strcmp(eve, "HIT") == 0) {
if (run != 3)
run++;
else {
point++;
run = 0;
}
} else if (strcm... | #include <stdio.h>
#include <string.h>
int main() {
int a, n, run = 0, point = 0, out = 0;
char eve[10];
scanf("%d", &n);
for (a = 0; a < n;) {
scanf("%s", eve);
if (strcmp(eve, "HIT") == 0) {
if (run != 3)
run++;
else {
point++;
}
} else if (strcmp(eve, "HOMERUN")... | [["-", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]] | 0 | 181 | 4 |
#include <stdio.h>
#include <string.h>
int main(void) {
int HIT = 0, OUT = 0, POINT = 0, a, b, c = 0;
char EVENT[8];
for (;;) {
scanf("%d", &a);
for (b = 0;; b++) {
scanf("%s", &EVENT);
if (strcmp(EVENT, "OUT") == 0)
OUT++;
if (strcmp(EVENT, "HIT") == 0)
if (HIT == 4)
... | #include <stdio.h>
#include <string.h>
int main(void) {
int HIT = 0, OUT = 0, POINT = 0, a, b, c = 0;
char EVENT[8];
for (;;) {
scanf("%d", &a);
for (b = 0;; b++) {
scanf("%s", &EVENT);
if (strcmp(EVENT, "OUT") == 0)
OUT++;
if (strcmp(EVENT, "HIT") == 0)
if (HIT == 3)
... | [["-", 0, 57, 64, 57, 15, 23, 0, 16, 12, 13], ["+", 0, 57, 64, 57, 15, 23, 0, 16, 12, 13]] | 0 | 182 | 2 |
#include <stdio.h>
#include <string.h>
#define OUT_COUNT 0
#define POINT_COUNT 1
void initilaize(char array[]);
void process(int count[]); //処理関数
main() {
int i = 0, n = 0;
int count[2];
scanf("%d\n", &n);
while (i < n) {
count[0] = 0, count[1] = 0; //初期化
process(count); //処理関数呼び出し
pr... | #include <stdio.h>
#include <string.h>
#define OUT_COUNT 0
#define POINT_COUNT 1
void initilaize(char array[]);
void process(int count[]); //処理関数
main() {
int i = 0, n = 0;
int count[2];
scanf("%d\n", &n);
while (i < n) {
count[0] = 0, count[1] = 0; //初期化
process(count); //処理関数呼び出し
pr... | [["-", 64, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 23, 0, 16, 12, 13]] | 0 | 291 | 2 |
// Name: Baseball Simulation
// Level: 1
// Category: やるだけ
// Note:
/**
* 仕様のとおりに実装する。
*
* オーダーは O(E)。
* ただし、Eはイベントの個数。
*/
#include <iostream>
#include <string>
using namespace std;
bool solve() {
int out = 0;
int b1 = 0, b2 = 0, b3 = 0;
int score = 0;
while (out < 3) {
string event;
cin >> even... | // Name: Baseball Simulation
// Level: 1
// Category: やるだけ
// Note:
/**
* 仕様のとおりに実装する。
*
* オーダーは O(E)。
* ただし、Eはイベントの個数。
*/
#include <iostream>
#include <string>
using namespace std;
bool solve() {
int out = 0;
int b1 = 0, b2 = 0, b3 = 0;
int score = 0;
while (out < 3) {
string event;
cin >> even... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107]] | 1 | 177 | 2 |
#include <array>
#include <iostream>
class Baseball {
private:
int out_count;
std::array<int, 4> runner; // first second third home
// runner:1 no:0 home:point
public:
Baseball() {
out_count = 0;
for (int i = 0; i < 4; ++i)
runner[i] = 0;
}
void ining() {
whil... | #include <array>
#include <iostream>
class Baseball {
private:
int out_count;
std::array<int, 4> runner; // first second third home
// runner:1 no:0 home:point
public:
Baseball() {
out_count = 0;
for (int i = 0; i < 4; ++i)
runner[i] = 0;
}
void ining() {
whil... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 294 | 2 |
#include <iostream>
#include <string>
class Baseball {
private:
int out;
int runner;
int point;
public:
void init();
int get_out();
int get_point();
void event_hit();
void event_homerun();
void event_out();
};
void Baseball::init() {
out = 0;
runner = 0;
point = 0;
}
int Baseball::get_out() ... | #include <iostream>
#include <string>
class Baseball {
private:
int out;
int runner;
int point;
public:
void init();
int get_out();
int get_point();
void event_hit();
void event_homerun();
void event_out();
};
void Baseball::init() {
out = 0;
runner = 0;
point = 0;
}
int Baseball::get_out() ... | [["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 280 | 4 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define PI 4 * atan(1)
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
bool base[3] = {fal... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define PI 4 * atan(1)
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
bool base[3] = {fal... | [["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]] | 1 | 272 | 4 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int inning_num;
cin >> inning_num;
for (int i = 0; i < inning_num; i++) {
int out = 0;
unsigned char state = 0;
int score = 0;
while (out != 3) {
string in;
cin >> in;
if (in == "OUT") {
state &= 0;... | #include <iostream>
#include <string>
using namespace std;
int main() {
int inning_num;
cin >> inning_num;
for (int i = 0; i < inning_num; i++) {
int out = 0;
unsigned char state = 0;
int score = 0;
while (out != 3) {
string in;
cin >> in;
if (in == "OUT") {
out++;
... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 161], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 171 | 4 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int combi[100000][3] = {0}, m = 0;
int input, price[100000] = {0}, weight;
int a, b, c, a1, b1, c1;
while (cin >> input) {
if (input == 0)
break;
for (int i = 0; i < 26; i++) { // generate combination of weight over input... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int combi[100000][3] = {0}, m = 0;
int input, price[100000] = {0}, weight;
int a, b, c, a1, b1, c1;
while (cin >> input) {
if (input == 0)
break;
for (int i = 0; i < 26; i++) { // generate combination of weight over input... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]] | 1 | 344 | 2 |
// 32
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
for (int n; cin >> n, n;) {
int mc = 1 << 30;
for (int a = 0; a * 200 < n + 200; a++) {
for (int b = 0; a * 200 + b * 300 < n + 300; b++) {
for (int c = 0; a * 200 + b * 300 + c * 500 < n + 500; c++) {
i... | // 32
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
for (int n; cin >> n, n;) {
int mc = 1 << 30;
for (int a = 0; a * 200 < n + 200; a++) {
for (int b = 0; a * 200 + b * 300 < n + 300; b++) {
for (int c = 0; a * 200 + b * 300 + c * 500 < n + 500; c++) {
i... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]] | 1 | 201 | 2 |
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define INF (1 << 29)
int N;
bool ok(int a, int b, int c) {
if (a * 200 + b * 300 + c * 500 >= N)
return true;
return false;
}
int calc(int a, int b, int c) {
return a * 380 -... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define INF (1 << 29)
int N;
bool ok(int a, int b, int c) {
if (a * 200 + b * 300 + c * 500 == N)
return true;
return false;
}
int calc(int a, int b, int c) {
return a * 380 -... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]] | 1 | 221 | 2 |
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.TreeMap;
public class Main {
public static Scanner sc;
public static ArrayList<Integer> list;
public static void main(String[] args) throws Exception {
sc = new Scanner(System.in);
while (sc.hasNext()) {... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.TreeMap;
public class Main {
public static Scanner sc;
public static ArrayList<Integer> list;
public static void main(String[] args) throws Exception {
sc = new Scanner(System.in);
while (sc.hasNext()) {... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47]] | 3 | 268 | 2 |
#include <stdio.h>
#define sqr(x) ((x) * (x))
void swap(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
int main(void) {
int i, s[3], n, r;
while (1) {
scanf("%d %d %d", &s[0], &s[1], &s[2]);
if (!s[0] && !s[1] && !s[2])
break;
if (s[0] > s[1])
swap(&s[0], &s[1]);
if (s[1] > ... | #include <stdio.h>
#define sqr(x) ((x) * (x))
void swap(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
int main(void) {
int i, s[3], n, r;
while (1) {
scanf("%d %d %d", &s[0], &s[1], &s[2]);
if (!s[0] && !s[1] && !s[2])
break;
if (s[0] > s[1])
swap(&s[0], &s[1]);
if (s[1] > ... | [["-", 31, 16, 31, 2, 3, 4, 0, 16, 17, 85], ["-", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 85], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 31, 13], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 17, 48]] | 0 | 276 | 6 |
#include <stdio.h>
void swap(int *a, int *b) {
*a += *b;
*b = *a - *b;
*a -= *b;
}
int main(void) {
int x, y, z;
int n;
int r;
int i;
while (1) {
scanf("%d %d %d", &x, &y, &z);
if (x == 0 && y == 0 && z == 0) {
break;
}
if (x < y) {
swap(&x, &y);
}
if (y > z) {
... | #include <stdio.h>
void swap(int *a, int *b) {
*a += *b;
*b = *a - *b;
*a -= *b;
}
int main(void) {
int x, y, z;
int n;
int r;
int i;
while (1) {
scanf("%d %d %d", &x, &y, &z);
if (x == 0 && y == 0 && z == 0) {
break;
}
if (x > y) {
swap(&x, &y);
}
if (y > z) {
... | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47]] | 0 | 210 | 2 |
#include <math.h>
#include <stdio.h>
int main(void) {
int x, y, z;
for (;;) {
scanf("%d%d%d", &x, &y, &z);
if (x == y == z == 0)
break;
int n;
scanf("%d", &n);
int i;
int r[10000];
for (i = 0; i < n; i++) { //入力
scanf("%d", &r[i]);
}
double a, b, a2, b2, c2, csub;
... | #include <math.h>
#include <stdio.h>
int main(void) {
int x, y, z;
for (;;) {
scanf("%d%d%d", &x, &y, &z);
if (x == 0)
break;
int n;
scanf("%d", &n);
int i;
int r[10000];
for (i = 0; i < n; i++) { //入力
scanf("%d", &r[i]);
}
double a, b, a2, b2, c2, csub;
if (x >... | [["-", 15, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 60], ["-", 0, 57, 15, 23, 0, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60]] | 0 | 258 | 4 |
#include <iostream>
using namespace std;
int main() {
int n, r, d, w, h, x;
while (1) {
cin >> d >> w >> h;
if (d + w + h == 0)
return 0;
if (d <= h && w <= h)
x = d * d + w * w;
else if (d <= w && h <= w)
x = d * d + h * h;
else if (w <= d && h <= d)
x = w * w + h * h;
... | #include <iostream>
using namespace std;
int main() {
int n, r, d, w, h, x;
while (1) {
cin >> d >> w >> h;
if (d + w + h == 0)
return 0;
if (d <= h && w <= h)
x = d * d + w * w;
else if (d <= w && h <= w)
x = d * d + h * h;
else if (w <= d && h <= d)
x = w * w + h * h;
... | [["-", 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 | 170 | 4 |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define REP(i, k, n) for (int i = k; i < n; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
vector<int> a(3);
while (true) {
cin >> a[0] >> a[1] >> a[2];
if (a[0] == 0 && a[1] == 0 && a[2] ==... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define REP(i, k, n) for (int i = k; i < n; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
vector<int> a(3);
while (true) {
cin >> a[0] >> a[1] >> a[2];
if (a[0] == 0 && a[1] == 0 && a[2] ==... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 193 | 2 |
#include <math.h>
#include <stdio.h>
int main() {
int x, y, z, N, r;
int n[1001] = {};
while (1) {
scanf("%d %d %d", &n[0], &n[1], &n[2]);
if (n[0] == 0 && n[1] == 0 && n[2] == 0)
break;
for (int i = 0; i < 3; i++)
for (int j = 2; j > i; j--)
if (n[j - 1] > n[j]) {
int ... | #include <math.h>
#include <stdio.h>
int main() {
int x, y, z, N, r;
int n[1001] = {};
while (1) {
scanf("%d %d %d", &n[0], &n[1], &n[2]);
if (n[0] == 0 && n[1] == 0 && n[2] == 0)
break;
for (int i = 0; i < 3; i++)
for (int j = 2; j > i; j--)
if (n[j - 1] > n[j]) {
int ... | [["-", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25], ["-", 15, 339, 51, 16, 12, 74, 51, 23, 0, 24]] | 1 | 266 | 3 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <string>
#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 rp(a) while (a--)
#define pb push_back
#define mp make_pair
#define i... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <string>
#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 rp(a) while (a--)
#define pb push_back
#define mp make_pair
#define i... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 198 | 2 |
#include <cmath>
#include <iostream>
using namespace std;
double h[10000];
int main() {
int x;
int y;
int z;
int n;
double xy;
double yz;
double zx;
while (true) {
cin >> x >> y >> z;
if (!x && !y && !z) {
break;
}
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> h[i];
... | #include <cmath>
#include <iostream>
using namespace std;
double h[10000];
int main() {
int x;
int y;
int z;
int n;
double xy;
double yz;
double zx;
while (true) {
cin >> x >> y >> z;
if (!x && !y && !z) {
break;
}
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> h[i];
... | [["-", 15, 339, 51, 16, 31, 16, 31, 16, 17, 19], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 18], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 19], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18]] | 1 | 220 | 6 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
int tate, yoko, takasa, mn, md;
int n;
while (cin >> tate >> yoko >> takasa, tate || yoko || takasa) {
cin >> n;
int *r = new ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
int tate, yoko, takasa, mn, md;
int n;
while (cin >> tate >> yoko >> takasa, tate || yoko || takasa) {
cin >> n;
int *r = new ... | [["+", 0, 52, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 52, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 254 | 2 |
#include <cstdio>
#include <iostream>
using namespace std;
int mini_1(int i, int j, int k) {
if (i <= j && i <= k) {
return i;
} else if (j <= i && j <= k) {
return j;
} else {
return k;
}
}
int mini_2(int i, int j, int k) {
if (i <= j && j <= k) {
return j;
} else if (k <= j && j <= i) {... | #include <cstdio>
#include <iostream>
using namespace std;
int mini_1(int i, int j, int k) {
if (i <= j && i <= k) {
return i;
} else if (j <= i && j <= k) {
return j;
} else {
return k;
}
}
int mini_2(int i, int j, int k) {
if (i <= j && j <= k) {
return j;
} else if (k <= j && j <= i) {... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 281 | 2 |
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | [["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13]] | 1 | 494 | 2 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
vector<int> side(3); // ???, ?¨?, ??????
int n; // ??\??£????????°
int rad; // ??\??£?????????
int diagonal; // ??... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
vector<int> side(3); // ???, ?¨?, ??????
int n; // ??\??£????????°
int rad; // ??\??£?????????
int diagonal; // ??... | [["-", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6]] | 1 | 196 | 2 |
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int m[3];
int n;
while (cin >> m[0] >> m[1] >> m[2], m[0] || m[1] || m[2]) {
sort(m, m + 3);
int S = m[0] * m[0] + m[1] * m[1];
int n, num;
cin >> n;
while (n--) {
cin >> num;
double size ... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int m[3];
int n;
while (cin >> m[0] >> m[1] >> m[2], m[0] || m[1] || m[2]) {
sort(m, m + 3);
int S = m[0] * m[0] + m[1] * m[1];
int n, num;
cin >> n;
while (n--) {
cin >> num;
int size = n... | [["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 145 | 4 |
#include <math.h>
#include <stdio.h>
#include <string.h>
int main(void) {
long long int a, s, d, f, g[100000], h, i, j, z, x, c, q[4];
while (1) {
scanf("%lld %lld %lld", &a, &s, &d);
if (a == 0 && s == 0 && d == 0)
break;
scanf("%lld", &f);
for (i = 0; i < f; i++)
scanf("%lld", &g[i]);
... | #include <math.h>
#include <stdio.h>
#include <string.h>
int main(void) {
long long int a, s, d, f, g[100000], h, i, j, z, x, c, q[4];
while (1) {
scanf("%lld %lld %lld", &a, &s, &d);
if (a == 0 && s == 0 && d == 0)
break;
scanf("%lld", &f);
for (i = 0; i < f; i++)
scanf("%lld", &g[i]);
... | [["-", 51, 16, 12, 16, 12, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 12, 69, 341, 342, 0, 13]] | 1 | 237 | 2 |
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecis... | // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecis... | [["-", 3, 4, 0, 83, 0, 16, 12, 16, 31, 22], ["+", 3, 4, 0, 83, 0, 16, 12, 16, 31, 22], ["-", 3, 4, 0, 83, 0, 16, 12, 16, 12, 22], ["+", 3, 4, 0, 83, 0, 16, 12, 16, 12, 22]] | 1 | 429 | 4 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a[3];
while (cin >> a[0] >> a[1] >> a[2]) {
if (a[0] == 0 && a[1] == 0 && a[3] == 0)
break;
sort(a, a + 3);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int r;
cin >> r;
if ((a[0] * a[0] + a... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a[3];
while (cin >> a[0] >> a[1] >> a[2]) {
if (a[0] == 0 && a[1] == 0 && a[2] == 0)
break;
sort(a, a + 3);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int r;
cin >> r;
if ((a[0] * a[0] + a... | [["-", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13]] | 1 | 155 | 2 |
// 2011/01/14 Tazoe
#include <iostream>
using namespace std;
void ABC_sort(int &A, int &B, int &C) {
int tmp[3] = {A, B, C};
for (int i = 0; i < 2; i++)
for (int j = i + 1; j < 3; j++)
if (tmp[i] > tmp[j]) {
int swp = tmp[i];
tmp[i] = tmp[j];
tmp[j] = swp;
}
A = tmp[0];... | // 2011/01/14 Tazoe
#include <iostream>
using namespace std;
void ABC_sort(int &A, int &B, int &C) {
int tmp[3] = {A, B, C};
for (int i = 0; i < 2; i++)
for (int j = i + 1; j < 3; j++)
if (tmp[i] > tmp[j]) {
int swp = tmp[i];
tmp[i] = tmp[j];
tmp[j] = swp;
}
A = tmp[0];... | [["-", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 16, 12, 16, 12, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 22]] | 1 | 251 | 4 |
#include <algorithm>
#include <math.h>
#include <stdio.h>
//#define M(a,b) a<b?a:b
int main() {
int a, b, c, n, r;
for (; scanf("%d%d%d", &a, &b, &c), a | b | c;) {
for (scanf("%d", &n); n--;) {
scanf("%d", &r);
puts((2. * r <=
std::min(std::min(sqrt(a * a + b * b), sqrt(b * b + c * c)),... | #include <algorithm>
#include <math.h>
#include <stdio.h>
//#define M(a,b) a<b?a:b
int main() {
int a, b, c, n, r;
for (; scanf("%d%d%d", &a, &b, &c), a | b | c;) {
for (scanf("%d", &n); n--;) {
scanf("%d", &r);
puts((2 * r > std::min(std::min(sqrt(a * a + b * b), sqrt(b * b + c * c)),
... | [["-", 0, 41, 15, 23, 0, 16, 31, 16, 31, 13], ["+", 0, 41, 15, 23, 0, 16, 31, 16, 31, 13], ["-", 3, 4, 0, 41, 15, 23, 0, 16, 17, 19], ["+", 3, 4, 0, 41, 15, 23, 0, 16, 17, 47]] | 1 | 140 | 4 |
#include <math.h>
#include <stdio.h>
#define M(a, b) a < b ? a : b
int main() {
for (int a, b, c, n, r; scanf("%d%d%d", &a, &b, &c), a | b | c;) {
for (scanf("%d", &n); n--;) {
scanf("%d", &r);
puts((2 * r >
M(M(sqrt(a * a + b * b), sqrt(b * b + c * c)), sqrt(c * c + a * a)))
... | #include <math.h>
#include <stdio.h>
#define M(a, b) (a < b ? a : b)
int main() {
for (int a, b, c, n, r; scanf("%d%d%d", &a, &b, &c), a | b | c;) {
for (scanf("%d", &n); n--;) {
scanf("%d", &r);
puts((2 * r >
M(M(sqrt(a * a + b * b), sqrt(b * b + c * c)), sqrt(c * c + a * a)))
... | [["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]] | 1 | 140 | 2 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define REP(i, a, n) for (int i = a; i < n; i++)
#define rep(i, n) REP(i, 0, n)
typedef long long ll;
void solve() {}
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define REP(i, a, n) for (int i = a; i < n; i++)
#define rep(i, n) REP(i, 0, n)
typedef long long ll;
void solve() {}
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 170 | 2 |
#include <cmath>
#include <iostream>
using namespace std;
int main() {
double x, y, z;
while (cin >> x >> y >> z) {
double r =
min(sqrt(x * x + y * y), min(sqrt(y * y + z * z), sqrt(z * z + y * y)));
if (!r)
break;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
double R;
... | #include <cmath>
#include <iostream>
using namespace std;
int main() {
double x, y, z;
while (cin >> x >> y >> z) {
double r =
min(sqrt(x * x + y * y), min(sqrt(y * y + z * z), sqrt(z * z + y * y)));
if (!r)
break;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
double R;
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 142 | 2 |
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int c[3];
while (cin >> c[0] >> c[1] >> c[2]) {
if (!c[0] && !c[1] && !c[2]) {
break;
}
sort(c, c + 2);
double R = sqrt(pow((double)c[0], 2) + pow((double)c[1], 2));
int n;
cin >> n;
wh... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int c[3];
while (cin >> c[0] >> c[1] >> c[2]) {
if (!c[0] && !c[1] && !c[2]) {
break;
}
sort(c, c + 3);
double R = sqrt(pow((double)c[0], 2) + pow((double)c[1], 2));
int n;
cin >> n;
wh... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 154 | 2 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
int n;
while (1) {
// a,b,cの入力
/* char line[100];
fgets(line,sizeof(line),stdin);
sscanf(line,"%d %d %d",&a,&b,&c);
*/
scanf("%d %d %d", &a, &b... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
int n;
while (1) {
// a,b,cの入力
/* char line[100];
fgets(line,sizeof(line),stdin);
sscanf(line,"%d %d %d",&a,&b,&c);
*/
scanf("%d %d %d", &a, &b... | [["-", 0, 52, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 8, 9,... | 1 | 233 | 10 |
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <m... | #define _USE_MATH_DEFINES
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <m... | [["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, ... | 1 | 230 | 12 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int edge[3];
while (cin >> edge[0] >> edge[1] >> edge[2], edge[0] || edge[1] || edge[2]) {
int n;
cin >> n;
sort(edge, edge + 2);
while (n--) {
int x;
cin >> x;
if (edge[0] * edge[0] + edge[1] * edge[1] < x ... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int edge[3];
while (cin >> edge[0] >> edge[1] >> edge[2], edge[0] || edge[1] || edge[2]) {
int n;
cin >> n;
sort(edge, edge + 3);
while (n--) {
int x;
cin >> x;
if (edge[0] * edge[0] + edge[1] * edge[1] < x ... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 138 | 2 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
int p, a, b, c, i, n, x;
while (1) {
scanf("%d %d %d", &a, &b, &c);
if (a == 0)
return 0;
if (a < c) {
p = a;
a = c;
c = a;
}
if (a < b) {
p = a;
a = b;
b = a;
}
double r = sqr... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
int p, a, b, c, i, n, x;
while (1) {
scanf("%d %d %d", &a, &b, &c);
if (a == 0)
return 0;
if (a < c) {
p = a;
a = c;
c = a;
}
if (a < b) {
p = a;
a = b;
b = a;
}
double r = sqr... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 175 | 2 |
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
int a, b, c;
while (cin >> a >> b >> c, a + b + c) {
if (a > b) {
swap(a, b);
}
if (b > c) {
swap(b, c);
}
int n;
cin >> n;
int siz... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
int a, b, c;
while (cin >> a >> b >> c, a + b + c) {
if (a > b) {
swap(a, b);
}
if (b > c) {
swap(b, c);
}
int n;
cin >> n;
int siz... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 143 | 2 |
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
double m[3];
void solve() {}
int main() {
while (cin >> m[0] >> m[1] >> m[2], m[0] || m[1] || m[2]) {
sort(m, m + 2);
double d = sqrt(m[0] * m[0] + m[1] * m[1]);
int n;
cin >> n;
while (n--) {
double r;
cin... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
double m[3];
void solve() {}
int main() {
while (cin >> m[0] >> m[1] >> m[2], m[0] || m[1] || m[2]) {
sort(m, m + 3);
double d = sqrt(m[0] * m[0] + m[1] * m[1]);
int n;
cin >> n;
while (n--) {
double r;
cin... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 145 | 2 |
#include <stdio.h>
int main() {
int a, b, c, p, i;
while (scanf("%d %d %d", &a, &b, &c), a | b | c) {
int m;
if (a >= b && a >= c)
m = b * b + c * c;
if (b >= a && b >= c)
m = a * a + c * c;
if (c >= a && c >= b)
m = a * a + b * b;
scanf("%d", &p);
for (i = 0; i < p; i++) ... | #include <stdio.h>
int main() {
int a, b, c, p, i;
while (scanf("%d %d %d", &a, &b, &c), a | b | c) {
int m;
if (a >= b && a >= c)
m = b * b + c * c;
if (b >= a && b >= c)
m = a * a + c * c;
if (c >= a && c >= b)
m = a * a + b * b;
scanf("%d", &p);
for (i = 0; i < p; i++) ... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 171 | 2 |
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main(void) {
int size[3];
while (cin >> size[0] >> size[1] >> size[2]) {
if (size[0] == 0 && size[1] == 0 && size[2] == 0) {
break;
}
std::sort(size, size + 3);
// 直方体の最小面の対角線
double diagonal = sqrt(pow(... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main(void) {
int size[3];
while (cin >> size[0] >> size[1] >> size[2]) {
if (size[0] == 0 && size[1] == 0 && size[2] == 0) {
break;
}
std::sort(size, size + 3);
// 直方体の最小面の対角線
double diagonal = sqrt(pow(... | [["-", 31, 16, 12, 23, 0, 41, 15, 16, 17, 20], ["+", 31, 16, 12, 23, 0, 41, 15, 16, 17, 47]] | 1 | 158 | 2 |
#include <cmath>
#include <cstdio>
using namespace std;
int main() {
int x, y, z, n, r, a, b, c;
while (1) {
scanf("%d %d %d", &x, &y, &z);
if (!x && !y && !z)
break;
scanf("%d", &n);
if (x > y && x > z) {
a = y;
b = z;
} else if (y > z) {
a = z;
b = x;
} else... | #include <cmath>
#include <cstdio>
using namespace std;
int main() {
int x, y, z, n, r, a, b, c;
while (1) {
scanf("%d %d %d", &x, &y, &z);
if (!x && !y && !z)
break;
scanf("%d", &n);
if (x > y && x > z) {
a = y;
b = z;
} else if (y > z) {
a = z;
b = x;
} else... | [["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 200 | 4 |
#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
template <class T> inline T sqr(T x) { return x * x; }
typedef vector<int> V... | #include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
template <class T> inline T sqr(T x) { return x * x; }
typedef vector<int> V... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40]] | 1 | 379 | 4 |
include Math
while gets
l, w, h = $_.chomp.split.map(&:to_i)
break if [l,w,h].all?(&:zero?)
cheese_size = [l,w,h].combination(2).map{ |x,y| sqrt(x**2 + y**2) }.min
p cheese_size
n = gets.to_i
cheese_ok = Array.new(n,0)
n.times do |i|
r = gets.to_i
entrance_limit = 2*r
cheese_ok[i] = (cheese_size < entranc... | include Math
while gets
l, w, h = $_.chomp.split.map(&:to_i)
break if [l,w,h].all?(&:zero?)
cheese_size = [l,w,h].combination(2).map{ |x,y| sqrt(x**2 + y**2) }.min
n = gets.to_i
cheese_ok = Array.new(n,0)
n.times do |i|
r = gets.to_i
entrance_limit = 2*r
cheese_ok[i] = (cheese_size < entrance_limit ? "OK" ... | [["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["-", 0, 89, 8, 170, 0, 652, 3, 4, 0, 22]] | 4 | 127 | 2 |
while True:
solid = sorted(map(int, input().split()))
print(solid)
if solid.count(0) == 3: break
n = eval(input())
s = (solid[0]**2+solid[1]**2)/4
for i in range(n):
r = eval(input())
if r*r > s:
print('OK')
else:
print('NA')
| while True:
solid = sorted(map(int, input().split()))
if solid.count(0) == 3: break
n = eval(input())
s = (solid[0]**2+solid[1]**2)/4
for i in range(n):
r = eval(input())
if r*r > s:
print('OK')
else:
print('NA') | [["-", 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 | 99 | 4 |
while True:
d, w, h = [int(x) for x in input().split()]
minrad = min(d*d+w*w,w*w+h*h,h*h+d*d)
if minrad == 0:
break
n = int(input())
for i in range(n):
r = int(input())
if 2*r*r > minrad:
print('OK')
else:
print('NA') | while True:
d, w, h = [int(x) for x in input().split()]
minrad = min(d*d+w*w,w*w+h*h,h*h+d*d)
if minrad == 0:
break
n = int(input())
for i in range(n):
r = int(input())
if 4*r*r > minrad:
print('OK')
else:
print('NA') | [["-", 0, 57, 15, 666, 0, 657, 31, 657, 31, 612], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 31, 612]] | 5 | 106 | 2 |
import math
while True:
d,w,h = map(int,input().split())
if d == 0:
break
n = int(input())
dist = [math.sqrt(d**2+w**2), math.sqrt(d**2+h**2), math.sqrt(w**2+h**2)]
leng = min(dist)
for i in range(n):
if int(input())-leng > 0:
print('OK')
else:
print('NA') | import math
while True:
d,w,h = map(int,input().split())
if d == 0:
break
n = int(input())
dist = [math.sqrt(d**2+w**2), math.sqrt(d**2+h**2), math.sqrt(w**2+h**2)]
leng = min(dist)
for i in range(n):
if 2*int(input())-leng > 0:
print('OK')
else:
print('NA') | [["+", 0, 57, 15, 666, 0, 657, 31, 657, 31, 612], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 17, 48]] | 5 | 119 | 2 |
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
while (1) {
int n, count = 0;
long before[13], after[13], c[13];
scanf(" %d", &n);
if (n == 0)
break;
for (int i = 0; i < n; ++i)
scanf(" %ld", &before[i]);
// loop
while (1) {
for (int i = 0; i <... | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
while (1) {
int n, count = 0;
long before[13], after[13], c[13];
scanf(" %d", &n);
if (n == 0)
break;
for (int i = 0; i < n; ++i)
scanf(" %ld", &before[i]);
// loop
while (1) {
for (int i = 0; i <... | [["-", 0, 52, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 328 | 2 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#define rep(i, l, n) for (lint i = l; i < n; i++)
#define rer(i, l, n) for (lint i = l; i <= n; i++)
#define all(a) a.begin(), a.end()
#define o(a) cout << a <... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#define rep(i, l, n) for (lint i = l; i < n; i++)
#define rer(i, l, n) for (lint i = l; i <= n; i++)
#define all(a) a.begin(), a.end()
#define o(a) cout << a <... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13]] | 1 | 366 | 5 |
#include <iostream>
using namespace std;
bool OperationFA(int *an, int n) {
bool ret = true;
int *cn = new int[n];
for (int i = 0; i < n; i++) {
int mode = 0;
for (int j = 0; j < n; j++) {
if (an[j] == an[i])
mode++;
}
cn[i] = mode;
}
for (int i = 0; i < n; i++) {
if (an[i] ... | #include <iostream>
using namespace std;
bool OperationFA(int *an, int n) {
bool ret = true;
int *cn = new int[n];
for (int i = 0; i < n; i++) {
int mode = 0;
for (int j = 0; j < n; j++) {
if (an[j] == an[i])
mode++;
}
cn[i] = mode;
}
for (int i = 0; i < n; i++) {
if (an[i] ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 286 | 2 |
#include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
if (!n)
break;
int a[n], b[n];
int count = 0;
for (int i = 0; i < n; i++)
cin >> a[i];
while (true) {
for (int i = 0; i < n; i++) {
int c = 0;
for (int j = 0; j < n; j++)
... | #include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
if (!n)
break;
int a[n], b[n];
int count = 0;
for (int i = 0; i < n; i++)
cin >> a[i];
while (true) {
for (int i = 0; i < n; i++) {
int c = 0;
for (int j = 0; j < n; j++)
... | [["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 233 | 2 |
#include <algorithm>
#include <iostream>
using namespace std;
bool check(int a[12], int b[12], int n) {
bool f = true;
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
f = false;
break;
}
}
return f;
}
int main() {
int n;
while (cin >> n && n) {
int a[12], b[13], c[12], t = 0,... | #include <algorithm>
#include <iostream>
using namespace std;
bool check(int a[12], int b[12], int n) {
bool f = true;
for (int i = 0; i < n; i++) {
if (a[i] != b[i]) {
f = false;
break;
}
}
return f;
}
int main() {
int n;
while (cin >> n && n) {
int a[12], b[10000], c[12], t =... | [["-", 0, 52, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 332 | 4 |
#include <iostream>
using namespace std;
int main() {
int n, s[12], o[12];
while (cin >> n) {
if (!n)
break;
int step = 0;
for (int i = 0; i < n; ++i)
cin >> s[i];
for (int f = 1; f; ++step) {
for (int i = 0; i < n; ++i)
o[i] = s[i];
for (int i = 0, count = 0; i < n; ... | #include <iostream>
using namespace std;
int main() {
int n, s[12], o[12];
while (cin >> n) {
if (!n)
break;
int step = -1;
for (int i = 0; i < n; ++i)
cin >> s[i];
for (int f = 1; f; ++step) {
for (int i = 0; i < n; ++i)
o[i] = s[i];
for (int i = 0, count = 0; i < n;... | [["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 250 | 2 |
def operation_of_foa(input_seq, times)
operated_seq = Array.new
count_seq = Hash.new
input_seq.each do |n|
if count_seq.has_key?(n)
count_seq[n] += 1
else
count_seq[n] = 1
end
end
input_seq.each do |n|
operated_seq << count_seq[n]
end
if operated_seq == input_seq
return [operated_seq, times]
els... | def operation_of_foa(input_seq, times)
operated_seq = Array.new
count_seq = Hash.new
input_seq.each do |n|
if count_seq.has_key?(n)
count_seq[n] += 1
else
count_seq[n] = 1
end
end
input_seq.each do |n|
operated_seq << count_seq[n]
end
if operated_seq == input_seq
return [operated_seq, times-1]
e... | [["+", 0, 38, 0, 4, 0, 516, 0, 738, 17, 33], ["+", 0, 38, 0, 4, 0, 516, 0, 738, 12, 612]] | 4 | 158 | 2 |
import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
enum ope {
add,
sub,
mul,
div;
}
LinkedList<String> tokenize(String str) {
String token = "";
LinkedList<String> ret = new LinkedList<String>();
String sp = "+... | import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
enum ope {
add,
sub,
mul,
div;
}
LinkedList<String> tokenize(String str) {
String token = "";
LinkedList<String> ret = new LinkedList<String>();
String sp = "+... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]] | 3 | 1,125 | 2 |
#include <stdio.h>
char s[110];
int p = 0;
double f(double a, int b, double c) {
if (b == 2)
return a + c;
if (b == 3)
return a - c;
if (b == 4)
return a * c;
return a / c;
}
int kobun() {
int i, r = 0, o[3], or [] = {0, 0, 1, 1, 2, 2};
int n[3], a;
char c[] = {")=+-*/"};
while (1) {
for... | #include <stdio.h>
char s[110];
int p = 0;
double f(double a, int b, double c) {
if (b == 2)
return a + c;
if (b == 3)
return a - c;
if (b == 4)
return a * c;
return a / c;
}
int kobun() {
int i, r = 0, o[3], or [] = {0, 0, 1, 1, 2, 2};
int n[3], a;
char c[] = {")=+-*/"};
while (1) {
for... | [["+", 0, 7, 15, 16, 12, 16, 31, 69, 28, 22], ["+", 0, 7, 15, 16, 12, 16, 31, 69, 0, 70], ["+", 15, 16, 12, 16, 31, 69, 71, 69, 0, 73], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 0, 70], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 0, 73]] | 0 | 344 | 6 |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CALC \
{ \
if (sign == 0) \
term = term... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CALC \
{ \
if (sign == 0) \
term = term... | [["-", 0, 99, 8, 9, 0, 100, 0, 93, 0, 94], ["-", 0, 99, 8, 9, 0, 100, 0, 93, 0, 35]] | 0 | 266 | 2 |
#include <ctype.h>
#include <stdio.h>
#include <strings.h>
char str[101];
int tindex = 0;
int map[255];
int token;
int addminus();
void getToken(void) {
int r = 0;
if (isdigit(str[tindex])) {
while (isdigit(str[tindex])) {
r = r * 10 + (str[tindex++] - '0');
}
token = r;
} else {
token = ... | #include <ctype.h>
#include <stdio.h>
#include <strings.h>
char str[101];
int tindex = 0;
int map[255];
int token;
int addminus();
void getToken(void) {
int r = 0;
if (isdigit(str[tindex])) {
while (isdigit(str[tindex])) {
r = r * 10 + (str[tindex++] - '0');
}
token = r;
} else {
token = ... | [["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]] | 0 | 411 | 4 |
#include <stdio.h>
#include <string.h>
#define def_func(name) int name(int f, int l)
#define gen_func(name, next, aop1, op1, aop2, op2) \
def_func(name) { \
int i; ... | #include <stdio.h>
#include <string.h>
#define def_func(name) int name(int f, int l)
#define gen_func(name, next, aop1, op1, aop2, op2) \
def_func(name) { \
int i; ... | [["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]] | 0 | 273 | 2 |
#include <cctype>
#include <iostream>
#include <string>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef string::const_iterator State;
int ctoi(const char &c) { return c - '0'; }
int expression(State &);
int term(State &);
int factor(State &);
int number(State &);
int expression(State &it... | #include <cctype>
#include <iostream>
#include <string>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef string::const_iterator State;
int ctoi(const char &c) { return c - '0'; }
int expression(State &);
int term(State &);
int factor(State &);
int number(State &);
int expression(State &it... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 379 | 2 |
#include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 535 | 2 |
// 構文解析の練習
// https://gist.github.com/draftcode/1357281
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef string::const_iterator State;
class ParseError {};
int number(State &);
int term(State &);
int expression(State &);
int factor(Stat... | // 構文解析の練習
// https://gist.github.com/draftcode/1357281
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef string::const_iterator State;
class ParseError {};
int number(State &);
int term(State &);
int expression(State &);
int factor(Stat... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 366 | 2 |
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
typedef string::const_iterator State;
class ParseError {};
/*
<??????????????????> ::= <??????????????????> (+ or -) <??????????????????>
(+ or -) ...
<??????????????????> ::= <??°> (* or /) <??°> (* or /) ...
<??°> ::= ... | #include <cctype>
#include <iostream>
#include <string>
using namespace std;
typedef string::const_iterator State;
class ParseError {};
/*
<??????????????????> ::= <??????????????????> (+ or -) <??????????????????>
(+ or -) ...
<??????????????????> ::= <??°> (* or /) <??°> (* or /) ...
<??°> ::= ... | [["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35], ["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 362 | 5 |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <time.h>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FFOR(i, a, b) for (int i = (a); i <= (b); i+... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <time.h>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FFOR(i, a, b) for (int i = (a); i <= (b); i+... | [["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35]] | 1 | 469 | 3 |
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
typedef string::const_iterator State;
class ParseError {};
int expression(State &);
int term(State &);
int number(State &);
int factor(State &);
int main(void) {
int N;
cin >> N;
cin.ignore();
for (int i = 0; i < N; i++) {
strin... | #include <cctype>
#include <iostream>
#include <string>
using namespace std;
typedef string::const_iterator State;
class ParseError {};
int expression(State &);
int term(State &);
int number(State &);
int factor(State &);
int main(void) {
int N;
cin >> N;
cin.ignore();
for (int i = 0; i < N; i++) {
strin... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 358 | 2 |
#include "bits/stdc++.h"
#include <unordered_map>
#pragma warning(disable : 4996)
using namespace std;
string st;
int a;
int plmi();
int num() {
int n = 0;
while (1) {
if (isdigit(st[a])) {
n *= 10;
n += st[a] - '0';
a++;
} else {
return n;
}
}
}
int siki() {
int n;
if ... | #include "bits/stdc++.h"
#include <unordered_map>
#pragma warning(disable : 4996)
using namespace std;
string st;
int a;
int plmi();
int num() {
int n = 0;
while (1) {
if (isdigit(st[a])) {
n *= 10;
n += st[a] - '0';
a++;
} else {
return n;
}
}
}
int siki() {
int n;
if ... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 319 | 2 |
#include <cctype>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int exp(string &s, int &i);
int term(string &s, int &i);
int factor(string &s, int &i);
int number(string &s, int &i);
int exp(string &s, int &i) {
int val = term(s, i);
while (s[i] == '+' || s[i] == '-') {
char op ... | #include <cctype>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int exp(string &s, int &i);
int term(string &s, int &i);
int factor(string &s, int &i);
int number(string &s, int &i);
int exp(string &s, int &i) {
int val = term(s, i);
while (s[i] == '+' || s[i] == '-') {
char op ... | [["-", 8, 9, 0, 43, 49, 50, 51, 11, 17, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33]] | 1 | 397 | 2 |
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int n;
string S;
int cur;
int digit() {
... |
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int n;
string S;
int cur;
int digit() {
... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 390 | 4 |
def get_input():
while True:
try:
yield ''.join(input())
except EOFError:
break
dict = {"A":"00000",\
"B":"00001",\
"C":"00010",\
"D":"00011",\
"E":"00100",\
"F":"00101",\
"G":"00110", \
"H":"00111", \
"I":"0100... | def get_input():
while True:
try:
yield ''.join(input())
except EOFError:
break
dict = {"A":"00000",\
"B":"00001",\
"C":"00010",\
"D":"00011",\
"E":"00100",\
"F":"00101",\
"G":"00110", \
"H":"00111", \
"I":"0100... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 723 | 2 |
#include <stdio.h>
int main(void) {
int n;
int customer[10000];
int i;
int flag;
int buf;
int time[10000];
int total;
while (1) {
scanf("%d", &n);
if (n == 0) {
break;
}
for (i = 0; i < n; i++) {
scanf("%d", &customer[i]);
}
/*昇順にソート*/
flag == 1;
while (fl... | #include <stdio.h>
int main(void) {
int n;
int customer[10000];
int i;
int flag;
int buf;
int time[10000];
long long total;
while (1) {
scanf("%d", &n);
if (n == 0) {
break;
}
for (i = 0; i < n; i++) {
scanf("%d", &customer[i]);
}
/*昇順にソート*/
flag = 1;
whil... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 60], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 263 | 7 |
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
int n;
while (scanf("%d", &n) * n != 0) {
int waitt[10000] = {0};
int i, j;
long sum = 0;
for (i = 0; i < n; i++)
scanf("%d", waitt + i);
sort(waitt, waitt + n);
for (i = 0; i < n; i++) {
for (j = 0; j <... | #include <algorithm>
#include <cstdio>
using namespace std;
int main() {
int n;
while (scanf("%d", &n) * n != 0) {
int waitt[10000] = {0};
int i, j;
long sum = 0;
for (i = 0; i < n; i++)
scanf("%d", waitt + i);
sort(waitt, waitt + n);
for (i = 0; i < n - 1; i++) {
for (j = 0;... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 138 | 2 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n;
int emp[10000];
long long time;
while (1) {
cin >> n;
if (n == 0)
break;
for (int i = 0; i < n; i++) {
cin >> emp[i];
}
sort(emp, emp + n - 1);
time = 0;
for (int i = 0; i < n; i++)... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n;
int emp[10000];
long long time;
while (1) {
cin >> n;
if (n == 0)
break;
for (int i = 0; i < n; i++) {
cin >> emp[i];
}
sort(emp, emp + n);
time = 0;
for (int i = 0; i < n; i++) {
... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 120 | 2 |
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
while (cin >> n, n) {
vector<int> ts;
for (int i = 0; i < n; i++) {
cin >> ts[i];
}
sort(ts.begin(), ts.end());
long long sum = 0, ans = 0;
for (int i = 0; i < n; i++) {
ans += sum... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
while (cin >> n, n) {
vector<int> ts(n);
for (int i = 0; i < n; i++) {
cin >> ts[i];
}
sort(ts.begin(), ts.end());
long long sum = 0, ans = 0;
for (int i = 0; i < n; i++) {
ans += ... | [["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 24], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 25]] | 1 | 116 | 3 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <list>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) range(i, 0, b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;
int main()... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <list>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) range(i, 0, b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;
int main() ... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 160 | 2 |
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, time[1000];
long long ans;
while (cin >> n) {
if (n == 0)
break;
int wait = 0;
for (int i = 0; i < n; i++)
cin >> time[i];
sort(time, time + n);
for (int i = 0; i < n; i++) {
... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, time[10000];
long long ans = 0;
while (cin >> n) {
if (n == 0)
break;
int wait = 0;
for (int i = 0; i < n; i++)
cin >> time[i];
sort(time, time + n);
for (int i = 0; i < n; i++) {
... | [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 119 | 4 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int P, Q;
while (cin >> P >> Q) {
map<int, int> latte;
int m = 0, l = 0, r = 0;
vector<int> ans;
latte[P % Q] = 0;
m = P % Q;
while (m) {
int nm = m * 10 % Q;
ans.push_back(m * 10 / Q);
if (latte.find(nm) != latte.... | #include <bits/stdc++.h>
using namespace std;
int main() {
int P, Q;
while (cin >> P >> Q) {
map<int, int> latte;
int m = 0, l = 0, r = 0;
vector<int> ans;
latte[P % Q] = 0;
m = P % Q;
while (m) {
int nm = m * 10 % Q;
ans.push_back(m * 10 / Q);
if (latte.find(nm) != latte.... | [["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 240 | 2 |
#include <algorithm>
#include <iostream>
#include <vector>
typedef std::pair<int, int> P;
int main() {
int a = 0, b = 0;
while (std::cin >> a >> b, !std::cin.eof()) {
std::vector<P> v;
while (1) {
a *= 10;
if (std::find(v.begin(), v.end(), P(a % b, a / b)) != v.end())
break;
v.p... | #include <algorithm>
#include <iostream>
#include <vector>
typedef std::pair<int, int> P;
int main() {
int a = 0, b = 0;
while (std::cin >> a >> b, !std::cin.eof()) {
std::vector<P> v;
while (a % b) {
a *= 10;
if (std::find(v.begin(), v.end(), P(a % b, a / b)) != v.end())
break;
... | [["-", 0, 52, 8, 9, 0, 52, 15, 339, 51, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 109], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22]] | 1 | 266 | 4 |
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(n) rep(i, n)
#define all(n) n.begin(), n.end()
const int MAX = 85;
int main() {
int p, q;
while (cin >> p >> q) {
int quot... | #include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(n) rep(i, n)
#define all(n) n.begin(), n.end()
const int MAX = 185;
int main() {
int p, q;
while (cin >> p >> q) {
int quo... | [["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 274 | 4 |
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <sstream>
#include <stack>
#include <stdio.h>
using namespace std;
int main() {
int p, q;
while (cin >> p >> q) {
bool amari[1000000] = {0};
string s;
bool flag ... | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <sstream>
#include <stack>
#include <stdio.h>
using namespace std;
int main() {
int p, q;
while (cin >> p >> q) {
bool amari[1000000] = {0};
string s;
bool flag ... | [["+", 8, 9, 0, 52, 8, 9, 0, 57, 0, 121], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 201 | 6 |
while True:
n = int(input())
if n==0:break
wt = [int(input()) for _ in range(n)]
total = wt[0]
s = []
for v in sorted(wt[1:]):
s.append(total)
total += v
print(sum(s)) | while True:
n = int(input())
if n==0:break
wt = sorted([int(input()) for _ in range(n)])
total = wt[0]
s = []
for v in wt[1:]:
s.append(total)
total += v
print(sum(s)) | [["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 0, 52, 8, 196, 0, 7, 12, 652, 63, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 25]] | 5 | 72 | 6 |
import java.util.HashMap;
import java.util.Scanner;
public class Main {
private Scanner sc;
public static void main(String[] args) { new Main(); }
public Main() {
sc = new Scanner(System.in);
while (sc.hasNextLine() == true) {
String line = sc.nextLine();
String[] nico = line.split(" ");
... | import java.util.HashMap;
import java.util.Scanner;
public class Main {
private Scanner sc;
public static void main(String[] args) { new Main(); }
public Main() {
sc = new Scanner(System.in);
while (sc.hasNextLine() == true) {
String line = sc.nextLine();
String[] nico = line.split(" ");
... | [["-", 0, 52, 15, 15, 0, 16, 31, 23, 0, 24], ["-", 15, 15, 0, 16, 31, 23, 0, 16, 17, 109], ["-", 15, 15, 0, 16, 31, 23, 0, 16, 12, 22], ["-", 0, 52, 15, 15, 0, 16, 31, 23, 0, 25]] | 3 | 300 | 4 |
#include <stdio.h>
int gcd(int a, int b) {
int c;
while ((c = a % b) != 0) {
a = b;
b = c;
}
return b;
}
int main() {
long a1, m1, a2, m2, a3, m3, count, x1, x2, x3, i, ac, bc, cc, lc;
do {
scanf("%ld %ld %ld %ld %ld %ld", &a1, &m1, &a2, &m2, &a3, &m3);
if (!a1 && !m1 && !a2 && !m2 && !a3 &... | #include <stdio.h>
int gcd(int a, int b) {
int c;
while ((c = a % b) != 0) {
a = b;
b = c;
}
return b;
}
int main() {
long a1, m1, a2, m2, a3, m3, count, x1, x2, x3, i, ac, bc, cc;
long long int lc;
do {
scanf("%ld %ld %ld %ld %ld %ld", &a1, &m1, &a2, &m2, &a3, &m3);
if (!a1 && !m1 && !a2... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 256 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.