Datasets:
anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
# ARC058D - いろはちゃんとマス目 / Iroha and a Grid (ABC042D)
def get_fact(lim):
# compute a toble of factorials (1-idx)
fact = [1] * (lim + 1)
x = 1
for i in range(1, lim + 1):
x = (x * i) % MOD
fact[i] = x
return fact
def get_inv(lim):
# compute a toble of inverse factorials (1-idx)
... |
import java.util.Scanner;
public class Main {
public static class Combination {
long[] factorial;
int maxN;
long Module;
public Combination(final int maxN, final long Module) {
this.maxN = maxN;
factorial = new long[maxN];
this.Module = Module... |
import java.io.*;
import java.util.*;
public class cf1428_Div1Div2_c {
public static void main(String[] args) throws IOException {
FastScanner in = new FastScanner();
int tc = in.nextInt();
for ( ; tc > 0; tc--) {
char[] line = in.next().toCharArray();
int n = line.length;
... | #include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
int A = 0, B = 0;
int ans = 0, del = 0, cnt = 0;
for (char x : s) {
if (x == 'A')
cnt++, A++;
else {
if (cnt) {
... |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
StringBuilder sb = new StringBuilder();
int i = 1;
while (i <= 11) {
if (n > Math.pow(26, i)) {
n ... | #include<bits/stdc++.h>
using namespace std;
int main(){
string ans="";
long long int n;
cin>>n;
n=n-1;
while(n>-1){
ans=ans+char('a'+(n%26));
n=n/26-1;
}
reverse(ans.begin(),ans.end());
cout<<ans;
return 0;
} |
#include <bits/stdc++.h>
using namespace std;
template <typename T>
T pow(T a, T e, T mod) {
if (!e) return 1;
T x = pow(a, e / 2, mod);
x = x * x % mod;
return (e & 1) ? x * a % mod : x;
}
template <typename T, typename exp_t, T (*multiply)(T, T)>
T pow(T a, exp_t e) {
if (!e) return 1;
T x = pow<T, exp_t,... | import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;
import static java.util.Arrays.fill;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.u... |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
int[] memo;
ArrayList<Integer> lh, lr;
void run() {
for (;;) {
int n = sc.nextInt();
if (n == 0) return;
lh = new ArrayList<Integer>();
lr = new ArrayList<Integer>(... | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <sstream>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <stack>
#include <list>
using namespace std;
#define INF 100000000
typedef long long int lli;
typedef pair<int,int> P;
bool ... |
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
struct Ques {
int l, r, id;
};
int n, bl, m, all, cnt;
int a[N];
Ques q[N];
deque<int> w[N];
deque<int> s[N];
int v[N], ans[N], ok[N];
int cmp(Ques a, Ques b) {
return a.l / bl < b.l / bl || (a.l / bl == b.l / bl && a.r < b.r);
}
int main() {
sca... | import java.io.*;
import java.util.*;
import java.math.BigInteger.*;
import static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;
import java.util.Collections.*;
// https://netbeans.org/kb/73/java/editor-codereference_ru.html#display
//<editor-fold defaultstate="collapsed" de... |
#include <bits/stdc++.h>
using namespace std;
string memo[51][51];
string max(string const& a, string const& b) {
if(a == "invalid") {
return b;
}
if(a.size() > b.size()) {
return a;
} else if(a.size() < b.size()) {
return b;
} else {
return (a < b ? b : a);
}
}... | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.... |
def main():
while True:
n, c = map(int, input().split())
if n == 0:break
music = []
for _ in range(n):
line = list(map(int, input().split()))
add_panel = sum([2 ** i * line[i] for i in range(16)])
music.append(add_panel)
hand = []
for _ in range(c):
line = list(map... | import java.util.Arrays;
import java.util.Scanner;
//Beat Panel
public class Main{
void run(){
Scanner sc = new Scanner(System.in);
int[][] dp = new int[2][1<<16];
for(;;){
int n = sc.nextInt(), c = sc.nextInt();
if(n+c==0)break;
int[] a = new int[n], b = new int[c];
for(int i=0;i<n;i++)for(int j=0... |
val = 3337867500
n,a,d = map(int, input().split())
print(val * a, val * d) | #include <bits/stdc++.h>
const int ntf = 1e9;
const unsigned long long ft = 368131125ll;
const unsigned long long vl = 12000000000ll;
int n, a, d;
int main() {
scanf(" %d %d %d", &n, &a, &d);
printf("%llu %llu\n", ft * a % ntf * vl + 1, ft * d % ntf * vl);
return 0;
}
|
#include <cstdio>
int main()
{
int prev = 0;
int curr;
int sum = 0;
int n;
scanf("%d", &n);
int i;
for (i = 0; i < n; i++) {
scanf("%d", &curr);
if (curr - prev > 0)
sum += curr - prev;
prev = curr;
}
printf("%d\n", sum);
return 0;
} | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int N = in.nextInt();
int[] h = new int[N];
for (int i = 0; i < N; i++) {
h[i] = in.nextInt();
}
int ans = 0;
while (true) {
int left = -1;
for (int i = 0; i < N; i++) {
... |
import java.io.*;
import java.util.*;
public class CF99A {
private static BufferedReader br;
private static StringTokenizer st;
private static PrintWriter pw;
// private static Timer t = new Timer();
public CF99A() throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
pw = new Pri... | #include <bits/stdc++.h>
using namespace std;
template <typename a>
void SWAP(a &b, a &c) {
a d = b;
b = c;
c = d;
}
long long power(long long a, long long b) {
long long result = 1;
while (b) {
if (b & 1) result = a * result;
a *= a;
b >>= 1;
}
return result;
}
long long gcd(long long a, long... |
#include <bits/stdc++.h>
using namespace std;
const int maxn = (1 << 22) + 5;
int n, m, a[maxn];
bool vis[maxn], f[maxn];
void dfs(int x) {
if (vis[x]) return;
vis[x] = 1;
if (f[x]) dfs(x ^ ((1 << n) - 1));
for (int i = 0; i < n; i++)
if (x & (1 << i)) dfs(x ^ (1 << i));
}
int main() {
scanf("%d%d", &n, &... | import java.util.* ;
import java.io.* ;
public class F
{
static int mod = (int) (1e9+7);
static InputReader in;
static PrintWriter out;
static boolean[] vis;
static boolean[] arr;
static void dfs(int i, int n, int mask){
vis[i] = true;
for(int j = 0; j < n; j++){
... |
#include <bits/stdc++.h>
long long int array[300010], power[300030];
int cmp(const void *a, const void *b) {
return (*(long long int *)a) - (*(long long int *)b);
}
int main() {
long long int i, j, ans, mod, val, val2, n;
mod = 1000000007;
ans = 0;
power[0] = 1;
scanf("%lld", &n);
for (i = 0; i < n; i++) ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.concurrent.ThreadLocalRandom;
public class Main3 {
static long mod = 1000000007L;
public static void main(String[] ... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class E630 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(Syst... | x1, y1, x2, y2 = map(int, input().split())
x2 -= x1
y2 -= y1
x1 = 0
y1 = 0
odd_x = (x2 - x1) // 2 + 1 - (1 if x1 % 2 == 0 and x2 % 2 == 0 else 0)
odd_y = (y2 - y1) // 2 + 1 - (1 if y1 % 2 == 0 and y2 % 2 == 0 else 0)
even_x = (x2 - x1) // 2 + 1 - (1 if x1 % 2 == 1 and x2 % 2 == 1 else 0)
even_y = (y2 - y1) // 2 + 1 - ... |
import java.util.*;
import java.io.*;
public class a {
public static void main(String[] args) throws IOException
{
input.init(System.in);
int n = input.nextInt();
int[] nums = {110,50,80,170,20,200};
if(n<=2)
System.out.println(-1);
else if(n==3)
System.out.println(210);
else
... | n = input()
if n < 3:
print -1
else:
print 10 ** (n-1) + (-1*10 ** (n-1))%210
|
/*
Author: Greg Zborovsky
User: angeredgecko
Date/Time: 2021-02-27 18:58:04.698474
*/
#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(vector<T> vec, ostream &fout = cout)
{
fout << "[";
for (auto const &val : vec)
{
fout << val << " ";
}
fout << "]";
}
template... | T = int(input())
while T >= 1:
n = int(input())
arr = list(map(int,input().split()))
check = True ; pis = 0
for i in range(n):
pis += arr[i]
if pis < i*(i+1)//2:
check = False
break
if check == True: print("YES")
else: print("NO")
T -= 1 |
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int k[3], t[3];
int n;
long long c[N], tm[N], d[N];
int main() {
for (int i = 0; i < 3; i++) scanf("%d", &k[i]);
for (int i = 0; i < 3; i++) scanf("%d", &t[i]);
scanf("%d", &n);
long long ret = 0;
for (int i = 0; i < n; i++) scanf("%I64d", &c... | k1,k2,k3 = [int(x) for x in raw_input().split()]
t1,t2,t3 = [int(x) for x in raw_input().split()]
n = int(raw_input())
q1 = [int(x) for x in raw_input().split()]
q2 = []
i = 0
for x in q1:
if i < k1:
q2.append(x+t1)
else:
q2.append(max(x, q2[i-k1])+t1)
i += 1
q3 = []
i = 0
for x in q2:
if i < k2:
q3.append(x... |
#include <bits/stdc++.h>
using namespace std;
template <class T, class T1>
int chkmin(T &x, const T1 &y) {
return x > y ? x = y, 1 : 0;
}
template <class T, class T1>
int chkmax(T &x, const T1 &y) {
return x < y ? x = y, 1 : 0;
}
const int MAXN = 3042;
const int mod = 998244353;
string s, t;
void read() { cin >> s ... | 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.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... |
while 1:
n, m = map(int, raw_input().split())
if n == m == 0:
break
S = map(int, raw_input().split())
left = 0; right = sum(S)+2
def check(mid):
if 1+mid <= S[0]:
return 10**9
cnt = 0; l = 1
target = S[n-1] - mid
for i in xrange(n-1):
w... | #include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <utility>
using namespace std;
#define sz size()
#define rep(i, a, n) for(int i = (a);i < (n);i++)
#define lep(i, a, n) for(int i = (... |
f = [0, 4, 8, -1, 16, -10, 4, -12, -48, 26, -44, 15, -16, -4, -4, -1]
jly = 998244353
t = 0
x = [0, 0, 0, 24, 4, 240, 204, 1316, 2988, 6720, 26200, 50248, 174280, 436904, 1140888, 3436404]
n = int(input())
for i in range(16, n + 1):
t = 0
for j in range(0, 16):
t = (t + f[(i - j - 1) & 15] * x[j]) % jly... | #include <bits/stdc++.h>
constexpr int P = 998244353;
constexpr int A[16] = {0, 0, 0, 24, 4, 240,
204, 1316, 2988, 6720, 26200, 50248,
174280, 436904, 1140888, 3436404};
constexpr int F[16] = {P - 1, P - 4, P - 4, P - 16, 15, P - 44, 2... |
n = int(input())
a = []
for _ in range(n):
xy = list(map(int, input().split()))
a.append(xy)
midpoint = {}
for i in range(n):
for j in range(i + 1, n):
x1, y1 = a[i][0], a[i][1]
x2, y2 = a[j][0], a[j][1]
dx = x2 + x1
dy = y2 + y1
midpoint[(dx / 2, dy / 2)] = midpoint.... | #include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int maxn = 2005;
pair<long long, long long> poi[maxn];
map<pair<long long, long long>, int> M;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) cin >> poi[i].first >> poi[i].second... |
if __name__ == "__main__":
n = int(input())
a = set(map(lambda x: int(x), input().split()))
m = int(input())
b = set(map(lambda x: int(x), input().split()))
for elem in sorted(a.intersection(b)):
print(elem)
| #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI acos(-1)
#define Mod (int)1000000007
#define INFTY (int)INT_MAX
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++)
#define All(vec) vec.begin(), vec.end... |
#include <bits/stdc++.h>
using namespace std;
int n, x;
long long smn, smx = 0;
set<pair<int, int> > mset;
pair<int, int> g;
void summin(pair<int, int> a[]) {
mset.insert(pair<int, int>(n - 1, 0));
for (int i = 0; i < n; ++i) {
g = *mset.lower_bound(pair<int, int>(a[i].second, 0));
mset.erase(g);
smn +=... | 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.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, skc = 998244353;
vector<int> v[N], edge[N];
void add(int x, int y, int z) {
v[x].push_back(y);
edge[x].push_back(z);
}
void upd(int &x, int y) { x = (x + y) % skc; }
int f[N][3], n;
struct node {
int id, vl;
friend bool operator<(node A, node... | import java.util.*;
import java.io.*;
public class Main {
public static void main(String args[]) {new Main().run();}
FastReader in = new FastReader();
PrintWriter out = new PrintWriter(System.out);
void run(){
work();
out.flush();
}
long mod=998244353;
long gcd(long a,long b) {
return b==0?a:gcd(b,a%b);
... |
//package Working_with_Ranges.Segment_Tree.Chef_Force;
import java.util.Scanner;
public class Cleaning {
static long[][] st, lazy;
static long INF = 1000_000_000_000L;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
while (T--... | #include <bits/stdc++.h>
#define fir first
#define sec second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<P,P> Q;
const int inf1 = 1e9+9;
const ll inf2 = 1e16+9;
const int maxx = 1e9+9;
const int maxn = 1e6+9;
int n,ar[maxn];
int l[maxn],r[maxn],t[maxn];
bool judge(int p) {
... |
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;
public class TaskE {
StringTokenizer st;
BufferedReader in;
PrintWriter out;
long res00, res01, res10, res11;
public static void main(String[] args) throws IOException {
TaskE taskA = new TaskE();
taskA.op... | #include <bits/stdc++.h>
using namespace std;
long long getll() {
long long x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = -1;
ch = getchar();
}
while (ch <= '9' && ch >= '0') {
x = x * 10 + ch - '0';
ch = getchar();
}
return f * x;
}
struct Mat {
lo... |
i=int(input())
l=set(map(int,input().split()))
print('YES' if i == len(l) else 'NO') | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
set<int> S;
int N;cin>>N;
int buf;
for(int i=0; i<N; i++){
cin>>buf;
S.insert(buf);
}
cout<<(S.size()==N? "YES\n": "NO\n");
} |
# #
# author : samars_diary #
# 12-09-2020 │ 19:22:08 #
# #
import sys, os.path
if(os.path.exists('input.txt')):
sys.stdin = open('input.txt',"r")
#sys.stdout = open('output.txt',"w")
sys.setrecursionlimit(10 ** 5)
def i(): return sys.stdin... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class codeforces670div2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0)
{
int n=s.nextInt();
int a[]=new int[n];
... |
import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
while(t--!=0)
{
int n=sc.nextInt(),o=0,e=0;
boolean f=false;
for(int i=0;i<n;i++)
... | #include <bits/stdc++.h>
using namespace std;
void tetris(int k) {
int odd = 0;
int even = 0;
for (int i = 1; i <= k; i++) {
int j;
cin >> j;
if (j & 1) {
odd++;
} else {
even++;
}
}
if (odd == k || even == k) {
cout << "YES" << '\n';
} else {
cout << "NO" << '\n';
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int i = 1;
if (n % 2) {
cout << 1 << ' ';
i++;
}
for (; i <= n; i += 2) {
cout << i + 1 << ' ' << i << ' ';
}
return 0;
}
|
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
public class ProblemC_46 {
final boolean ONLINE_JUDGE=System.getProperty("ONLINE_JUDGE")!=null;
BufferedReader in;
PrintWriter out;
StringTokenizer tok=new StringTokenizer("");
void init() throws FileNotFoundException{
if (ONLINE_JUDGE)... |
#include<bits/stdc++.h>
using namespace std;
signed main(){
int x,n,a;
int p[1000]={};
cin>>x>>n;
for(int i=0;i<n;i++){
cin>>a;
p[a]=1;
}
int num=0,ab=x;
for(int i=-10000;i<=10000;i++){
if(ab>abs(x-i)&&p[i]==0){
ab=abs(x-i);
num=i;
}
}
cout<<num<<"\n";
} | x,n=map(int,input().split())
p=list(map(int,input().split()))
ans=0
for i in range(1,102):
if i not in p:
if abs(x-i)<abs(x-ans):
ans=i
print(ans) |
//package round76;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class D {
Scanner in;
String INPUT = "5 6";
PrintWriter out;
static int MOD = 1000000007;
void solve()
{
int L = ni();
int R = ni();
String[] t = {" ", " B", " R", " W", " Y", "BW", "BY", "RW", "RY... | #include <bits/stdc++.h>
using namespace std;
long long iMatrixMultiply(long long multiplicant1, long long multiplicant2,
long long ivalue = (long long)1023123123 *
(long long)1023123123) {
return (multiplicant1 * multiplicant2) % ivalue;
}
long l... |
import java.util.Scanner;
public class Move_Brackets {
public static void main(String [] args) {
Scanner sc=new Scanner (System.in);
int t=sc.nextInt();
for(int j=0;j<t;j++) {
int n=sc.nextInt();
String s=sc.next();
int b=0;
int res=0;
int min=0;
for(int i=0;i<n;i++) {
if(s.charAt(i)=='(... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int tc;
cin >> tc;
while (tc--) {
string s;
int n, x = 0, y = 0;
bool vis[55];
memset(vis, false, sizeof(vis));
vector<int> f;
cin >> n >> s;
for (int i = 0; i < n; i++) {
if (s[i]... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
ArrayList<Date> date=new A... | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl
//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegi... |
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib.cpp"
#endif
#define fio ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define TC long long T_;cin>>T_;while(T_--)
#define rar(a,n) int n;cin >> n;int a[n];for(int i_=0;i_<n;i_++)cin >> a[i_];
#define rark(a,n,k) int n,k;cin >> n >> k;int a[n];for(int i_=0;i_<... | import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
public class D1{
private static Reader sc = new Reader();
private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));... |
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <ctime>
#include <deque>... | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.... |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 400005;
char str[maxn];
int n, odd, even, buf[256];
vector<char> odd_list, cur_list;
int main() {
scanf("%d", &n);
scanf("%s", str + 1);
for (int i = 1; i <= n; i++) ++buf[str[i]];
for (int i = 0; i < 256; i++) {
if (buf[i] & 1) odd_list.push_ba... | import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.util.Map.Entry;
import static java.lang.Math.*;
public class Main extends PrintWriter {
List<String> solve(final int n, final int m, final int k, int[] cnt) {
int odd = 0;
for (int c = 0; c < k; c++) {
if ... |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
//Color the Map
public class Main{
class R{
List<L> l;
boolean u;
int color, id;
public R(int id) {
this.id = id;
l = new ArrayList<L>();
u = false;
... | def main():
while 1:
N = int(input())
if N == 0:
break
D = {}
G = [set() for i in range(N)]
cur = 0
K = []
PS = []
for i in range(N):
ps = []
s = input()
if s in D:
k = D[s]
el... |
#include <iostream>
using namespace std;
int main() {
int m; cin >> m;
for (int prob = 0; prob < m; prob++) {
int depo; cin >> depo;
int year; cin >> year;
int n; cin >> n;
int ans = 0;
for (int method = 0; method < n; method++) {
int hukuri;
double nennri;
int tesuu;
cin >> huku... | def c(a):
global y,r,d
for _ in range(y):a+=int(a*r)-d
return a
def s(a):
global y,r,d
b=0
for _ in range(y):
b+=int(a*r)
a-=d
return a+b
for _ in range(int(input())):
m=0
a=int(input());y=int(input())
for _ in range(int(input())):
b,r,d=map(float,input(... |
#include <bits/stdc++.h>
using namespace std;
int n, a[100005], b[100005], cnt[100005], i, tmp, in[100005], go[100005];
vector<int> v[100005];
int main() {
cin >> n;
for (i = 1; i <= n; i++) {
cnt[i] = 0;
in[i] = 0;
go[i] = 0;
cin >> a[i];
}
for (i = 1; i <= n; i++) {
cin >> b[i];
if (b[... | import java.io.*;
public class two {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
int N = Integer.parseInt(line);
int[] objectsType = new int[N+1];
int[]... |
import java.io.*;
import java.util.*;
public class CF {
class Pers {
int id, left, right, v;
Pers(int id, int left, int v, int right) {
this.id = id;
this.left = left;
this.right = right;
this.v = v;
}
}
int MAX = (int) (3 * 1e5 + 11);
class SegTree {
int n;
int[] sum;
int[] maxPref;
... | import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = 'x' in file.mode or 'r' not in file.mode
self.write = self.buffer.write if self.wri... |
import java.util.*;
import java.lang.*;
import java.io.*;
public class GFG {
public static void main (String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer();
int Q = Integer.parseInt(br.readLine());
for(int q = 0; q < Q... | #include <bits/stdc++.h>
#pragma GCC optimize "O3"
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 4000;
int huh[N + 5];
int ile[N + 5], pt;
void solve() {
memset(ile, 0, sizeof(ile));
int n;
cin >> n;
pt = N;
while (n) {
ile[pt] += n / huh[pt];
... |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.Objects;
import java.nio.charset.C... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (long long i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (long long i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se s... |
code-embed-v3-data
Replay training data for the paper Does Execution-Verified Near-Miss Training Teach Code Embeddings to Prefer Working Code? A Negative Result (preprint, doi:10.5281/zenodo.24402953). Code, configs and the full research log: https://github.com/divakantpandey/code-embed-v3
These are the replay rows that both the near-miss pilot (code-embed-v3-150m-ft-behaviour) and the replay-only control (code-embed-v3-150m-ft-control) trained on. The near-miss data is in code-embed-v3-synth.
Contents
| Folder | Columns | What it is |
|---|---|---|
mix_v1/ |
anchor, positive |
Audited pairs, up to 30,000 rows per source (--max-rows 30000), plus dev/ held-out rows |
mix_v1_gte_mined/ |
anchor, positive, negative_1..negative_4 |
The same pairs with four hard negatives mined by gte-modernbert-base, capped at 25,000 rows per source |
Each source is a datasets folder saved with save_to_disk (Arrow). manifest.json lists rows, license and upstream per source; contamination_report.json lists every removed row.
| Source | Upstream | License | mix_v1 rows |
mix_v1_gte_mined rows |
|---|---|---|---|---|
| cornstack_python | nomic-ai/cornstack-python-v1 | Apache-2.0 | 29,470 | 21,468 |
| cornstack_java | nomic-ai/cornstack-java-v1 | Apache-2.0 | 29,489 | 20,246 |
| cornstack_javascript | nomic-ai/cornstack-javascript-v1 | Apache-2.0 | 29,287 | 19,643 |
| cornstack_go | nomic-ai/cornstack-go-v1 | Apache-2.0 | 29,460 | 23,966 |
| cornstack_php | nomic-ai/cornstack-php-v1 | Apache-2.0 | 29,420 | 18,831 |
| cornstack_ruby | nomic-ai/cornstack-ruby-v1 | Apache-2.0 | 28,580 | 21,315 |
| cornstack_python_c2t | nomic-ai/cornstack-python-v1 (code to text) | Apache-2.0 | 29,470 | 21,551 |
| cornstack_java_c2t | nomic-ai/cornstack-java-v1 (code to text) | Apache-2.0 | 29,489 | 18,467 |
| cornstack_javascript_c2t | nomic-ai/cornstack-javascript-v1 (code to text) | Apache-2.0 | 29,287 | 19,454 |
| code_contests_xlang | deepmind/code_contests | CC BY 4.0 | 28,966 | 649 |
| swe_smith | SWE-bench/SWE-smith | MIT | 29,500 | 23,272 |
| spider | xlangai/spider | CC BY-SA 4.0 | 6,479 | 6,463 |
The pilot and control trained on mix_v1_gte_mined minus rows that share an anchor with a dev row: 213,648 replay rows in total.
Decontamination
Every row (anchor, positive and each negative) was checked with exact and MinHash-LSH matching (5-gram, threshold 0.8) against all MTEB(Code, v1), CoIR and CoREB(v1) tasks, ExecRetrieval and the seven CoQuIR subsets. Matches were removed.
Loading
from huggingface_hub import snapshot_download
from datasets import load_from_disk
path = snapshot_download("divakantpandey/code-embed-v3-data", repo_type="dataset",
allow_patterns=["mix_v1_gte_mined/cornstack_python/*"])
ds = load_from_disk(f"{path}/mix_v1_gte_mined/cornstack_python")
License
Each source keeps its upstream license (table above). The Spider rows are CC BY-SA 4.0 and must stay under that license when redistributed.
Citation
@misc{pandey2026nearmiss,
title = {Does Execution-Verified Near-Miss Training Teach Code Embeddings to Prefer Working Code? A Negative Result},
author = {Pandey, Divakant},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.24402953},
url = {https://doi.org/10.5281/zenodo.24402953}
}
- Downloads last month
- 33