problem_id int64 0 1.52k | problem_name stringlengths 5 112 | description stringlengths 209 6.47k | lang stringclasses 4
values | code stringlengths 7 95.5k | status stringclasses 3
values | passed int64 0 24 | total int64 0 25 | error stringclasses 567
values | failures stringlengths 2 2k | source stringclasses 5
values | difficulty stringclasses 13
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
281 | 464_D. World of Darkraft - 2 | Roma found a new character in the game "World of Darkraft - 2". In this game the character fights monsters, finds the more and more advanced stuff that lets him fight stronger monsters.
The character can equip himself with k distinct types of items. Power of each item depends on its level (positive integer number). In... | java | import java.io.BufferedWriter;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.*;
public class Main {
public static void main(String[] args) {
... | partial | 24 | 25 | [{"idx": 22, "reason": "timeout"}] | codeforces | D | |
282 | 488_C. Fight the Monster | A monster is attacking the Cyberland!
Master Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (HP), offensive power (ATK) and defensive power (DEF).
During the battle, every second the monster's HP decrease by max(0, ATKY - DEFM), while Yang's HP decreases by max(0,... | cpp | #include <bits/stdc++.h>
using namespace std;
long long hm1, hm2, am1, am2, dm1, dm2, a, h, d, jav = 1e9;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> hm1 >> am1 >> dm1;
cin >> hm2 >> am2 >> dm2;
cin >> h >> a >> d;
for (int i = hm1; i < 1000; i++)
for (int j = am1; j < 4... | partial | 22 | 25 | [{"idx": 0, "reason": "timeout"}, {"idx": 6, "reason": "timeout"}, {"idx": 16, "reason": "timeout"}] | codeforces | C | |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | cpp | #include <bits/stdc++.h>
#pragma comment(linker, "/STACK:134217728")
using namespace std;
const long long MOD = 1000000000 + 7;
const long long MAXN = 100000 + 100;
const long long MAGIC = 123123123;
const double PI = 4 * atan(1.);
const double EPS = 1E-7;
struct cmp_for_set {
bool operator()(const int& a, const int&... | partial | 7 | 25 | [{"idx": 2, "reason": "wrong_answer", "expected": "LM\nLM\nLW", "got": "LW\nMW\nMW"}, {"idx": 4, "reason": "wrong_answer", "expected": "LW\nMW\nLW\nMW\nMW\nMW\nLM\nMW\nLM\nMW\nLW\nLW\nLM\nLW\nMW\nLM", "got": "Impossible"}, {"idx": 5, "reason": "wrong_answer", "expected": "LW\nLM\nLM\nMW\nLM\nLW\nMW\nLM\nLM\nLM\nLM", "g... | codeforces | F | |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | java | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
public class D {
... | partial | 23 | 25 | [{"idx": 2, "reason": "wrong_answer", "expected": "LM\nLM\nLW", "got": "LW\nLM\nLW"}, {"idx": 24, "reason": "timeout"}] | codeforces | F | |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7, mod = 1e9 + 9, pw = 31;
const double eps = 1e-11;
map<pair<int, int>, int> m;
pair<int, int> ans = make_pair(-INF, -INF), check;
int n, d[30][5];
vector<int> res;
void out() {
for (auto i : res) {
if (i == 1) cout << "MW";
if (i == 2) cout... | partial | 22 | 25 | [{"idx": 2, "reason": "wrong_answer", "expected": "LM\nLM\nLW", "got": "LW\nMW\nMW"}, {"idx": 13, "reason": "wrong_answer", "expected": "LM", "got": "MW"}, {"idx": 24, "reason": "timeout"}] | codeforces | F | |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | cpp | #include <bits/stdc++.h>
using namespace std;
struct triple {
int a, b, c;
triple() : a(0), b(0), c(0) {}
triple(int a, int b, int c) : a(a), b(b), c(c) {}
};
namespace std {
template <>
template <typename T1, typename T2>
struct hash<pair<T1, T2> > {
inline size_t operator()(const pair<T1, T2>& p) const {
... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_pcch3nt9/tmpfi0yl85u.cpp:11:8: error: too many template-parameter-lists
11 | struct hash<pair<T1, T2> > {
| ^~~~~~~~~~~~~~~~~~~
/tmp/sbx_pcch3nt9/tmpfi0yl85u.cpp:47:71: error: use of deleted function ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key ... | [] | codeforces | F |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | python2 | import copy
def fill(k):
global di
for i in range(3):
x = [tasks[k][0], tasks[k][1], tasks[k][2]]
x[i] = 0
mi = min(x)
x[0],x[1],x[2] = x[0]-mi, x[1]-mi, x[2]-mi
for p in di[k+1]:
u,v,w = x[0]+p[0],x[1]+p[1],x[2]+p[2]
mi = min(u,v,w)
u,v,w = u-mi, v-mi, w-mi
di[k][(u,v,w)] = 1
def recurse(k):
... | partial | 21 | 25 | [{"idx": 2, "reason": "wrong_answer", "expected": "LM\nLM\nLW", "got": "LW\nMW\nMW"}, {"idx": 8, "reason": "timeout"}, {"idx": 13, "reason": "wrong_answer", "expected": "LM", "got": "MW"}, {"idx": 24, "reason": "timeout"}] | codeforces | F | |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | java | import java.util.*;
/*
25
2997942 -3148824 -1934609
-118823 4572239 -2224728
3204287 8870631 4456100
-7290680 8827243 1274574
5494361 6879584 5162114
9975076 2855554 3645316
-5887623 -8918313 -5732803
-1061533 -7605261 4966053
-245623 9920487 -7112107
-1205057 -109412 5293911
-3422579 -8712532 1284733
8253977 4785631 3... | partial | 22 | 25 | [{"idx": 2, "reason": "wrong_answer", "expected": "LM\nLM\nLW", "got": "LW\nMW\nMW"}, {"idx": 13, "reason": "wrong_answer", "expected": "LM", "got": "MW"}, {"idx": 24, "reason": "runtime_error", "rc": -24, "stderr": "", "stdout_tail": ""}] | codeforces | F | |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | java | /*
* Meet in the middle
*/
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;
public class Div2_325_F2 {
static int [] ret = new int[3];
static Comparator<Point> comp = new Comparator<Point>() {
public int compare(Point a, Point b) {
if(a.x != b.x)
... | partial | 24 | 25 | [{"idx": 24, "reason": "timeout"}] | codeforces | F | |
285 | 586_F. Lizard Era: Beginning | In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the companions to the hero is an integer. Initially, the attitude of each o... | python3 | #!/usr/bin/env python3
n = int(input())
a = [0] * n
b = [0] * n
c = [0] * n
for i in range(n):
a[i], b[i], c[i] = map(int, input().split())
middle = { }
stack = [ ]
result = (-1e10, ())
phase = 1
def search(pos, l, m, w):
global result
if (pos == n >> 1) if phase == 1 else (pos < n >> 1):
if phas... | partial | 23 | 25 | [{"idx": 2, "reason": "wrong_answer", "expected": "LM\nLM\nLW", "got": "LW\nLM\nLW"}, {"idx": 24, "reason": "timeout"}] | codeforces | F | |
289 | 724_F. Uniformly Branched Trees | A tree is a connected graph without cycles.
Two trees, consisting of n vertices each, are called isomorphic if there exists a permutation p: {1, ..., n} → {1, ..., n} such that the edge (u, v) is present in the first tree if and only if the edge (pu, pv) is present in the second tree.
Vertex of the tree is called int... | cpp | #include <bits/stdc++.h>
using namespace std;
int fac[1010], inv[1010], mod;
int ksm(int a, int b = mod - 2) {
int r = 1;
for (; b; b >>= 1) {
if (b & 1) r = 1ll * r * a % mod;
a = 1ll * a * a % mod;
}
return r;
}
int C(int a, int b) {
int r = inv[b];
for (b--; b >= 0; b--) r = 1ll * r * (a - b) % m... | partial | 22 | 25 | [{"idx": 9, "reason": "runtime_error", "rc": -24, "stderr": "", "stdout_tail": ""}, {"idx": 13, "reason": "runtime_error", "rc": -24, "stderr": "", "stdout_tail": ""}, {"idx": 19, "reason": "runtime_error", "rc": -24, "stderr": "", "stdout_tail": ""}] | codeforces | F | |
289 | 724_F. Uniformly Branched Trees | A tree is a connected graph without cycles.
Two trees, consisting of n vertices each, are called isomorphic if there exists a permutation p: {1, ..., n} → {1, ..., n} such that the edge (u, v) is present in the first tree if and only if the edge (pu, pv) is present in the second tree.
Vertex of the tree is called int... | cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000 + 3, MAX_D = 10 + 3;
int n, d, modu, dp[MAX_N][MAX_D][MAX_N];
int inv[MAX_N];
inline long long mod_pow(long long a, int b) {
long long res = 1;
while (b) {
if (b & 1) (res *= a) %= modu;
(a *= a) %= modu;
b >>= 1;
}
return res;
}
i... | partial | 22 | 25 | [{"idx": 9, "reason": "timeout"}, {"idx": 13, "reason": "runtime_error", "rc": -24, "stderr": "", "stdout_tail": ""}, {"idx": 19, "reason": "runtime_error", "rc": -24, "stderr": "", "stdout_tail": ""}] | codeforces | F | |
290 | 76_B. Mice | Modern researches has shown that a flock of hungry mice searching for a piece of cheese acts as follows: if there are several pieces of cheese then each mouse chooses the closest one. After that all mice start moving towards the chosen piece of cheese. When a mouse or several mice achieve the destination point and ther... | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int data[2][100010], t[100010], num[100010];
queue<pair<int, int> > que;
int dis(int x, int y) { return abs(data[0][x] - data[1][y]); }
int main() {
scanf("%d%d%*d%*d", &n, &m);
for (int i = 0; i < n; i++) scanf("%d", &data[0][i]);
for (int i = 0; i < m; i++... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_wn46utv6/tmp0l8cy3_q.cpp: In function ‘int dis(int, int)’:
/tmp/sbx_wn46utv6/tmp0l8cy3_q.cpp:6:36: error: reference to ‘data’ is ambiguous
6 | int dis(int x, int y) { return abs(data[0][x] - data[1][y]); }
| ^~~~
In file included from /usr/include/c++/... | [] | codeforces | B |
293 | 886_D. Restoration of string | A substring of some string is called the most frequent, if the number of its occurrences is not less than number of occurrences of any other substring.
You are given a set of strings. A string (not necessarily from this set) is called good if all elements of the set are the most frequent substrings of this string. Res... | java | import java.io.*;
import java.util.*;
public class __Solution {
static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
public static void main(String[] args) {
new __Solution().run();
}
BufferedReader in;
PrintWriter out;
StringTokenizer tok;
void init()... | all_fail | 0 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 255, "stderr": "java.io.FileNotFoundException: input.txt (No such file or directory)\n\tat java.base/java.io.FileInputStream.open0(Native Method)\n\tat java.base/java.io.FileInputStream.open(FileInputStream.java:216)\n\tat", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_... | codeforces | D | |
306 | p02574 AtCoder Beginner Contest 177 - Coprime | We have N integers. The i-th number is A_i.
\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.
\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.
Determine if \\{A_i\\} is pairwise coprime, setw... | python3 | import sys, math
N = int(input())
A = list(map(int, input().split()))
G = 0
for a in A:
G = math.gcd(G, a)
if G != 1:
print("not coprime")
exit(0)
M = 10 ** 6 + 5
B = dict()
for a in A:
if a in B:
B[a] = B[a] + 1
else:
B[a] = 1
for i in range(2, M):
cnt = 0
for j in range... | partial | 2 | 3 | [{"idx": 2, "reason": "timeout"}] | atcoder | UNKNOWN | |
306 | p02574 AtCoder Beginner Contest 177 - Coprime | We have N integers. The i-th number is A_i.
\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.
\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.
Determine if \\{A_i\\} is pairwise coprime, setw... | java | import java.io.*;
import java.util.*;
import static java.lang.System.out;
public class Main {
static MyReader in = new MyReader();
public static void main(String[] args) {
int N = in.i();
int[] A = in.ii(N);
String ans;
if (gcd(A) > 1) {
ans = "not coprime";
... | partial | 2 | 3 | [{"idx": 0, "reason": "wrong_answer", "expected": "not coprime", "got": "setwise coprime"}] | atcoder | UNKNOWN | |
307 | p02705 AtCoder Beginner Contest 163 - Circle Pond | Print the circumference of a circle of radius R.
Constraints
* 1 \leq R \leq 100
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
R
Output
Print the circumference of the circle. Your output is considered correct if and only if its absolute or relative error ... | cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int r;
cin>>r;
cout<<3.14159265*2*r<<endl;
} | partial | 1 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "458.67252742410977361942", "got": "458.673"}] | atcoder | UNKNOWN | |
307 | p02705 AtCoder Beginner Contest 163 - Circle Pond | Print the circumference of a circle of radius R.
Constraints
* 1 \leq R \leq 100
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
R
Output
Print the circumference of the circle. Your output is considered correct if and only if its absolute or relative error ... | python3 | print(int(input())*6.283) | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "458.67252742410977361942", "got": "458.65900000000005"}, {"idx": 1, "reason": "wrong_answer", "expected": "6.28318530717958623200", "got": "6.283"}] | atcoder | UNKNOWN | |
307 | p02705 AtCoder Beginner Contest 163 - Circle Pond | Print the circumference of a circle of radius R.
Constraints
* 1 \leq R \leq 100
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
R
Output
Print the circumference of the circle. Your output is considered correct if and only if its absolute or relative error ... | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin>>a;
cout<<a*2*3.141592<<endl;
} | partial | 1 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "458.67252742410977361942", "got": "458.672"}] | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | python3 | from collections import deque
h,w,k = map(int,input().split())
a = []
for i in range(h):
b = input()
tmp = []
for j in range(w):
tmp.append(b[j])
if b[j] == "S":
sx = i
sy = j
a.append(tmp)
ma = [[0]*w for i in range(h)]
def dfs(x,y,z):
if ma[x][y] == 1:
return
if z>k:
return
m... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_uxai0bc6/tmpr3bowys1.py\", line 8, in <module>\n tmp.append(b[j])\n ~^^^\nIndexError: string index out of range\n", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_error", "rc": 1, "stderr... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef pair <int, int> pii;
typedef pair <pii, int> piii;
char a[810][810];
int ans;
queue <piii> q;
int dir[4][2] = {0, 1, 1, 0, -1, 0, 0, -1};
int n, m, k;
bool IN(int x, int y){return x >= 0 && x < n && y >= 0 &... | partial | 2 | 4 | [{"idx": 2, "reason": "wrong_answer", "expected": "2", "got": "1"}, {"idx": 3, "reason": "wrong_answer", "expected": "2", "got": "1"}] | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | java | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.NoSuchElementException;
public class Main {
int H,W,K;
int[] dx = {0,0,-1,1},dy = {-1,1,0,0};
char[][] ch;
boolean[][] canGo;
public boolean isRange(int x,... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.util.NoSuchElementException\n\tat Main.next(Main.java:143)\n\tat Main.solve(Main.java:48)\n\tat Main.main(Main.java:97)\n", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"mai... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | cpp | #include<bits/stdc++.h>
#define N 805
using namespace std;
int n,m,k,a[N][N],sx,sy,dis[N][N];
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
char s[N];
pair<int,int>q[N*N];
int main()
{
scanf("%d%d%d",&n,&m,&k);
for (int i=1;i<=n;i++)
{
scanf("%s",s+1);
for (int j=1;j<=m;j++)
{
if (s[j]=='S') sx=i,sy=j;
if ... | partial | 2 | 4 | [{"idx": 2, "reason": "wrong_answer", "expected": "2", "got": "1"}, {"idx": 3, "reason": "wrong_answer", "expected": "2", "got": "1"}] | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | cpp | #include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;
int main()
{
int n, m, k; cin>>n>>m>>k;
vector<string> a(n);
vector<vector<int>> v(n, vector<int>(m, -1));
queue<pair<int, int>> q;
for(int i=0; i<n; ++i) {
... | partial | 2 | 4 | [{"idx": 2, "reason": "wrong_answer", "expected": "2", "got": "1"}, {"idx": 3, "reason": "wrong_answer", "expected": "2", "got": "1"}] | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | python3 | from collections import deque
INF = float("inf")
H, W, K = map(int, input().split())
A = [list(input()) for _ in range(H)]
Si, Sj = (0, 0)
for i, a in enumerate(A):
if "S" in a:
Si, Sj = (i, a.index("S"))
A[Si][Sj] = "c"
break
distance = INF
Q = deque([(0, Si, Sj)])
while Q:
cnt, i,... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_q_pkefp0/tmphsuo5qyb.py\", line 6, in <module>\n A = [list(input()) for _ in range(H)]\n ^^^^^^^\nEOFError: EOF when reading a line\n", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_error... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | python3 | import sys
input = sys.stdin.readline
def main():
H, W, K = map(int, input().split())
state = [list(input()) for _ in range(H)]
q = []
checked = [[False]*W for _ in range(H)]
for h in range(H):
for w in range(W):
if state[h][w] == "S":
q.append((h, w))
... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_16yzl4bc/tmpwovzbz8p.py\", line 46, in <module>\n main()\n File \"/tmp/sbx_16yzl4bc/tmpwovzbz8p.py\", line 14, in main\n if state[h][w] == \"S\":\n ", "stdout_tail": ""}, {"idx": 2, "reason": "runti... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | java | import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
new Main().solve();
}
int H,W,K;
String[]A;
void solve(){
Scanner sc=new Scanner(System.in);
int count=1;
H=sc.nextInt();
W=sc.nextInt();
K=sc.nextInt(); //=魔法の移動... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.util.NoSuchElementException\n\tat java.base/java.util.Scanner.throwFor(Scanner.java:937)\n\tat java.base/java.util.Scanner.next(Scanner.java:1478)\n\tat Main.solve(Main.java:", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | java | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
final int INF = 10000000;
Scanner sc = new Scanner(System.in);
int H = sc.nextInt();
int W = sc.nextInt();
int K = sc.nextInt();
int startH=-1,sta... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.lang.StringIndexOutOfBoundsException: String index out of range: 2\n\tat java.base/java.lang.StringLatin1.charAt(StringLatin1.java:48)\n\tat java.base/java.lang.String.char", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_er... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | python2 | from collections import deque
H, W, K = map(int, raw_input().split())
MAP = [raw_input() for _ in xrange(H)]
visited = [[False for _ in xrange(W)] for _ in xrange(H)]
for y in range(H):
x = MAP[y].find('S')
if x != -1:
sx = x
sy = y
Q = deque()
Q.append((0, (sx, sy)))
visited[sy][sx] = True
... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_nmc40mtw/tmprqpj00cs.py\", line 5, in <module>\n MAP = [raw_input() for _ in xrange(H)]\nEOFError: EOF when reading a line\n", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_error", "rc": 1, "stderr": ... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | python2 | h, w, k=map(int, raw_input().split())
a=["#"*(w+2)]+["#"+raw_input()+"#" for i in range(h)]+["#"*(w+2)]
q=[]
first=0
dis=[[0]*(w+2) for i in range(h+2)]
for i in range(h+2):
for j in range(w+2):
if a[i][j]=="S":
q.append((i, j))
dis[i][j]=1
while first<len(q):
cur_x, cur_y=q[first]
first+=1
for next_x, next... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_6xz0hxt4/tmp9_0exmq8.py\", line 2, in <module>\n a=[\"#\"*(w+2)]+[\"#\"+raw_input()+\"#\" for i in range(h)]+[\"#\"*(w+2)]\nEOFError: EOF when reading a lin", "stdout_tail": ""}, {"idx": 2, "reason": "run... | atcoder | UNKNOWN | |
314 | p03725 AtCoder Grand Contest 014 - Closed Rooms | Takahashi is locked within a building.
This building consists of H×W rooms, arranged in H rows and W columns. We will denote the room at the i-th row and j-th column as (i,j). The state of this room is represented by a character A_{i,j}. If A_{i,j}= `#`, the room is locked and cannot be entered; if A_{i,j}= `.`, the r... | python2 | from collections import deque
h, w, k = map(int, raw_input().split())
A = [raw_input() for i in xrange(h)]
sx = sy = 0
for i in xrange(h):
idx = A[i].find('S')
if idx != -1:
sx = idx; sy = i
break
deq = deque()
deq.append((0, (sx, sy)))
used = set([(sx, sy)])
dd = [[-1, 0], [0, -1], [1, 0], [0... | partial | 1 | 4 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_hngw1qip/tmpkqrs37f4.py\", line 3, in <module>\n A = [raw_input() for i in xrange(h)]\nEOFError: EOF when reading a line\n", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_error", "rc": 1, "stderr": "T... | atcoder | UNKNOWN | |
316 | p04048 AtCoder Grand Contest 001 - Mysterious Light | Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of Mysterious Light.
Three mirrors of length N are set so that they form an equilateral triangle. Let the vertices of the triangle be a, b and c.
Inside the triangle, the rifle is placed at the point p on segment ab such that ap ... | python3 | ai = lambda: list(map(int,input().split()))
n, x = ai()
from fractions import gcd
print(3*(n-gcd(n,x)))
| all_fail | 0 | 1 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_uydheda5/tmp5wmsp2ju.py\", line 4, in <module>\n from fractions import gcd\nImportError: cannot import name 'gcd' from 'fractions' (/usr/lib/python3", "stdout_tail": ""}] | atcoder | UNKNOWN | |
319 | p01046 Yu-kun Likes a lot of Money | Background
The kindergarten attached to the University of Aizu is a kindergarten where children who love programming gather. Yu, one of the kindergarten children, loves money as much as programming. Yu-kun visited the island where treasures sleep to make money today. Yu-kun has obtained a map of the treasure in advanc... | cpp | #include <bits/stdc++.h>
#define INF 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
struct uftree{
int par[25];
int rank[25];
uftree(){
}
void init(int n){
for(int i=0;i<n;i++){
par[i]=i;
rank[i]=0;
}
}
int find(int x){
if(par[x]==x)return x;
return par[x]=find(par[... | partial | 1 | 3 | [{"idx": 0, "reason": "wrong_answer", "expected": "0", "got": "100"}, {"idx": 1, "reason": "wrong_answer", "expected": "0", "got": "10"}] | aizu | UNKNOWN | |
320 | p01179 Cousin's Aunt | Sarah is a girl who likes reading books.
One day, she wondered about the relationship of a family in a mystery novel. The story said,
* B is A’s father’s brother’s son, and
* C is B’s aunt.
Then she asked herself, “So how many degrees of kinship are there between A and C?”
There are two possible relationships bet... | cpp | #include <algorithm>
#include <cassert>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using namespace std::placeholders;
enum Relation {
FATHER, MOTHER, SON, DAUGHTER, HUSBAND, WIFE, BROTHER, SISTER, GRANDFATHER,
GRANDMOTHER, GRANDSON, GRANDDAUGHTER, UNCLE, AUNT, N... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_0qe4oe0t/tmp2z06__qa.cpp: In function ‘std::vector<std::__cxx11::basic_string<char> > split(const string&, char)’:
/tmp/sbx_0qe4oe0t/tmp2z06__qa.cpp:32:27: error: call of overloaded ‘size(const string&)’ is ambiguous
32 | for (int i = 0; i < size(str); ++i) {
| ~~... | [] | aizu | UNKNOWN |
324 | p02069 Universal and Existential Quantifiers | Problem Statement
You are given a list of $N$ intervals. The $i$-th interval is $[l_i, r_i)$, which denotes a range of numbers greater than or equal to $l_i$ and strictly less than $r_i$. In this task, you consider the following two numbers:
* The minimum integer $x$ such that you can select $x$ intervals from the gi... | cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll ... | all_fail | 0 | 1 | [{"idx": 0, "reason": "wrong_answer", "expected": "", "got": "0 1"}] | aizu | UNKNOWN | |
324 | p02069 Universal and Existential Quantifiers | Problem Statement
You are given a list of $N$ intervals. The $i$-th interval is $[l_i, r_i)$, which denotes a range of numbers greater than or equal to $l_i$ and strictly less than $r_i$. In this task, you consider the following two numbers:
* The minimum integer $x$ such that you can select $x$ intervals from the gi... | cpp | #include <bits/stdc++.h>
int N;
int64_t L;
std::vector<std::pair<int64_t, int64_t>> intervals;
int64_t calcX();
int64_t calcY();
int main()
{
scanf("%d%lld", &N, &L);
intervals.resize(N);
for (auto& e: intervals) scanf("%lld%lld", &e.first, &e.second);
printf("%d %d\n", calcX(), calcY());
return 0;
}
int64_t ... | all_fail | 0 | 1 | [{"idx": 0, "reason": "wrong_answer", "expected": "", "got": "0 -1073741823"}] | aizu | UNKNOWN | |
324 | p02069 Universal and Existential Quantifiers | Problem Statement
You are given a list of $N$ intervals. The $i$-th interval is $[l_i, r_i)$, which denotes a range of numbers greater than or equal to $l_i$ and strictly less than $r_i$. In this task, you consider the following two numbers:
* The minimum integer $x$ such that you can select $x$ intervals from the gi... | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int N;
long long L;
int main(){
cin>>N>>L;
vector<long long>A;
vector<pair<LL,LL> >B;
for(int i=0;i<N;i++)
{
long long l,r;
cin>>l>>r;
A.push_back(l);
A.push_back(r);
B.push_back(make_pair(l,r)... | all_fail | 0 | 1 | [{"idx": 0, "reason": "wrong_answer", "expected": "", "got": "0 -1999999999"}] | aizu | UNKNOWN | |
324 | p02069 Universal and Existential Quantifiers | Problem Statement
You are given a list of $N$ intervals. The $i$-th interval is $[l_i, r_i)$, which denotes a range of numbers greater than or equal to $l_i$ and strictly less than $r_i$. In this task, you consider the following two numbers:
* The minimum integer $x$ such that you can select $x$ intervals from the gi... | java | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner ir = new Scanner(System.in);
int n = ir.nextInt();
long l = ir.nextLong();
long[][] x = new long[n][];
for (int i = 0; i < n; i++) {
x[i] = new long[] { ir.... | all_fail | 0 | 1 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.util.NoSuchElementException\n\tat java.base/java.util.Scanner.throwFor(Scanner.java:937)\n\tat java.base/java.util.Scanner.next(Scanner.java:1594)\n\tat java.base/java.util.S", "stdout_tail": ""}] | aizu | UNKNOWN | |
333 | 1003_D. Coins and Queries | Polycarp has n coins, the value of the i-th coin is a_i. It is guaranteed that all the values are integer powers of 2 (i.e. a_i = 2^d for some non-negative integer number d).
Polycarp wants to know answers on q queries. The j-th query is described as integer number b_j. The answer to the query is the minimum number of... | python3 | import sys,os,io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_left , bisect_right
import math
def ii():
return int(input())
def li():
return list(map(int,input().split()))
if(os.p... | all_fail | 0 | 7 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_mo2v4b2v/tmp2po2a209.py\", line 52, in <module>\n solve()\n File \"/tmp/sbx_mo2v4b2v/tmp2po2a209.py\", line 20, in solve\n n,q = li()\n ^^^\nValue", "stdout_tail": ""}, {"idx": 1, "reason": "runtim... | codeforces | D | |
333 | 1003_D. Coins and Queries | Polycarp has n coins, the value of the i-th coin is a_i. It is guaranteed that all the values are integer powers of 2 (i.e. a_i = 2^d for some non-negative integer number d).
Polycarp wants to know answers on q queries. The j-th query is described as integer number b_j. The answer to the query is the minimum number of... | python2 | import os, sys, atexit
range = xrange
from cStringIO import StringIO as BytesIO
sys.stdout = BytesIO()
atexit.register(lambda: os.write(1, sys.stdout.getvalue()))
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
from sys import stdin, stdout
from copy import deepcopy
from math import log
rints = lambda: [i... | all_fail | 0 | 7 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_dug3rmex/tmp2nknlkbh.py\", line 15, in <module>\n n, q = rints()\nValueError: need more than 0 values to unpack\n", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Traceback ... | codeforces | D | |
334 | 1046_D. Interstellar battle | In the intergalactic empire Bubbledom there are N planets, of which some pairs are directly connected by two-way wormholes. There are N-1 wormholes. The wormholes are of extreme religious importance in Bubbledom, a set of planets in Bubbledom consider themselves one intergalactic kingdom if and only if any two planets ... | java | //package bubble11;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class D {
InputStream is;
PrintWriter out;
String INPUT = "";
void solve()
{
int n = ni();
dou... | all_fail | 0 | 21 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.lang.NegativeArraySizeException: -1\n\tat D.solve(D.java:24)\n\tat D.run(D.java:145)\n\tat D.main(D.java:150)\n", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.l... | codeforces | D | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | python3 | import sys
import random
def gcd(x, y):
return x if y == 0 else gcd(y, x % y)
def isPrime(n):
"""
Miller-Rabin primality test.
A return value of False means n is certainly not prime. A return value of
True means n is very likely a prime.
"""
if n!=int(n):
return False
n=int(n)... | partial | 16 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_4x8i16h6/tmpiacbxs9o.py\", line 52, in <module>\n x+=int(input())\n ^^^^^^^^^^^^\nValueError: invalid literal for int() with base 10: ''\n", "stdout_tail": "sqrt 4\n"}, {"idx": 7, "reason": "runtime... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | cpp | #include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
return b == 0 ? a : gcd(b, a % b);
}
const int BIGINTBITS = 32;
const unsigned int BIGINTMASK = (1LL << BIGINTBITS) - 1;
struct BigInt {
vector<unsigned int> d;
BigInt() {}
BigInt(unsigned long lon... | all_fail | 0 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "+ 12 16\n\n- 6 10\n\n* 8 15\n\n/ 5 4\n\nsqrt 16\n\nsqrt 5\n\n^ 6 12\n\n! 2 3 7", "got": "sqrt 4\n! 2 3 7"}, {"idx": 1, "reason": "timeout"}, {"idx": 2, "reason": "timeout"}, {"idx": 3, "reason": "timeout"}, {"idx": 4, "reason": "timeout"}] | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | python3 | import random
from sys import stdout
# https://rosettacode.org/wiki/Miller%E2%80%93Rabin_primality_test#Python
def is_Prime(n):
"""
Miller-Rabin primality test.
A return value of False means n is certainly not prime. A return value of
True means n is very likely a prime.
"""
if n!=int(n):
... | partial | 16 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_0v_nsbj8/tmpfa1usiip.py\", line 63, in <module>\n l = findFactors(n, n)\n ^^^^^^^^^^^^^^^^^\n File \"/tmp/sbx_0v_nsbj8/tmpfa1usiip.py\", line 5", "stdout_tail": "sqrt 4\n"}, {"idx": 7, "reason": "... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | cpp | #include <bits/stdc++.h>
using namespace std;
const int LEN = 100, bas = 8;
const int mod = 100000000;
struct Big {
int a[LEN];
Big() { memset(a, 0, sizeof(a)); }
void input() {
static char s[LEN * bas];
scanf("%s", s + 1);
a[0] = strlen(s + 1);
reverse(s + 1, s + a[0] + 1);
for (int i = (int)... | all_fail | 0 | 25 | [{"idx": 0, "reason": "timeout"}, {"idx": 1, "reason": "wrong_answer", "expected": "! 1 3", "got": "sqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\nsqrt 1\n! 1 3"}, {"idx": 2, "reason": "wrong_answer", "expected": "! 1 2", "got": "sqrt 1\nsqrt 1\nsqrt 1\ns... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | java | import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class Main {
static ArrayList<BigInteger> v;
static Random rnd;
static Scanner scanner;
static BigInteger n;
public static void factor() {
for (int i = 0; i < 60; i++) {
... | all_fail | 0 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.util.NoSuchElementException\n\tat java.base/java.util.Scanner.throwFor(Scanner.java:937)\n\tat java.base/java.util.Scanner.next(Scanner.java:1478)\n\tat Main.factor(Main.java", "stdout_tail": "sqrt 16\nsqrt 16\nsqrt 18\nsqrt 16... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
vector<T> &operator--(vector<T> &v) {
for (auto &i : v) --i;
return v;
}
template <typename T>
vector<T> &operator++(vector<T> &v) {
for (auto &i : v) ++i;
return v;
}
template <typename T>
istream ... | all_fail | 0 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "+ 12 16\n\n- 6 10\n\n* 8 15\n\n/ 5 4\n\nsqrt 16\n\nsqrt 5\n\n^ 6 12\n\n! 2 3 7", "got": "sqrt 1\nsqrt 4\nsqrt 4\nsqrt 4\nsqrt 16\nsqrt 1\nsqrt 4\nsqrt 16\nsqrt 1\nsqrt 16\nsqrt 16\nsqrt 16\nsqrt 16\nsqrt 16\nsqrt 4\nsqrt 1\nsqrt 16\nsqrt 4\nsqrt 16\nsqrt 4\nsqrt 16\nsq... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | java | import java.lang.*;
import java.math.BigInteger;
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
BigInteger n = scan.nextBigInteger();
final int TIME = 30;
HashSet <BigInteger> set = new HashSet<>();
for (... | all_fail | 0 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.util.NoSuchElementException\n\tat java.base/java.util.Scanner.throwFor(Scanner.java:937)\n\tat java.base/java.util.Scanner.next(Scanner.java:1594)\n\tat java.base/java.util.S", "stdout_tail": "sqrt 7\nsqrt 16\nsqrt 7\nsqrt 7\ns... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | java | import java.io.IOException;
import java.lang.reflect.Field;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.TreeSet;
public class test {
private static Random r = new Random();
private static BigInteger getRandom(... | all_fail | 0 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.util.NoSuchElementException\n\tat java.base/java.util.Scanner.throwFor(Scanner.java:937)\n\tat java.base/java.util.Scanner.next(Scanner.java:1594)\n\tat java.base/java.util.S", "stdout_tail": "sqrt 1\nsqrt 4\nsqrt 1\nsqrt 1\nsq... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | python3 | import random
def isPrime(n):
"""
Miller-Rabin primality test.
A return value of False means n is certainly not prime. A return value of
True means n is very likely a prime.
"""
if n!=int(n):
return False
n=int(n)
#Miller-Rabin test for prime
if n==0 or n==1 or n==4 or n==6... | partial | 16 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_tsa6_p_9/tmpce9_plrg.py\", line 58, in <module>\n y = int(input('sqrt {}\\n'.format(x * x % n)))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nV", "stdout_tail": "sqrt 16\n"}, {"idx": 7, "reason": "... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | python2 | import sys,random
range = xrange
input = raw_input
def gcd(a,b):
while b:
a,b = b, a%b
return a
n = N = int(input())
def is_prime(n):
"""returns True if n is prime else False"""
if n < 5 or n & 1 == 0 or n % 3 == 0:
return 2 <= n <= 3
s = ((n - 2) ^ (n - 1)).bit_length() - 1
d... | partial | 16 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_wt_e2qgp/tmpdiykmdhu.py\", line 48, in <module>\n f = factor(n)\n File \"/tmp/sbx_wt_e2qgp/tmpdiykmdhu.py\", line 36, in factor\n y = int(input())\n", "stdout_tail": "sqrt 0\n"}, {"idx": 7, "reason": ... | codeforces | G | |
336 | 1091_G. New Year and the Factorisation Collaboration | Integer factorisation is hard. The RSA Factoring Challenge offered $100 000 for factoring RSA-1024, a 1024-bit long product of two prime numbers. To this date, nobody was able to claim the prize. We want you to factorise a 1024-bit number.
Since your programming language of choice might not offer facilities for handli... | python2 | import random
from sys import stdout
def read_num():
while True:
n = raw_input()
if len(n) > 0: return int(n)
def send(payload):
print payload
stdout.flush()
def gcd(a, b):
while b > 0:
a, b = b, a % b
return a
def factor(n, original_n):
while True:
a = random... | partial | 16 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "+ 12 16\n\n- 6 10\n\n* 8 15\n\n/ 5 4\n\nsqrt 16\n\nsqrt 5\n\n^ 6 12\n\n! 2 3 7", "got": "sqrt 16\nsqrt 1\n! 2 3 7"}, {"idx": 7, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_cury7n0e/tmp6cjk2mmz.py\", line 80, in <... | codeforces | G | |
337 | 1110_E. Magic Stones | Grigory has n magic stones, conveniently numbered from 1 to n. The charge of the i-th stone is equal to c_i.
Sometimes Grigory gets bored and selects some inner stone (that is, some stone with index i, where 2 ≤ i ≤ n - 1), and after that synchronizes it with neighboring stones. After that, the chosen stone loses its ... | python3 | n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
f=a[0]==b[0]
a=sorted([a[i+1]-a[i] for i in range(n-1)])
b=sorted([b[i+1]-b[i] for i in range(n-1)])
print('YES' if f and a==b else 'NO')
| all_fail | 0 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "Yes", "got": "YES"}, {"idx": 1, "reason": "wrong_answer", "expected": "No", "got": "NO"}, {"idx": 2, "reason": "wrong_answer", "expected": "No", "got": "NO"}, {"idx": 3, "reason": "wrong_answer", "expected": "No", "got": "NO"}, {"idx": 4, "reason": "wrong_answer", "exp... | codeforces | E | |
338 | 1140_B. Good String | You have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the string. If you choose a character >, the character that comes right after it is deleted (if the character you chose was the l... | java | import java.util.Scanner;
public class good_string {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
int t=s.nextInt()... | partial | 4 | 5 | [{"idx": 0, "reason": "wrong_answer", "expected": "0\n0\n0", "got": "-1\n-1\n-1"}] | codeforces | B | |
338 | 1140_B. Good String | You have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the string. If you choose a character >, the character that comes right after it is deleted (if the character you chose was the l... | python3 | n = int(input())
Tests = []
for i in range(2*n):
if (i % 2 == 0):
input()
continue
else:
Tests.append(input())
for i in range(n):
max_left = 10**6
max_right = 10**6
for j in range(len(Tests[i])):
if Tests[i][j] == '>':
max_left = j
break
... | partial | 4 | 5 | [{"idx": 0, "reason": "wrong_answer", "expected": "0\n0\n0", "got": "1000000\n1000000\n1000000"}] | codeforces | B | |
338 | 1140_B. Good String | You have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the string. If you choose a character >, the character that comes right after it is deleted (if the character you chose was the l... | python3 | for i in range(int(input())):
n=int(input())
s=str(input())
s=list(s)
if n==1:
print(0)
else:
st=s[0]
en=s[-1]
if st==">" or en=="<":
print(0)
else:
if ">" in s:
c1=s.index(">")
if ... | partial | 4 | 5 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_lrmr21rr/tmpag859o5a.py\", line 21, in <module>\n print(min(c1,c2))\n ^^\nNameError: name 'c1' is not defined\n", "stdout_tail": ""}] | codeforces | B | |
338 | 1140_B. Good String | You have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the string. If you choose a character >, the character that comes right after it is deleted (if the character you chose was the l... | python2 | """
Author : raj1307
Institute : Jalpaiguri Government Engineering College
Date : 22.03.19
"""
from __future__ import division, print_function
import itertools,os,sys
#from collections import deque, Counter, OrderedDict
#from heapq import nsmallest, nlargest, heapify, #heappop ,heappush, heapreplace
#from math ... | all_fail | 0 | 5 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_rbp3kp8s/tmp_89cd53s.py\", line 80, in <module>\n main()\n File \"/tmp/sbx_rbp3kp8s/tmp_89cd53s.py\", line 57, in main\n for _ in range(ii()):\n Fi", "stdout_tail": ""}, {"idx": 1, "reason": "runtime... | codeforces | B | |
338 | 1140_B. Good String | You have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the string. If you choose a character >, the character that comes right after it is deleted (if the character you chose was the l... | python2 | t = int(raw_input().strip())
for x in range(t):
n = int(raw_input().strip())
arr = raw_input().strip()
i = 0
leftSum = 1
rightSum = 1
leftSign = arr[0]
rightSign = arr[n-1]
if leftSign == '>' or rightSign == '<':
print "0"
continue
while arr[i] == arr[i... | partial | 4 | 5 | [{"idx": 0, "reason": "wrong_answer", "expected": "0\n0\n0", "got": "1\n1\n1"}] | codeforces | B | |
341 | 1199_E. Matching vs Independent Set | You are given a graph with 3 ⋅ n vertices and m edges. You are to find a matching of n edges, or an independent set of n vertices.
A set of edges is called a matching if no two edges share an endpoint.
A set of vertices is called an independent set if no two vertices are connected with an edge.
Input
The first line... | java | /**
* BaZ :D
*/
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class ACMIND
{
static FastReader scan;
static PrintWriter pw;
static long MOD = 1_000_000_007;
static long INF = 1_000_000_000_000_000_000L;
static long inf = 2_000_000_000;
public static void main(S... | partial | 1 | 3 | [{"idx": 0, "reason": "wrong_answer", "expected": "Matching\n1\nMatching\n1\nIndSet\n3 4\nMatching\n1 10", "got": "Matching\n2\nMatching\n2\nIndSet\n3 4\nMatching\n10 15"}, {"idx": 2, "reason": "wrong_answer", "expected": "Matching\n1\nMatching\n1\nIndSet\n3 4\nMatching\n1 10", "got": "Matching\n2\nMatching\n2\nIndSet\... | codeforces | E | |
343 | 1239_E. Turtle | Kolya has a turtle and a field of size 2 × n. The field rows are numbered from 1 to 2 from top to bottom, while the columns are numbered from 1 to n from left to right.
Suppose in each cell of the field there is a lettuce leaf. The energy value of lettuce leaf in row i and column j is equal to a_{i,j}. The turtle is i... | cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,fast-math")
using namespace std;
long long poww(long long a, long long b, long long md) {
return (!b ? 1
: (b & 1 ? a * poww(a * a % md, b / 2, md) % md
: poww(a * a % md, b / 2, md) % md));
}
const int maxn = 27;
con... | partial | 3 | 25 | [{"idx": 1, "reason": "wrong_answer", "expected": "1 3\n4 2", "got": "1 4\n3 2"}, {"idx": 3, "reason": "wrong_answer", "expected": "2780 6805 8637 10775 11178 11438 11632 12381 12792 13310 15361 17502 21476 23125 23532 37477 37732 37998 42308 43597 43987 44865 45527 48789 49458\n34685 34685 34685 34515 33966 33001 3201... | codeforces | E | |
343 | 1239_E. Turtle | Kolya has a turtle and a field of size 2 × n. The field rows are numbered from 1 to 2 from top to bottom, while the columns are numbered from 1 to n from left to right.
Suppose in each cell of the field there is a lettuce leaf. The energy value of lettuce leaf in row i and column j is equal to a_{i,j}. The turtle is i... | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 50, M = 5e4 + 5;
int n, a[N], ans, sum;
bool dp[N][N * M];
char pos[N][N * M];
bool used[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
n *= 2;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
... | partial | 3 | 25 | [{"idx": 1, "reason": "wrong_answer", "expected": "1 3\n4 2", "got": "2 3\n4 1"}, {"idx": 3, "reason": "wrong_answer", "expected": "2780 6805 8637 10775 11178 11438 11632 12381 12792 13310 15361 17502 21476 23125 23532 37477 37732 37998 42308 43597 43987 44865 45527 48789 49458\n34685 34685 34685 34515 33966 33001 3201... | codeforces | E | |
343 | 1239_E. Turtle | Kolya has a turtle and a field of size 2 × n. The field rows are numbered from 1 to 2 from top to bottom, while the columns are numbered from 1 to n from left to right.
Suppose in each cell of the field there is a lettuce leaf. The energy value of lettuce leaf in row i and column j is equal to a_{i,j}. The turtle is i... | cpp | #include <bits/stdc++.h>
using namespace std;
bool next_perm(vector<int>& v, int n, int k) {
for (int i = k - 1; i >= 0;) {
if (v[i] == n - k + i) {
i--;
} else {
v[i] += 1;
i++;
while (i < k) {
v[i] = v[i - 1] + 1;
i++;
}
return true;
}
}
return fal... | partial | 7 | 25 | [{"idx": 3, "reason": "wrong_answer", "expected": "2780 6805 8637 10775 11178 11438 11632 12381 12792 13310 15361 17502 21476 23125 23532 37477 37732 37998 42308 43597 43987 44865 45527 48789 49458\n34685 34685 34685 34515 33966 33001 32012 31622 31163", "got": "2780 6805 8637 10775 11178 11438 11632 12922 25880 25982 ... | codeforces | E | |
344 | 1257_G. Divisor Set | You are given an integer x represented as a product of n its prime divisors p_1 ⋅ p_2, ⋅ … ⋅ p_n. Let S be the set of all positive integer divisors of x (including 1 and x itself).
We call a set of integers D good if (and only if) there is no pair a ∈ D, b ∈ D such that a ≠ b and a divides b.
Find a good subset of S ... | cpp | #include <bits/stdc++.h>
using namespace std;
const int LOGN = 18;
const int MOD = 998244353;
int g = 3;
int mul(int a, int b) { return int(a * 1ll * b % MOD); }
int norm(int a) {
while (a >= MOD) a -= MOD;
while (a < 0) a += MOD;
return a;
}
int binPow(int a, int k) {
int ans = 1;
for (; k > 0; k >>= 1) {
... | compile_error | 0 | 0 | COMPILE_ERROR:In file included from /usr/include/c++/11/map:60,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:81,
from /tmp/sbx_d6qjg4xv/tmppm9haxee.cpp:1:
/usr/include/c++/11/bits/stl_tree.h: In instantiation of ‘static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Com... | [] | codeforces | G |
345 | 1281_B. Azamon Web Services | Your friend Jeff Zebos has been trying to run his new online company, but it's not going very well. He's not getting a lot of sales on his website which he decided to call Azamon. His big problem, you think, is that he's not ranking high enough on the search engines. If only he could rename his products to have better ... | java | // package com.company;
import java.util.*;
import java.lang.*;
import java.io.*;
//****Use Integer Wrapper Class for Arrays.sort()****
public class BD2 {
public static void main(String[] Args){
FastReader scan=new FastReader();
int t=scan.nextInt();
while(t-->0) {
StringBuilder ... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "AAZMON\n---\nAEPLP", "got": "AAZMON\n---\nAPPLE"}, {"idx": 1, "reason": "wrong_answer", "expected": "AAZMON\n---\nAEPLP", "got": "AAZMON\n---\nAPPLE"}] | codeforces | B | |
345 | 1281_B. Azamon Web Services | Your friend Jeff Zebos has been trying to run his new online company, but it's not going very well. He's not getting a lot of sales on his website which he decided to call Azamon. His big problem, you think, is that he's not ranking high enough on the search engines. If only he could rename his products to have better ... | cpp | #include <bits/stdc++.h>
using namespace std;
int caseno = 0;
void yesno(bool okk) { cout << (okk ? "YES" : "NO") << '\n'; }
const int primemod = 1000000007;
const long long maxsize = 1 * 1000000 + 9;
const double eps = 1e-10;
const int N = 210;
void solve() {
string t, s;
cin >> s >> t;
if (s < t) {
cout << ... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "AAZMON\n---\nAEPLP", "got": "AAZMON\n---\nAPPLE"}, {"idx": 1, "reason": "wrong_answer", "expected": "AAZMON\n---\nAEPLP", "got": "AAZMON\n---\nAPPLE"}] | codeforces | B | |
345 | 1281_B. Azamon Web Services | Your friend Jeff Zebos has been trying to run his new online company, but it's not going very well. He's not getting a lot of sales on his website which he decided to call Azamon. His big problem, you think, is that he's not ranking high enough on the search engines. If only he could rename his products to have better ... | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string s1, s2;
cin >> s1 >> s2;
if (s1 < s2) {
cout << s1 << endl;
continue;
}
bool flag = false;
for (int i = 0; i < s1.size(); i++) {
if (flag) break;
for (int j = i; j < s1.... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "AAZMON\n---\nAEPLP", "got": "AAZMON\n---\nAPPLE"}, {"idx": 1, "reason": "wrong_answer", "expected": "AAZMON\n---\nAEPLP", "got": "AAZMON\n---\nAPPLE"}] | codeforces | B | |
346 | 1301_B. Motarack's Birthday | Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an array a of n non-negative integers.
Dark created that array 1000 years ago, so some elements in that array disappeared. Dark knows that Motarack hates to see an array that has two adjacent elements with a high... | python3 | # import sys
# file = open('test1')
# sys.stdin = file
def ii(): return int(input())
def ai(): return list(map(int, input().split()))
def mi(): return map(int, input().split())
for _ in range(int(input())):
n = ii()
lst = ai()
nlst = []
for ind, ele in enumerate(lst):
if ele==-1:
if ind!=0 and lst[ind-1]!=-1:... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 37\n3 6\n0 1\n0 0\n1 2\n3 4"}, {"idx": 1, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 37\n3 6\n0 1\n0 0\n1 2\n3 4"}] | codeforces | B | |
346 | 1301_B. Motarack's Birthday | Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an array a of n non-negative integers.
Dark created that array 1000 years ago, so some elements in that array disappeared. Dark knows that Motarack hates to see an array that has two adjacent elements with a high... | python3 | I=input
for _ in[0]*int(I()):
n=int(I());a=*map(int,I().split()),;l=max(0,0,*(abs(x-y)for x,y
in zip(a,a[1:])if x|y>0));b=[i for i,x in enumerate(a)if x<0];r=[]
for i,j in zip([-1]+b,b+[n]):
if j>i+1:r+=([],[a[i+1]])[i>=0]+([],[a[j-1]])[j<n]
r=r or[0];m=min(r);z=(max(r)-m+1)//2;print(max(z,l),m+z) | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 38\n3 6\n0 0\n0 0\n1 2\n3 4"}, {"idx": 1, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 38\n3 6\n0 0\n0 0\n1 2\n3 4"}] | codeforces | B | |
346 | 1301_B. Motarack's Birthday | Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an array a of n non-negative integers.
Dark created that array 1000 years ago, so some elements in that array disappeared. Dark knows that Motarack hates to see an array that has two adjacent elements with a high... | cpp | #include <bits/stdc++.h>
using namespace std;
const long long INF_MAX = 1e18;
const long long INF_MIN = (1e18) * (-1);
const long long mod = 1e9 + 7;
const long long N = 2e5 + 10;
void Solve() {
long long n;
cin >> n;
long long ara[n + 10];
for (long long i = 1; i <= n; i++) {
cin >> ara[i];
}
vector<lo... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 37\n3 6\n0 1\n0 0\n1 2\n3 4"}, {"idx": 1, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 37\n3 6\n0 1\n0 0\n1 2\n3 4"}] | codeforces | B | |
346 | 1301_B. Motarack's Birthday | Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an array a of n non-negative integers.
Dark created that array 1000 years ago, so some elements in that array disappeared. Dark knows that Motarack hates to see an array that has two adjacent elements with a high... | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for (int i = 0; i < n; i++) {
int m = in.nextInt();
int[] a = new int[m];
... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 37\n3 6\n0 499999999\n0 0\n1 2\n3 4"}, {"idx": 1, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 37\n3 6\n0 499999999\n0 0\n1 2\n3 4"}] | codeforces | B | |
346 | 1301_B. Motarack's Birthday | Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an array a of n non-negative integers.
Dark created that array 1000 years ago, so some elements in that array disappeared. Dark knows that Motarack hates to see an array that has two adjacent elements with a high... | python2 | import math
import heapq
import sys
num = int(raw_input())
for i in range(num):
n = int(raw_input())
a = [int(x) for x in raw_input().split(" ")]
nums_to_look = set()
for j in range(len(a)):
if a[j] == -1:
if j==0:
if a[j+1]!=-1:
nums_to_look.add(a... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 38\n3 6\n0 1\n0 0\n1 2\n3 4"}, {"idx": 1, "reason": "wrong_answer", "expected": "1 11\n5 37\n3 6\n0 0\n0 0\n1 2\n3 4", "got": "1 11\n5 38\n3 6\n0 1\n0 0\n1 2\n3 4"}] | codeforces | B | |
348 | 1344_A. Hilbert's Hotel | Hilbert's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one room for every integer, including zero and negative integers. Even stranger, the hotel is currently at full capacity, meaning there is exactly one guest in every room. The hotel's manager, David Hilbert himself,... | python2 | from __future__ import division, print_function
_interactive = False
def main():
for _ in range(int(input())):
n = int(input())
ar = input_as_list()
exists = array_of(bool, n)
for i, e in enumerate(ar):
exists[(i+e)%n] = True
print("YES" if all(exists) else "NO... | all_fail | 0 | 3 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_6h3bjnlx/tmpe0e84t1o.py\", line 64, in <module>\n main()\n File \"/tmp/sbx_6h3bjnlx/tmpe0e84t1o.py\", line 5, in main\n for _ in range(int(input())", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_... | codeforces | A | |
350 | 1408_A. Circle Coloring | You are given three sequences: a_1, a_2, …, a_n; b_1, b_2, …, b_n; c_1, c_2, …, c_n.
For each i, a_i ≠ b_i, a_i ≠ c_i, b_i ≠ c_i.
Find a sequence p_1, p_2, …, p_n, that satisfy the following conditions:
* p_i ∈ \\{a_i, b_i, c_i\}
* p_i ≠ p_{(i mod n) + 1}.
In other words, for each element, you need to choose ... | python2 | import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')
for _ in x... | all_fail | 0 | 2 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_0w5im8ut/tmp32ir3ape.py\", line 11, in <module>\n for _ in xrange(int(input())):\nValueError: invalid literal for int() with base 10: ''\n", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_error", "rc":... | codeforces | A | |
350 | 1408_A. Circle Coloring | You are given three sequences: a_1, a_2, …, a_n; b_1, b_2, …, b_n; c_1, c_2, …, c_n.
For each i, a_i ≠ b_i, a_i ≠ c_i, b_i ≠ c_i.
Find a sequence p_1, p_2, …, p_n, that satisfy the following conditions:
* p_i ∈ \\{a_i, b_i, c_i\}
* p_i ≠ p_{(i mod n) + 1}.
In other words, for each element, you need to choose ... | python2 | T = int(raw_input())
for _ in xrange(T):
n = int(raw_input())
a = map(int, raw_input().split())
b = map(int, raw_input().split())
c = map(int, raw_input().split())
ans = [0] * n
for i in xrange(n):
for x in (a[i], b[i], c[i]):
if ans[i-1] != x != ans[(i+1)%n]:
... | all_fail | 0 | 2 | [{"idx": 0, "reason": "wrong_answer", "expected": "1 2 3\n1 2 1 2\n1 3 4 1 2 1 4\n1 2 3\n1 2 1 2 3 2 3 1 3 2", "got": "3 2 1\n3 4 3 4\n4 2 4 2 4 2 1\n3 1 2\n3 2 3 1 3 1 2 1 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "1 2 3\n1 2 1 2\n1 3 4 1 2 1 4\n1 2 3\n1 2 1 2 3 2 3 1 3 2", "got": "3 2 1\n3 4 3 4\n4 2 4 ... | codeforces | A | |
353 | 1525_D. Armchairs | There are n armchairs, numbered from 1 to n from left to right. Some armchairs are occupied by people (at most one person per armchair), others are not. The number of occupied armchairs is not greater than n/2.
For some reason, you would like to tell people to move from their armchairs to some other ones. If the i-th ... | cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;
#define pb push_back
#define ff first
#define ss second
#define max_(a,b,c) max1(max1(a,b),c)
#define min_(a,b,c) mn(mn(a,b),c)
long gcd(long a,long b) { return b?gcd(b,a%b):a;}
#define rep(i,... | all_fail | 0 | 12 | [{"idx": 0, "reason": "wrong_answer", "expected": "\n9", "got": ""}, {"idx": 1, "reason": "wrong_answer", "expected": "\n0", "got": ""}, {"idx": 2, "reason": "wrong_answer", "expected": "\n3", "got": ""}, {"idx": 3, "reason": "wrong_answer", "expected": "10", "got": ""}, {"idx": 4, "reason": "wrong_answer", "expected":... | codeforces | D | |
358 | 295_D. Greg and Caves | Greg has a pad. The pad's screen is an n × m rectangle, each cell can be either black or white. We'll consider the pad rows to be numbered with integers from 1 to n from top to bottom. Similarly, the pad's columns are numbered with integers from 1 to m from left to right.
Greg thinks that the pad's screen displays a c... | java | //package round179;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class D {
InputStream is;
PrintWriter out;
String INPUT = "";
int mod = 1000000007;
int[][] fif = en... | all_fail | 0 | 25 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.util.InputMismatchException\n\tat D.readByte(D.java:80)\n\tat D.ni(D.java:135)\n\tat D.solve(D.java:18)\n\tat D.run(D.java:68)\n\tat D.main(D.java:73)\n", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_error", "rc": 1, "stde... | codeforces | D | |
362 | 40_B. Repaintings | A chessboard n × m in size is given. During the zero minute we repaint all the black squares to the 0 color. During the i-th minute we repaint to the i color the initially black squares that have exactly four corner-adjacent squares painted i - 1 (all such squares are repainted simultaneously). This process continues a... | cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 1e5 + 5;
int main() {
int n, m, x;
cin >> n >> m >> x;
n = n - 2 * x + 2;
m = m - 2 * x + 2;
if (n < 0 or m < 0) return puts("0");
int result = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
if (i =... | partial | 22 | 25 | [{"idx": 4, "reason": "runtime_error", "rc": 2, "stderr": "", "stdout_tail": "0\n"}, {"idx": 14, "reason": "runtime_error", "rc": 2, "stderr": "", "stdout_tail": "0\n"}, {"idx": 17, "reason": "runtime_error", "rc": 2, "stderr": "", "stdout_tail": "0\n"}] | codeforces | B | |
362 | 40_B. Repaintings | A chessboard n × m in size is given. During the zero minute we repaint all the black squares to the 0 color. During the i-th minute we repaint to the i color the initially black squares that have exactly four corner-adjacent squares painted i - 1 (all such squares are repainted simultaneously). This process continues a... | python3 | n, m = map(int, input().split())
x = int(input())
k = 0
for i in range(n):
for j in range(m):
if not (i + j) % 2:
if min(min(i, j) + 1, min(n - i, m - j)) == x:
k += 1
print(k)
| partial | 15 | 25 | [{"idx": 3, "reason": "timeout"}, {"idx": 6, "reason": "timeout"}, {"idx": 7, "reason": "timeout"}, {"idx": 8, "reason": "timeout"}, {"idx": 13, "reason": "timeout"}] | codeforces | B | |
364 | 45_H. Road Problem | The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions.
The city administrat... | cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long double eps = 1e-7;
const int inf = 1000000010;
const long long INF = 10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010, LOG = 20;
struct DSU {
int par[901];
vector<int> vec[901];
DSU() {
for (int i = ... | partial | 7 | 25 | [{"idx": 1, "reason": "wrong_answer", "expected": "1\n1 4", "got": "1\n4 1"}, {"idx": 4, "reason": "wrong_answer", "expected": "4\n2 4\n7 19\n12 5\n6 14", "got": "4\n7 4\n2 19\n12 5\n6 14"}, {"idx": 5, "reason": "wrong_answer", "expected": "4\n7 16\n15 10\n12 20\n19 3", "got": "4\n16 7\n10 15\n20 12\n3 19"}, {"idx": 6,... | codeforces | H | |
364 | 45_H. Road Problem | The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions.
The city administrat... | cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int N = 1e6 + 10;
const long long mod = 1e9 + 7;
const long long mod2 = 998244353;
const long long inf = 8e18;
const int LOG = 22;
long long pw(long long a, long long b, long long M) {
return (!b ? 1
: (b & 1 ? (a * pw(a * a %... | partial | 14 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "1\n1 3", "got": "1\n1 4"}, {"idx": 2, "reason": "wrong_answer", "expected": "3\n7 5\n10 4\n3 1", "got": "3\n1 3\n7 5\n10 4"}, {"idx": 7, "reason": "wrong_answer", "expected": "1\n1 5", "got": "1\n9 5"}, {"idx": 8, "reason": "wrong_answer", "expected": "1\n4 6", "got": ... | codeforces | H | |
364 | 45_H. Road Problem | The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions.
The city administrat... | cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 901;
vector<int> gra0[MAXN], gra1[MAXN], isop;
int fa[MAXN], cnt[MAXN], d[MAXN], anc[MAXN];
bool mp0[MAXN][MAXN], mp1[MAXN][MAXN];
int dn;
int DSU_Father(int a) {
if (fa[a] == a)
return a;
else
return fa[a] = DSU_Father(fa[a]);
}
void DSU_Merge(... | partial | 9 | 25 | [{"idx": 2, "reason": "wrong_answer", "expected": "3\n7 5\n10 4\n3 1", "got": "3\n3 4\n5 7\n1 10"}, {"idx": 4, "reason": "wrong_answer", "expected": "4\n2 4\n7 19\n12 5\n6 14", "got": "4\n2 6\n7 4\n5 19\n14 12"}, {"idx": 5, "reason": "wrong_answer", "expected": "4\n7 16\n15 10\n12 20\n19 3", "got": "4\n7 10\n15 3\n12 2... | codeforces | H | |
364 | 45_H. Road Problem | The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions.
The city administrat... | java | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Stack;
import java.util.ArrayList;
import java.util.List;
imp... | partial | 5 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "1\n1 3", "got": "1\n4 1"}, {"idx": 2, "reason": "wrong_answer", "expected": "3\n7 5\n10 4\n3 1", "got": "3\n10 7\n3 4\n5 1"}, {"idx": 4, "reason": "wrong_answer", "expected": "4\n2 4\n7 19\n12 5\n6 14", "got": "4\n12 5\n2 6\n4 19\n14 7"}, {"idx": 6, "reason": "wrong_an... | codeforces | H | |
364 | 45_H. Road Problem | The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions.
The city administrat... | python3 | import sys
import threading
def main():
p = input().split()
n = int(p[0]) #number of locations
m = int(p[1]) #number of passages
if n==1: #if there's only one location, there's nothing to do
print(0)
return
if n==2: #if there's only two nodes, the only edge between them, is a... | partial | 5 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "1\n1 3", "got": "1\n3 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "1\n1 4", "got": "1\n4 1"}, {"idx": 2, "reason": "wrong_answer", "expected": "3\n7 5\n10 4\n3 1", "got": "3\n10 1\n3 4\n5 7"}, {"idx": 4, "reason": "wrong_answer", "expected": "4\n2 4\n7 19\n12... | codeforces | H | |
364 | 45_H. Road Problem | The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions.
The city administrat... | python3 | import sys
import threading
def main():
p = input().split()
n = int(p[0]) #number of locations
m = int(p[1]) #number of passages
if n==1:
print(0)
return
if n==2:
print(-1)
return
g = graph(n,m)
sys.setrecursionlimit(100000)
threading.stack_size... | partial | 5 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "1\n1 3", "got": "1\n3 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "1\n1 4", "got": "1\n4 1"}, {"idx": 2, "reason": "wrong_answer", "expected": "3\n7 5\n10 4\n3 1", "got": "3\n10 1\n3 4\n5 7"}, {"idx": 4, "reason": "wrong_answer", "expected": "4\n2 4\n7 19\n12... | codeforces | H | |
364 | 45_H. Road Problem | The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions.
The city administrat... | python3 | def dfs1(v):
mark[v]=1
st.append(v)
dp[v]=d[v]
for u in adj[v]:
if not mark[u]:
d[u]=d[v]+1
dfs1(u)
dp[v]=min(dp[u],dp[v])
elif d[u]<d[v]-1:
dp[v]=min(dp[v],d[u])
if dp[v]==d[v]:
ver[cnt[0]]=v
prv =-1
while prv !... | partial | 15 | 25 | [{"idx": 0, "reason": "wrong_answer", "expected": "1\n1 3", "got": "1\n4 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "1\n1 4", "got": "1\n4 1"}, {"idx": 7, "reason": "wrong_answer", "expected": "1\n1 5", "got": "1\n5 1"}, {"idx": 8, "reason": "wrong_answer", "expected": "1\n4 6", "got": "1\n6 4"}, {"idx": 11,... | codeforces | H | |
365 | 483_B. Friends and Presents | You have two friends. You want to present each of them several positive integers. You want to present cnt1 numbers to the first friend and cnt2 numbers to the second friend. Moreover, you want all presented numbers to be distinct, that also means that no number should be presented to both friends.
In addition, the fir... | java | import java.io.*;
import java.util.*;
import org.omg.CORBA.PUBLIC_MEMBER;
public class Main
{
public static int cnt1,cnt2,x,y;
static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
public static void main(String[] args)throws IOException
{
while (in.nextToken()... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_l0cnhcmz/Main.java:4: error: package org.omg.CORBA does not exist
import org.omg.CORBA.PUBLIC_MEMBER;
^
1 error
| [] | codeforces | B |
367 | 650_B. Image Preview | Vasya's telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by swiping finger over the screen. If you swipe left from the first photo, you reach photo n. Similarly, by swiping right from the last photo you reach photo 1. It takes a sec... | java | import javafx.util.Pair;
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Reader in = new Reader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
int n = in.nextI... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_ttmdiex9/Main.java:1: error: package javafx.util does not exist
import javafx.util.Pair;
^
1 error
| [] | codeforces | B |
369 | 720_C. Homework | Today Peter has got an additional homework for tomorrow. The teacher has given three integers to him: n, m and k, and asked him to mark one or more squares on a square grid of size n × m.
The marked squares must form a connected figure, and there must be exactly k triples of marked squares that form an L-shaped tromi... | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 41414;
bool a[N][320], as[N][320];
int n, m, k, ty, tl, t, z, mx;
bool pd(int k) {
if (k < 0 || k == 1 || k == 2 || k == 5 || k == 4 ||
k == 8 && n != 3 && m != 3)
return 1;
return 0;
}
void dfs(int x, int y, int ct) {
if (tl) return;
if ((x ... | partial | 13 | 22 | [{"idx": 1, "reason": "wrong_answer", "expected": "****************........................................................................................................................................................................................", "got": "**********************************************************... | codeforces | C | |
369 | 720_C. Homework | Today Peter has got an additional homework for tomorrow. The teacher has given three integers to him: n, m and k, and asked him to mark one or more squares on a square grid of size n × m.
The marked squares must form a connected figure, and there must be exactly k triples of marked squares that form an L-shaped tromi... | cpp | #include <bits/stdc++.h>
using namespace std;
bool hasans[5][5][100];
bool res[5][5][100][5][5];
vector<int> flag[100010];
int calc(int n, int m) {
int ret = 0;
for (int i = 1; i < n; i++) {
for (int j = 1; j < m; j++) {
int cur =
flag[i][j] + flag[i + 1][j] + flag[i][j + 1] + flag[i + 1][j + 1]... | partial | 3 | 22 | [{"idx": 0, "reason": "wrong_answer", "expected": "***\n*.*\n***\n\n***\n**.\n...\n\n***\n*.*\n**.", "got": "**.\n**.\n...\n\n***\n**.\n...\n\n.**\n**.\n*.."}, {"idx": 1, "reason": "wrong_answer", "expected": "****************................................................................................................. | codeforces | C | |
369 | 720_C. Homework | Today Peter has got an additional homework for tomorrow. The teacher has given three integers to him: n, m and k, and asked him to mark one or more squares on a square grid of size n × m.
The marked squares must form a connected figure, and there must be exactly k triples of marked squares that form an L-shaped tromi... | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
const int dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
struct arr {
int A[400006];
int* operator[](int i) { return A + i * (m + 2); }
} S;
int as = 0;
int cal(int x, int y) {
int re = 0;
re += S[x + 1][y] & S[x][y - ... | partial | 10 | 22 | [{"idx": 0, "reason": "wrong_answer", "expected": "***\n*.*\n***\n\n***\n**.\n...\n\n***\n*.*\n**.", "got": "**.\n**.\n...\n\n***\n**.\n...\n\n.**\n**.\n*.."}, {"idx": 3, "reason": "wrong_answer", "expected": "**************************************************************************************************************... | codeforces | C | |
370 | 789_A. Anastasia and pebbles | Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the pebbles she could find in the park.
She has only two pockets. She can put at most k pebbles in each pocket at the same time.... | java | /**
* DA-IICT
* Author : Savaliya Sagar
*/
import java.io.*;
import java.math.*;
import java.util.*;
public class A789 {
InputStream is;
PrintWriter out;
int n,w[],k;
void solve() {
n = ni();
k = ni();
w = na(n);
int p = 0;
for(int i=0;i<n;i++){
p += Math.ceil((double)w[i]/k);
}
out.println((lo... | all_fail | 0 | 9 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.io.FileNotFoundException: /media/sagar407/D/java workspace/11Input_output/input.txt (No such file or directory)\n\tat java.base/java.io.FileInputStream.open0(Native Metho", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_erro... | codeforces | A | |
372 | 855_D. Rowena Ravenclaw's Diadem | Harry, upon inquiring Helena Ravenclaw's ghost, came to know that she told Tom Riddle or You-know-who about Rowena Ravenclaw's diadem and that he stole it from her.
Harry thought that Riddle would have assumed that he was the only one to discover the Room of Requirement and thus, would have hidden it there. So Harry ... | cpp | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
template <class T>
void _R(T &x) {
cin >> x;
}
void _R(int &x) { cin >> x; }
void _R(int64_t &x) { cin >> x; }
void _R(double &x) { cin >> x; }
void _R(long double &x) { cin >> x; }
void _R(char &x) { cin >> x; }
void _R(char *x) { cin >>... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_ecfp77de/tmp3rw9y0gs.cpp: In function ‘void dfs(int, int, int)’:
/tmp/sbx_ecfp77de/tmp3rw9y0gs.cpp:61:5: error: reference to ‘data’ is ambiguous
61 | data[r][0] = {0, 0};
| ^~~~
In file included from /usr/include/c++/11/string:54,
from /usr/include/c++/11/bits/lo... | [] | codeforces | D |
373 | 87_B. Vasya and Types | Programmer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like languages are unapplicable to it. To fully understand the statement, please read the language's description below... | cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
clock_t clk = clock();
long long int i, j;
void solve(void);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
;
int t = 1;
while (t--) solve();
return 0;
}
map<string, string> m;
void solve() {
long long int n;
cin ... | partial | 17 | 18 | [{"idx": 0, "reason": "wrong_answer", "expected": "void*\nvoid**\nerrtype\nvoid**\nerrtype\nerrtype\nerrtype\nerrtype\nerrtype", "got": "void*\nvoid**\nvoid*\nvoid**\nvoid**\nvoid**\nvoid*\nvoid********\nvoid********"}] | codeforces | B | |
374 | 925_E. May Holidays | It's May in Flatland, and there are m days in this month. Despite the fact that May Holidays are canceled long time ago, employees of some software company still have a habit of taking short or long vacations in May.
Of course, not all managers of the company like this. There are n employees in the company that form a... | cpp | #include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int B = 250;
int p1 = 5000000, p2 = 0;
char buf[5000005], wbuf[5000005];
int gc() {
if (p1 >= 5000000) fread(buf, 1, 5000000, stdin), p1 = 0;
return buf[p1++];
}
int rd() {
int x = 0, ch = gc();
while (!isdigit(ch)) ch = gc();
while (... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_zs9lpglh/tmpufw23crv.cpp: In function ‘void dfs(int)’:
/tmp/sbx_zs9lpglh/tmpufw23crv.cpp:28:3: error: reference to ‘size’ is ambiguous
28 | size[x] = 1;
| ^~~~
In file included from /usr/include/c++/11/string:54,
from /usr/include/c++/11/bits/locale_classes.h:40,
... | [] | codeforces | E |
377 | 9_E. Interesting Graph and Apples | Hexadecimal likes drawing. She has drawn many graphs already, both directed and not. Recently she has started to work on a still-life «interesting graph and apples». An undirected graph is called interesting, if each of its vertices belongs to one cycle only — a funny ring — and does not belong to any other cycles. A f... | cpp | #include <bits/stdc++.h>
using namespace std;
void fun() {}
long long int __gcd(long long int a, long long int b) {
if (b == 0) return a;
return __gcd(b, a % b);
}
long long int poww(long long int a, long long int b, long long int md) {
if (b < 0) return 0;
if (a == 0) return 0;
long long int res = 1;
while... | compile_error | 0 | 0 | COMPILE_ERROR:/tmp/sbx_fgadzf_y/tmpcxv63cfr.cpp:28:22: error: reference to ‘size’ is ambiguous
28 | long long int degree[size];
| ^~~~
In file included from /usr/include/c++/11/string:54,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include... | [] | codeforces | E |
385 | simple-prime-factorization | Surya loves to play with primes. One day, he asked his friend don to print any number in the form of multiple of prime factors. Help don in solving the problem.
Input
The first line will contain an integer t (1 ≤ t ≤ 10^6) denoting number of test case.
For each test case, you will be given an integer n (2 ≤ n ≤ 10^6... | python2 | def CheckIfProbablyPrime(x):
return (2 << x - 2) % x
def primes(n):
primfac = []
d = 2
while d*d <= n:
while (n % d) == 0:
primfac.append(d)
n //= d
d += 1
if n > 1:
primfac.append(n)
return primfac
for i in range(input()):
a=input()
s=""
s1=""
... | partial | 1 | 2 | [{"idx": 1, "reason": "timeout"}] | hackerearth | UNKNOWN | |
387 | p02548 AtCoder Beginner Contest 179 - A x B + C | Given is a positive integer N. How many tuples (A,B,C) of positive integers satisfy A \times B + C = N?
Constraints
* 2 \leq N \leq 10^6
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
N
Output
Print the answer.
Examples
Input
3
Output
3
Input
100
... | python2 | import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')
# (int(x) ... | all_fail | 0 | 3 | [{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_pbig5g2m/tmpbmta7h3u.py\", line 12, in <module>\n n = int(input())\nValueError: invalid literal for int() with base 10: ''\n", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": ... | atcoder | UNKNOWN | |
387 | p02548 AtCoder Beginner Contest 179 - A x B + C | Given is a positive integer N. How many tuples (A,B,C) of positive integers satisfy A \times B + C = N?
Constraints
* 2 \leq N \leq 10^6
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
N
Output
Print the answer.
Examples
Input
3
Output
3
Input
100
... | python2 | # inp.readline()
# int(inp.readline())
# out.write()
# raw_input()
# map(int,raw_input().split())
# map(int,inp.readline().split())
# for _ in xrange(input()):
# print "Case #"+str(_+1)+": "+
if __name__ == "__main__":
from sys import stdin as inp, stdout as out,setrecursionlimit as srl
from collections import... | partial | 2 | 3 | [{"idx": 2, "reason": "timeout"}] | atcoder | UNKNOWN | |
392 | p03225 Tenka1 Programmer Contest - Equilateral | There are some coins in the xy-plane. The positions of the coins are represented by a grid of characters with H rows and W columns. If the character at the i-th row and j-th column, s_{ij}, is `#`, there is one coin at point (i,j); if that character is `.`, there is no coin at point (i,j). There are no other coins in t... | cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 305;
int N, M, ps[3*MAXN][3*MAXN], ps2[3*MAXN][3*MAXN];
char arr[MAXN][MAXN];
vector<pair<int, int>> utama[2*MAXN], lain[2*MAXN];
int main() {
ios::sync_with_stdio(0); cin.tie(0);
cin >> N >> M;
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; ... | partial | 1 | 3 | [{"idx": 1, "reason": "wrong_answer", "expected": "870", "got": "572"}, {"idx": 2, "reason": "wrong_answer", "expected": "3", "got": "0"}] | atcoder | UNKNOWN | |
392 | p03225 Tenka1 Programmer Contest - Equilateral | There are some coins in the xy-plane. The positions of the coins are represented by a grid of characters with H rows and W columns. If the character at the i-th row and j-th column, s_{ij}, is `#`, there is one coin at point (i,j); if that character is `.`, there is no coin at point (i,j). There are no other coins in t... | java | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
public class Main{
static void solve(){
int h = ni(), w=ni();
int H = w+h+1, W=h+w+1;
int[][] cnt = new int[H][W];
int[][] cnty=new int[H][W];
long ans =0;
Map<Integer, List<Integer> > ytox=new ... | partial | 1 | 3 | [{"idx": 1, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.lang.StringIndexOutOfBoundsException: String index out of range: 14\n\tat java.base/java.lang.StringLatin1.charAt(StringLatin1.java:48)\n\tat java.base/java.lang.String.cha", "stdout_tail": ""}, {"idx": 2, "reason": "runtime_er... | atcoder | UNKNOWN |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.