Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main(void)
{
int n;
int i,sum,c,d;
int j;
while(1)
{
scanf("%d",&n);
if(n==0)break;
c = 0;
for(i=1;i<=n/2+1;i++){
d = 0;
sum = 0;
j = i;
while(sum<n)
{
sum += j;
j++;
d++;
}
if(sum == n && d > 1)c++;
}
printf("%d\n",c);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356465/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356465/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main(){
int n, i, j, All=196471 , Y, M, D, sum;
scanf("%d",&n);
for(j = 0 ,sum = 0 ; j < n ; j++ , sum = 0){
scanf("%d %d %d",&Y, &M, &D);
for(i = 1 ; i < Y ; i++){
if(i % 3 == 0){
sum+=200;
}else{
sum+=195;
}
}
for(i = 1 ; i < M ; i++){
if(Y % 3 ==... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356508/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356508/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int n;
int memo[1000][11][21]={0};
int main(void){
int i,j,k,t,co=0,max;
for(i=1;i<=999;i++){
for(j=1;j<=10;j++){
if(i%3==0||j%2!=0)max=20;
else max =19;
for(k=1;k<=max;k++){
memo[i][j][k]=co;
co++;
}
}
}
scanf("%d",&n);
for(t=0;t<n;t++){
scanf("%d%d%d",&i,... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356566/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356566/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@memo = dso_local local_unn... |
#include <stdio.h>
#define MAX 1000
int main() {
int i, j, n, Y[MAX], M[MAX], D[MAX], sum[MAX];
scanf("%d",&n);
for(i=0; i<n; i++) {
sum[i]=0;
scanf("%d %d %d", &Y[i], &M[i], &D[i]);
for(j=Y[i]+1; j<1000; j++) {
if(j%3 == 0) sum[i] += 200;
else sum[i] += 195;
}
if(Y[i]%3 == 0) {
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356630/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356630/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpT, *szpFpA;
#endif
// 計算
long long
fCalc(
int piMax // <I> 最大値
, int piMod // <I> 余り
)
{
int i;
// 余り有無
if (piMod < 1) {
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356674/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356674/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unn... |
#include <stdio.h>
#include <math.h>
static double g_cos_pi_3, g_sin_pi_3;
static int g_flag = 1;
void koch_curve(double x1, double y1, double x2, double y2, int n) {
double x, y, ax, ay, bx, by, cx, cy;
if (!n) {
if (g_flag) {
printf("%.8lf %.8lf\n", x1, y1);
g_flag = 0;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356717/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356717/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@g_flag = internal unnamed_... |
#include <stdio.h>
#include <math.h>
typedef struct{
double x;
double y;
}P;
void kock(int, P, P);
int main(){
int n;
P p1 = {0.0, 0.0}, p2 = {100.0, 0.0};
scanf("%d", &n);
printf("%f %f\n", p1.x, p1.y);
kock(n, p1, p2);
printf("%f %f\n", p2.x, p2.y);
return 0;
}
void kock(int n, P p1, P p2)... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356760/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356760/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <math.h>
typedef struct{
double x;
double y;
}XY;
void kock(int,XY,XY);
int main(){
int n;
XY P1,P2;
P1.x=0.0;
P1.y=0.0;
P2.x=100.0;
P2.y=0.0;
scanf("%d",&n);
printf("%.8f %.8f\n",P1.x,P1.y);
kock(n,P1,P2);
printf("%.8f %.8f\n",P2.x,P2.y);
return 0;
}
void ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356803/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356803/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <math.h>
typedef struct{
double x;
double y;
} xy;
void kock(int, xy , xy );
int main() {
int i,n;
xy p1 = {0.0,0.0};
xy p2 = {100.0,0.0};
scanf("%d",&n);
printf("%f %f\n",p1.x,p1.y);
kock(n,p1,p2);
printf("%f %f\n",p2.x,p2.y);
return 0;
}
void kock(int n, xy p1, x... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356847/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356847/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
typedef struct{
double x, y;
} Point;
void kock(int, Point, Point);
int main(){
int n;
Point p1, p2;
p1.x = 0;
p1.y = 0;
p2.x = 100;
p2.y = 0;
scanf("%d", &n);
printf("%.8f %.8f\n", p1.x, p1.y);
kock(n, p1, p2);
printf("%.8f %.8f\n", p2.x, p2.y);
return 0;
}
void k... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356890/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356890/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<math.h>
typedef struct{
double x;
double y;
}Point;
void fractal(int,Point,Point);
int main(){
Point p1,p2;
int n;
p1.x = 0;
p2.x = 100;
p1.y = 0;
p2.y = 0;
scanf("%d",&n);
printf("%f %f\n",p1.x,p1.y);
fractal(n,p1,p2);
printf("%f %f\n",p2.x,p2.y);
return 0;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356933/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356933/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<math.h>
typedef struct Point{
double x, y;
}Point;
void koch(int n, Point a, Point b){
if(n == 0) return;
Point s, t, u;
double th = M_PI * 60.0 / 180.0;
s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
t.x = (1.0 * a.x + 2.0 * b.x) / ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_356991/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_356991/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <math.h>
//double x[0][0]=0.0;
//double y=100.0;
int Koch(double x1,double y1,double x3,double y3,int n){
double x2=0,y2=0;
double px=0,py=0,tx=0,ty=0;
if(n==0){
printf("%f %f\n",x3,y3);
return 0;
}else{
px=((x3-x1)/3)+x1;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357033/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357033/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <math.h>
typedef struct { double x, y; } R;
void koch(int n, R a, R b) {
if (n == 0) return;
R i, j, k;
double th = M_PI * 60.0 / 180.0;
i.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
i.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
j.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
j.y = (1.0 * a.y + 2.0 * b.y) / 3... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357084/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357084/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <math.h>
struct Point {
double x,y;
};
void kohho(int n,struct Point p1,struct Point p2);
int main(){
struct Point p1={0.0,0.0};
struct Point p2={100.0,0.0};
int n;
scanf("%d",&n);
printf("%.8f %.8f\n",p1.x,p1.y);
kohho(n,p1,p2);
printf("%.8f %.8f\n",p2.x,p2.y);
re... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357127/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357127/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <math.h>
typedef struct {
double x;
double y;
}point;
void kock(int, point, point);
int main() {
point p1 = {0, 0}, p2 = {100, 0};
int n;
scanf("%d", &n);
printf("%lf %lf\n", p1.x, p1.y);
kock(n, p1, p2);
printf("%lf %lf\n", p2.x, p2.y);
return 0;
}
void kock(in... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357170/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357170/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef struct{
double x;
double y;
}point;
void kock(int d,point p1,point p2)
{
if(d==0) return;
point s,t,u;
s.x = (2 * p1.x + 1 * p2.x) / 3;
s.y = (2 * p1.y + 1 * p2.y) / 3;
t.x = (1 * p1.x + 2 * p2.x) / 3;
t.y = (1 * p1.y + 2 *... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357220/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357220/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<math.h>
struct Point{
double x,y;
};
void koch(int n,struct Point a,struct Point b){
if(n==0)return;
struct Point s,t,u;
double th=M_PI*60.0/180.0;
s.x=(2.0*a.x+1.0*b.x)/3.0;
s.y=(2.0*a.y+1.0*b.y)/3.0;
t.x=(1.0*a.x+2.0*b.x)/3.0;
t.y=(1.0*a.y+2.0*b.y)/3.0;
u.x=(t.x-s.x)*co... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357264/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357264/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
/* ALDS1_5_C: Koch Curve */
/* 20181119 */
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#define rad M_PI / 3
typedef struct {
double x;
double y;
} Point;
void cochCurve(Point start_p, Point end_p, int n);
Point rotatePoint(Point p1, Point p3);
void printPoint(Po... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<string.h>
#include<math.h>
typedef struct{
double x;
double y;
}point;
double ppp(int n,double leftx,double lefty,double rightx,double righty){
if(n!=0){
double temp[3][2];
temp[0][0]=(2*leftx+rightx)/3;
temp[0][1]=(2*lefty+righty)/3;
temp[2][0]=(... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357372/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357372/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
// Aizu 1609: Look for the Winner!
// 2017.9.21 bal4u@uu
#include <stdio.h>
#include <string.h>
int f[30];
int c[102];
int main()
{
int n, x, i, k, x1, x2, max1, max2;
char b[5];
while (scanf("%d", &n) && n) {
for (i = 0; i < n; i++) scanf("%s", b), c[i] = *b - 'A';
memset(f, 0, sizeof(f));
max1 = max2 = ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357415/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357415/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main()
{
unsigned long long int x, ans;
scanf("%lld", &x);
ans = x / 11;
ans *= 2;
x %= 11;
if (x > 0)
{
if (x <= 6)
ans++;
else
ans += 2;
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357466/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357466/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main(void){
long long x;
scanf("%lld",&x);
if(x%11==0)printf("%lld\n",(x/11)*2);
else if(x%11<7)printf("%lld\n",(x/11)*2+1);
else printf("%lld\n",(x/11)*2+2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357509/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357509/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
int get_int2(int *a1, int *a2) {
scanf("%d %d", a1, a2);
return 0;
}
// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size)... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357552/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357552/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<stdlib.h>
int comp(const void *a,const void *b){return *(int*)b - *(int*)a;}
int main(){
int k,n,i,j,l,s=0,ans=0;
int a[200000]={};
scanf("%d %d", &n, &k);
for(i=0;i<n;i++){
scanf("%d", &l);
if(a[l]==0)s++;
a[l]++;
}
qsort(a,sizeof(a)/sizeof(int),sizeof(int),comp);
f... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357596/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357596/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<stdlib.h>
int max(int x,int y);
int min(int x,int y);
int main(void){
int N;
scanf("%d",&N);
char *S=(char *)malloc(sizeof(char)*N);
scanf("%s",S);
int a=0,i,j,tmp;
for(i=1;i<N;i++){
tmp=1;
for(j=0;i+j<N;j++){
if(S[j]==S[j+i])
a=max(a,min(i,tmp++));
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357639/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357639/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main(void){
int n,k[100],i,j;
char s[101];
while(1){
scanf("%d",&n);
if(!n)
break;
for(i=0;i<n;i++)
scanf("%d",&k[i]);
scanf("%s",s);
for(i=0;s[i];i++){
for(j=0;j<k[i%n];j++){
if(s[i]=='A')
s[i]='z';
else if(s[i]=='a')
s[i]='Z';
else
s[i]--;
}
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357682/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main(void)
{
int n, cut;
int card_A[50], card_B[50], ans[10];
int i, j;
int p, c;
while(1)
{
scanf(" %d %d", &n, &cut);
if(n==0&&cut==0)
{
break;
}
else
{
for(i=0; i<=n-1; i++)
{
card_A[i]=n-i;
}
while(cut--)
{
scanf(" %d ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357732/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357732/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main(void)
{
int n,r;
int p = 0;
int c = 0;
int a[50] = {0};
int b[50] = {0};
int i,j;
while(1){
scanf("%d %d",&n,&r);
if(n == 0 &&r == 0)
break;
for(i = 0;i < n;i++){
a[i] = n - i;
}
for(i = 0;i < r;i++){
scanf("%d %d",&p,&c);
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357776/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357776/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main(void){
int n,r,p,c,i,j,k;
while(1){
scanf("%d %d",&n,&r);
if(n == 0) break;
int huda[51],pre[51];
for(i = 0;i < n;i++){
huda[i] = i;
pre[i] = i;
}
for(j = 0;j < r;j++){
scanf("%d %d",&p,&c);
for(k = n - p - c + 1;k < n - c;k++) huda[k] = pre[k + c];
for(k = n... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357833/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357833/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t
#define BUF_SIZE 30
// size: specify sizeof(str)
int get_str(char *str, int size) {
if(!fgets(str, size, stdin)) return -1;
return 0;
}
int get_int(void) {
int num;
#ifdef BUF_SIZE
char line[BUF_SIZE];
if(!fgets(... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357884/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357884/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.list = type { ptr, ... |
#include<stdio.h>
#include<string.h>
int LCS(char*,char*);
int max(int,int);
int main(){
int i;
int q;
char X[1000],Y[1000];
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%s%s",X,Y);
printf("%d\n",LCS(X,Y));
}
return 0;
}
int LCS(char *X,char *Y){
int i,j;
int N[strlen(X)+1][strlen(Y)+1];
f... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_357927/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_357927/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main()
{
char c;
int d;
scanf("%c",&c);
scanf("%d",&d);
if(c=='a'||c=='h'){
if(d==1||d==8){
printf("3\n");
}
else{
printf("5\n");
}
}
else{
if(d==1||d==8){
printf("5\n");
}
else{... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr cons... |
#include <stdio.h>
#include <math.h>
#include <string.h>
#define MAX 1001
int LCS(char *, char *);
int main()
{
int i, j, q;
char X[MAX], Y[MAX];
scanf("%d", &q);
for( i = 0 ; i < q ; i++ ){
scanf("%s%s", X, Y);
printf("%d\n", LCS(X, Y));
}
return 0;
}
int LCS(char X[], char Y[])
{
int i,... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358049/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358049/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
void insertion_sort(int x[],int N)
{
int j,temp,i;
for(i=1;i<N;i++)
{
temp=x[i];
for(j=i-1;j>=0&&temp<x[j];j--)
{
x[j+1]=x[j];
}
x[j+1]=temp;
}
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3581/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3581/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr co... |
#include<stdio.h>
#include<string.h>
#define max(a,b) ((a)>(b) ? (a):(b))
int dp[1001][1001];
int lcs(char *s,char *t){
int i,j,ls,lt;
ls=strlen(s);
lt=strlen(t);
for(i=0;i<ls;i++){
for(j=0;j<lt;j++){
if(s[i]==t[j]) dp[i+1][j+1]=dp[i][j]+1;
else dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1]);
}
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358142/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358142/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dp = dso_local local_unnam... |
#include<stdio.h>
int main()
{
int T,n,k,i,j,max,z;
int a[107],ans[10007]={0};
scanf("%d",&T);
while(T--)
{
scanf("%d%d",&n,&k);
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=1,max=1000000007;i<=k;i++){
for(j=0,z=0;j<n-1;j++)if(a[j]<a[j+1]){
a[j]++;ans[... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35820/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35820/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr ... |
#include <stdio.h>
#include <string.h>
#define N 1050
int max(int a, int b);
int lcs();
char a[N], b[N];
int main()
{
int n, i;
scanf("%d\n", &n);
for ( i = 0; i < n; i++ ){
fgets(a, N, stdin);
fgets(b, N, stdin);
printf("%d\n", lcs());
}
return 0;
}
int lcs()
{
int c[N+1][N+1];
int aasiz... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358250/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358250/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
//(最長共通部分列)
#include <stdio.h>
#include <string.h>
#define N 1000
/*typedef struct{
struct Node begin, end;
}Node;
int size(char D){
Node N;
if(N.begin>N.end) return N.begin-N.end;
else return N.end-N.begin;
}*/
//static const int N=1000;
int max(int a, int b){
if(a<b) return b;
else return a;
}
int... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358294/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358294/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <string.h>
char X[1002] , Y[1002];
int C[1001][1001], cnt;
int LCSLength() {
int m = strlen(X), n = strlen(Y), i, j;
cnt = 0;
for (i = 0; i <= m; i++) {
C[i][0] = 0;
}
for (i = 0; i <= n; i++) {
C[0][i] = 0;
}
for (i = 1; i <= m; i... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358337/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358337/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@X = dso_local global [1002... |
#include<stdio.h>
#include<string.h>
static const int N=1000;
int lcs(char X[],char Y[])
{
int i,j;
int c[N+1][N+1];
int m=strlen(X)+1;
int n=strlen(Y)+1;
int maxl=0;
for(i=1;i<m;i++)
{
for(j=1;j<n;j++)
{
if(X[i-1]==Y[j-1])
{
c[i][j]=c[i-1][j-1]+1;
}
else
{
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358388/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358388/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<string.h>
#define LEN 1000
int lsc(char *, char *);
int main(){
int q, ans;
int i;
char x[LEN] = {}, y[LEN] = {};
scanf("%d", &q);
for(i=0;i<q;i++){
scanf("%s", x);
scanf("%s", y);
//printf("%s\n%s\n", x, y);
ans = lsc(x, y);
printf("%d\n", ans);
}
return... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358438/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358438/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <stdlib.h>
// Longest Common Subsequence
int c[1005][1005];
int LCS(char *x, int m, char *y, int n)
{
int i, j;
for (i = 0; i <= m; i++) c[i][0] = 0;
for (j = 0; j <= n; j++) c[0][j] = 0;
for (i = 1; i <= m; i++) for (j = 1; j <= n; j++) {
if (x[i-1] == y[j-1]... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358489/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358489/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@c = dso_local local_unname... |
#include <stdio.h>
#include <string.h>
void SetX(int n, const char* src, char* dst)
{
if(n<10)
while(*src != '\0')
{
if(*src == 'X')*dst='0'+n;
else *dst=*src;
src++; dst++;
}
*dst='\0';
}
void Reverse(char* s, int len)
{
int i;
char tmp;
for(i=0; i<len/2; i++)
{
tmp = s[i];
s[i] = s[len-i-1];
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358531/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358531/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main()
{
int a, b, c, d, e, ave;
scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
if (a < 40 ){
a = 40;
}
if (b < 40){
b = 40;
}
if (c < 40){
c = 40;
}
if (d < 40){
d = 40;
}
if (e < 40){
e = 40;
}
ave = (a + b + c + d + e) / 5;
printf("%d\n",... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358582/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358582/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main () {
int a, b, c, d, e, average=0;
scanf("%d%d%d%d%d", &a ,&b, &c, &d, &e);
if(a < 40) a = 40;
if(b < 40) b = 40;
if(c < 40) c = 40;
if(d < 40) d = 40;
if(e < 40) e = 40;
average = (a + b + c + d + e) / 5;
printf("%d\n", average);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358625/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358625/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main(void) {
int sum = 0;
int i, score;
for(i = 0; i < 5; i++) {
scanf("%d", &score);
if(score >= 40) sum += score;
else sum += 40;
}
printf("%d\n", sum / 5);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358669/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358669/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main(){
int i, a, b = 0;
for (i = 0; i < 5; i++){
scanf("%d", &a);
if (a < 40) a = 40;
b += a;
}
printf("%d\n", b / 5);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358711/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358711/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#define MIN(A,B) \
( (A) < (B) ? (A) : (B) )
#define ABS(X) \
( (X) < 0 ? -(X) : (X) )
/** Application main entry point. */
int main (
int argc,
char * argv[ ]
)
{
int i, j;
for ( ; ; )
{
int d[ 20 ];
int sum = 0, res;
int n;
scanf ( "%d", &n );
if ( !n ) ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358755/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358755/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main()
{
int x,y,z;
scanf("%d%d%d",&x,&y,&z);
if(x>=y&&y>=z)
{
printf("%d",x-z);
}
else if(x>=z&&z>=y)
{
printf("%d",x-y);
}
else if(y>=z&&z>=x)
{
printf("%d",y-x);
}
else if(y>=x&&x>=z)
{
printf("%d",y-z);
}
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358812/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358812/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int max(int a,int b){
if(a>b)return a;
return b;
}
int min(int a,int b){
if(a<b)return a;
return b;
}
int compare_char(char *a,char *b){
return strcmp(a,b);
}
int intsort(const void *a, const void *b){
return *(int*)b - *(int*)a;
/*qsor... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358863/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358863/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
int min(int x, int y)
{
if (x <= y) return x;
else return y;
}
int main()
{
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
int ans = min( abs(a-b) + abs(b-c), min( abs(b-c) + abs(c-a), abs(c-a) + abs(a-b))... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358906/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358906/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main()
{
int a,b,c,cost=0;
int max,min,mid;
scanf("%d%d%d",&a,&b,&c);
min = (a<b)?a:b;
min=(min<c)?min:c;
max = (a>b)?a:b;
max=(max>c)?max:c;
if(a!=max && a!= min) mid =a;
else if(b!=max && b!= min) mid =b;
else mid = c;
//printf("%d %d %d\n",max,mid,min);
printf ("%d\n",((mid-min)+(max-mid))... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358964/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358964/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{int a1,a2,a3,cost[6],ans=100000,i;
scanf("%d %d %d",&a1,&a2,&a3);
cost[0]=abs(a1-a2)+abs(a2-a3);
cost[1]=abs(a1-a3)+abs(a2-a3);
cost[2]=abs(a2-a1)+abs(a1-a3);
cost[3]=abs(a2-a3)+abs(a1-a3);
cost[4]=abs(a... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359006/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359006/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#define max(a,b) (a > b ? a : b)
#define min(a,b) (a < b ? a : b)
int main(void) {
int a1, a2, a3;
scanf("%d %d %d", &a1, &a2, &a3);
printf("%d", max(a1,max(a2,a3))-min(a1,min(a2,a3)));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359071/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a>=b&&b>=c){printf("%d",a-c);}
else if(a>=c&&c>=b){printf("%d",a-b);}
else if(b>=c&&c>=a){printf("%d",b-a);}
else if(b>=a&&a>=c){printf("%d",b-c);}
else if(c>=b&&b>=a){printf("%d",c-a);}
else if(c>=a&&a>=b){printf("%d",c-b);}
else
r... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359129/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359129/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
int main( void )
{
int H ,W ;
scanf( "%d %d\n" ,&H ,&W ) ;
char weather ;
int i ,j ;
for( i = 0 ; i < H ; ++i )
{
scanf( "%c" ,&weather ) ;
int out = -1 ;
for( j = 1 ; j <= W ; ++j )
{
if( weather == 'c' )
{
out = 0 ;
}
else
{
++out ;
if( out < 1 )
{
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359172/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359172/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main()
{
int n,k,i,j,d,m;
int count = 0;
int a[101] = {0};
scanf("%d %d",&n,&k);
for(i=0; i<k; i++)
{
scanf("%d", &d);
for(j=0; j<d; j++)
{
scanf("%d",&m);
a[m-1] ++ ;
}
}
for(i=0; i<n; i++){
if(a[i] == 0)
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359222/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359222/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void ReadFirstInput(int *snukesNumber, int *candyTypes)
{
//printf("Enter the number of Snukes and SnackTypes: \n");
scanf("%d %d", snukesNumber, candyTypes);
}
void CountTricks(int *snukesArray, int *snukesNumber)
{
int counter = 0;
for(... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359266/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359266/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main(){
int n,k;
scanf("%d %d", &n,&k);
int d[k];
int a[n];
int i,j,tmp, cnt = 0;
for(i = 0; i < n; i++){
a[i] = 0;
}
for(i = 0; i < k; i++){
scanf("%d", &d[i]);
for(j = 0; j < d[i]; j++){
scanf("%d", &tmp);
a[tmp... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359316/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359316/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main()
{
long long int n,i,j,k,m,l,r,f,t,b,q,c=0,p,x,y;
// char s1[200000],s2[200000];
scanf("%lld",&t);
for(j=1;j<=t;j++)
{
char s,X,Y;
long long int a=0,b=0;
scanf("%lld%lld\n",&x,&y);
p=la... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35936/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35936/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr ... |
#include<stdio.h>
int f[1005]={0};
int d[1005]={0};
int main(){
int n,k;
scanf("%d%d",&n,&k);
for(int i=1;i<=k;i++){
scanf("%d",&d[i]);
for(int j=1;j<=d[i];j++){
int x;
scanf("%d",&x);
f[x]=1;
}
}
int ans=0;
for(int i=1;i<=n;i++) if(!f[i]) ans++;
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359402/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359402/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@f = dso_local local_unname... |
#include<stdio.h>
int main(){
int n, k;
scanf("%d %d", &n, &k);
int snk[n];
for(int i = 0;i < n;i++){
snk[i] = 0;
}
int a, d;
for(int i = 0;i < k;i++){
scanf("%d", &d);
for(int j = 0;j < d;j++){
scanf("%d", &a);
snk[a - 1]++;
}
}
int cnt = 0;
for(int i = 0;i < n... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359453/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359453/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
int main(void) {
int n, k, i, j, d, a;
int sunuke[100] = {};
scanf("%d %d", &n, &k);
for (i = 0; i < k; i++) { // kこのお菓子に対して
scanf("%d", &d); // d人がそのお菓子をもつ
for (j = 0; j < d; j++) {
scanf("%d", &a);
sunuke[a - 1]++;
// printf("%dが持ってる\n", a);
}
}
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359497/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359497/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#define ll long long
int main(){
int n , k;
scanf("%d%d",&n,&k);
int d[k];
int a[k][n];
for(int i = 0; i < k; i++){
scanf("%d",&d[i]);
for(int j = 0; j < d[i]; j++)
scanf("%d",&a[i][j]);
}
int b[n + 1];
for(int i = 0; i <= n; i++)
b[i... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359547/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359547/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int key){
NodePointer cur = nil->next;
while(cur!=nil&&cur->key!=key){
cur=cur->next;
}
return ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359590/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359590/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
//リスト用構造体定義
struct Node {
struct Node *prev;
struct Node *next;
int key;
};
//リストの先頭を定義
struct Node *nil;
//命令を行う関数の宣言
struct Node* listSearch(int);
void init();
void insert(int);
void deleteNode(struct Node*);
void deleteFirst();
void deleteLast();
void ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359640/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359640/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { ptr, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node *NodePointer;
NodePointer nil;
NodePointer listSearch(int key){
NodePointer n;
n = nil->next;
while( n != nil && n->key != key){
n = n->next;
}
ret... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359684/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359684/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include <stdio.h> // printf(), scanf()
#include <stdlib.h> // exit()
#include <string.h> // strcmp()
#define N_LIST 1000020
typedef struct list_tbl
{
int key;
int prev;
int next;
} list_t;
int lineno;
list_t list[N_LIST];
int ix;
int head;
int tail;
int room;
void
cleanup(int ecode)
{
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359734/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359734/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.list_tbl = type { i... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LEN 13
typedef struct _list list;
struct _list {
int key;
struct _list *prev, *next;
} ;
void insert(int key);
void delete(int key);
void deleteFirst(void);
void deleteLast(void);
void print_list(void);
void destroy_list(void);
list *head, *ta... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct._list = type { i32,... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100000
typedef struct List{
int key;
struct List *next;
struct List *prev;
}LIST;
LIST *list;
LIST* search(int key){
LIST *x = list->next;
while(x!=list && x->key!=key) x = x->next;
return x;
}
void init(){
list = (LIST *)malloc(s... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359828/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359828/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.List = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct node{
int num;
struct node *prev;
struct node *next;
} List;
List *list;
List *insert(List *head, int x)
{
List *p;
if((p=(List *)malloc(sizeof(List))) == NULL){
printf("malloc error\n");
exit(1);
}
p->num = x;
p->next=head;
if(head ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359879/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359879/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include <stdio.h>
#include <string.h>
#define MAX_LIST_NUM 2000001
typedef struct ST_LinkedList LinkedList_t;
struct ST_LinkedList{
int key_value; /* Key Value */
LinkedList_t *before; /* Before Point */
LinkedList_t *next; /* Next Point */
}LINKED_LIST;
LinkedList_t tLink... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359921/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359921/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.ST_LinkedList = typ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
int key;
struct node *next;
struct node *prev;
};
typedef struct node *NodePointer;
NodePointer nil;
NodePointer listSearch(int key){
NodePointer cur = nil->next;
while(cur != nil && cur->key != key){
cur = cur->next;
}
return cu... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359972/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359972/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
//削除する要素が存在するかチェック
NodePointer listSearch(int key){
NodePointer n,dummy = malloc(sizeof(struct node));
dummy->key = -1;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360020/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360020/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int key){
NodePointer i;
for(i=nil->next; i!=nil ;i=i->next) {
if(i->key == key) return i;
}
return nil;
}
v... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360064/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360064/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include <stdio.h>
int a[2000010];
int l,r;
int main(){
int n;
scanf("%d",&n);
while(n--){
char s[99];
scanf("%s",s);
if(s[0]=='i')scanf("%d",a+r++);
else if(s[6]==0){
int t;
scanf("%d",&t);
for(int idx=r-1;idx>=l;idx--)if(a[idx]==t){
a[idx]=-1;
break;
}
}else if(s[6]=='F')while(a[--r... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360107/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360107/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * Node;
Node NIL;
Node Search(int key){
Node x;
for(x=NIL;x->next!=NIL;x=x->next){
if(x->next->key==key)return x->next;
}
return NULL;
}
void in(){
NIL= ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360150/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360150/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
struct node *prev;
struct node *next;
int key;
};
typedef struct node *NodePointer;
NodePointer nil;
NodePointer search(int);
void insert(int);
void deleteN(NodePointer);
void delete(int);
void deleteF(void);
void deleteL(void);
int main(){
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360194/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360194/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { ptr, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
//NodePointer listSearch(int key){
// /* your code */
//}
void init(){
nil = malloc(sizeof(struct node));
nil->next = nil;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360237/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360237/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int);
void init(void);
void printList(void);
void deleteNode(NodePointer);
void deleteFirst(void);
void deleteLast(vo... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360280/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360280/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct node {
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int key) {
NodePointer cur=nil->next;
while(cur!=nil && key!=cur->key){
cur = cur->next;
}
return cur;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360323/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360323/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct node {
int value;
struct node* next;
struct node* prev;
} node_t;
int n, num = 0;
node_t* head = NULL;
node_t* last = NULL;
node_t* current = NULL;
node_t* searchList(int);
node_t* createNode(int);
void insertToList(node_t*);
void deleteNode(... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360367/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360367/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int key){
NodePointer n;
for(n=nil->next; n!=nil; n=n->next){
if(key==n->key)return n;
}
return... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360417/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360417/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int);
void init(void);
void printList(void);
void deleteNode(NodePointer);
void deleteLast(void);
void d... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360460/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360460/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int num;
struct node *next;
struct node *back;
}Node;
Node *nil;
void insert(int x){
Node *newNode;
newNode = (Node *)malloc(sizeof(Node));
newNode->num = x;
newNode->next = nil->next;
newNode->back = nil;
newNode->next->back = newNode;
n... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360503/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360503/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct Node{
int key;
struct Node *next,*prev;
};
struct Node *nil;
struct Node *listSearch(int key){
struct Node *cur = nil->next;
while(cur!=nil && cur->key!=key){cur=cur->next;}
return cur;
}
void init(){
nil=(struct Node *)malloc(sizeof(struct No... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360547/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360547/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include <stdio.h>
int main(){
int t,n,i,a[100],Max,Min;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
Max = Min = a[1] - a[0];
for(i=1;i<n-1;i++){
if(Max < a[i+1]-a[i])Max = a[i+1]-a[i];
if(Min > a[i+1]-a[i])Min = a[i+1]-a[i];
}
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360590/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360590/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include<stdio.h>
#define MAX 100001
#define NIL -1
struct node{
int parent;
int left;
int right;
};
struct node T[MAX];
int Dpt[MAX];
void setDepth(int, int);
void printch(int);
int main(){
int n;
int id, k;
int ch, l;
int root;
int i, j;
scanf("%d", &n);
for(i=0; i<n; i++)
T[i].parent =... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360640/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360640/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ... |
#include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node{
int p;
int l;
int r;
};
struct Node T[MAX];
int n,D[MAX];
void pri(int u){
int i,c;
printf("node %d: ",u);
printf("parent = %d, ",T[u].p);
printf("depth = %d, ",D[u]);
if(T[u].p==NIL)printf("root, ");
else if(T[u].l==NIL)printf("leaf,... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360684/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360684/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include <stdio.h>
#define MAX 100000
#define NIL -1
struct Node{
int parent,right,left;
};
int getDepth(struct Node *,int);
int main(){
int n,m;
int id,c,tmp;
int depth[MAX];
struct Node TREE[MAX];
scanf("%d",&n);
for(int i = 0;i < n;i++){
TREE[i].parent = TREE[i].left = TREE[i... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360734/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360734/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include<stdio.h>
#define MAX 1000000
#define NO -1
typedef struct Node{
int p;
int l;
int r;
}S;
S tree[MAX];
int Depth(int);
void Out(int);
int main(){
int a,b,i,j,l,m,n;
scanf("%d",&n);
for(i = 0 ; i < n ; i++){
tree[i].p=tree[i].r=tree[i].l=NO;
}
for(i = 0 ; i < n ; i++){
scanf("%d%d",&... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360792/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360792/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node{
int l, p, r;
};
struct Node T[MAX];
int n;
int getDepth(int u){
int d=0, i=0;
while(1){
if(T[u].p == NIL)break;
d++;
u=T[u].p;
}
return d;
}
void print(int u){
printf("node %d: parent = %d, depth = %d, ",u,T[u].p,getDepth(u... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360857/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360857/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include <stdio.h>
#define N 100001
void degree(int);
int depth(int);
struct Node {
int parent;
int left;
int right;
};
struct Node nodes[N];
int counter = 0;
int main(void) {
int i, j, n, m, new_node, child, left, right;
scanf("%d", &n);
for(i = 0; i < n; i++) {
nodes[i].parent = -1;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360914/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360914/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include<stdio.h>
#include<stdlib.h>
int *c[100000];
int *k,*p,*d;
int main(){
int n,i,j,id;
scanf("%d",&n);
k = (int *)malloc(n * sizeof(int));
d = (int *)malloc(n * sizeof(int));
p = (int *)malloc(n * sizeof(int));
for(i = 0;i < n;i++){
k[i] = 0;
d[i] = 0;
p[i] = -1;
}
for(i = 0;i < ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360972/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360972/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
#include <stdio.h>
#include <string.h>
#define N 100000
int child[N][20];
int parent[N];
int depth[N];
int k[N];
int root;
void pr(int id,char str[][20]){
int type,i;
if(parent[id] == -1) type = 0;
else if(k[id] > 0) type = 1;
else if(k[id] == 0) type = 2;
printf("node %d: parent = %d, depth = %d, %s... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361021/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361021/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@parent = dso_local local_u... |
#include<stdio.h>
#define N 100000
typedef struct {
int parent;
int left;
int right;
} Node;
Node Tree[N];
int getDepth(int x) {
int depth = 1;
if(Tree[x].parent == -1) return 0;
depth += getDepth(Tree[x].parent);
return depth;
}
int main() {
int i, j, n, m, k, p;
int number, depth, child;
sca... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361072/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361072/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include<stdio.h>
#define MAX 100005
#define NIL -1
typedef struct{
int parent,left,right;
}Node;
Node T[MAX];
int n, D[MAX];
int getDepth(int);
void print(int);
int child[MAX];
int main(void){
int i, j;
int degree,vertex;
scanf("%d", &n);
for (i = 0;i < n;i++ ) {
T[i].parent = NIL;
T... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361115/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361115/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ... |
#include <stdio.h>
#include <ctype.h>
int par[100000];
void init(int);
int dep(int);
int inp(void);
char *p;
char in[1500000];
int tree[100000][15],idx[100000];
int main(){
int n,i,j,id,k,c;
fread(in,sizeof(in),1,stdin);
p = in;
n = inp(); init(n);
for(i = 0 ; i < n ; i++){
id ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361159/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361159/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@in = dso_local global [150... |
/* A Rooted Trees */
#include<stdio.h>
#define NIL -1
int main(){
int i, j;
int n, id, k;
int temp2;
int d=0;
scanf("%d",&n);
int C[n][3]; /*C[n][0]=P, C[n][1]=L(left child), C[n][2]=R(right sibling)*/
/* initialize C[n][3]*/
for(i=0;i<n;i++){
for(j=0;j<3;j++){
C[i][j]=NIL;
}
}
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361201/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361201/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_add... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.