Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STRMAX 127
void xtonumstr( char str[STRMAX], int keta, int i );
int whichmax( int val1, int val2, char num1[STRMAX], char num2[STRMAX] );
int makeans( char tpans[STRMAX], char num1[STRMAX], char num2[STRMAX], int keta );
int issame( char tpans[STRMAX]... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358539/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358539/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>
int main(){
int i, test[5], sum = 0, average = 0;
for(i = 0;i < 5;i++){
scanf("%d", &test[i]);
if(test[i] < 40){
test[i] = 40;
}
sum += test[i];
}
average = round((double)sum / 5);
printf("%d\n", average);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358632/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358632/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... |
/*?????????(Average)*/
#include <stdio.h>
int main(){
int A, B, C, D, E, average;
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 + ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358676/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358676/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 = 0,i;
for (i = 0; i < 5; i++){
scanf("%d", &a);
if (a < 40)
b += 40;
else
b += a;
}
printf("%d\n", b/5);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358719/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358719/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 main(void) {
int member_num;
int members[20];
int i_max;
int i,j;
int a,b,now,min;
while(1) {
scanf("%d",&member_num);
if(member_num==0)break;
for(i=0;i<member_num;i++) {
scanf("%d",&members[i]);
}
i_max=1<<(member_num-1);
min=0x7fffffff;
for(i=0;i<i_ma... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358762/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358762/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 main(void)
{
int a[3],i,j,k,ans,tmp;
for ( i = 0; i < 3; i++)
{
scanf("%d",a+i);
}
ans=a[0]+a[1]+a[2];
for ( i = 0; i < 3; i++)
{
for ( j = 0; j < 3; j++)
{
if(j!=i)
{
k=3-i-j;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358827/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358827/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 cmp( const void *p, const void *q ) {
return *(int*)p - *(int*)q;
}
int main(){
int A[3];
scanf("%d%d%d", &A[0], &A[1], &A[2]);
qsort(A, 3, sizeof(int), cmp);
int cost = 0;
for (int i = 1; i < 3; ++i){
cost += A[i] - A[i-1];
}
pri... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358870/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358870/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){
// Your code here!
int a,b,c,d;
scanf("%d%d%d\n",&a,&b,&c);
while(a>b||b>c){
if(a>b){
d=a;
a=b;
b=d;
}
if(b>c){
d=b;
b=c;
c=d;
}
}
//printf("%d %d ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358913/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358913/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,ar[3],highest=0,i;
scanf("%d%d%d",&a,&b,&c);
if(a>=b){
ar[0]=a-b;
}
else
ar[0]=b-a;
if(a>=c){
ar[1]=a-c;
}
else
ar[1]=c-a;
if(b>=c){
ar[2]=b-c;
}
else
ar[2]=c-b;
for(i=0;i<3;i++){
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_358971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_358971/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 a[3];
int min, max;
scanf("%d%d%d", &a[0], &a[1], &a[2]);
min = 100;
max = 2;
int i;
for (i = 0; i < 3; i++) {
if (min > a[i]) {
min = a[i];
}
if (max < a[i]) {
max = a[i];
}
}
int result;
result = max - min;
printf("%d\n", resul... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359020/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359020/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[3], i, buff;
scanf("%d %d %d", &a[0], &a[1], &a[2]);
int task[6];
int dis[3];//1: 2-1 ,2: 3-1, 3: 3-2
if(a[0] >= a[1]){
dis[0] = a[0] -a[1];
}else{
dis[0] = a[1] - a[0];
}
if(a[2] >= a[0]){
dis[1] = a[2] -a[0];
}else{
dis[1] = a[0] - a[2];
}
if(a[1] >... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359079/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359079/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,j,c,n,k,a[101][101];
char map[101][101];
scanf("%d %d",&n,&k);
for(i=0;i<n;i++){
scanf("%s",map[i]);
for(j=0;j<k;j++)a[i][j]=-1;
}
for(i=0;i<n;i++){
c=-1;
for(j=0;j<k;j++){
if(map[i][j]=='c')c=0;
else if(c>=0)++c;
a[i][j]=c;
}
}
for(i=0;i<n;i++){
for(j=0;... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359136/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359136/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... |
// AOJ 2917: Pray
// 2019.2.17 bal4u
#include <stdio.h>
#include <stdlib.h>
int main()
{
int N, a, ans;
ans = 0;
scanf("%d", &N);
while (N--) {
scanf("%d", &a);
if ((a & 1) == 0) ans++;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359187/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359187/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>
char s[100005];
int main(){
int t, x, y, i, a, b, c, d, flag1, flag2;
scanf("%d", &t);
while(t--){
flag1 = 0;
flag2 = 0;
scanf("%d%d", &x, &y);
a = 0;
b = 0;
c = 0;
d = 0;
scanf("\n");
scanf("%s", s);
for(i = 0; s[i] != '\0'; i++){
if(s[i] == 'U')
a++;
else if(s[i] ==... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35923/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35923/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 main(void)
{
int n,k,d,temp;
scanf("%d",&n);
scanf("%d",&k);
int a[n];
for(int i=0;i<n;i++)
{
a[i] = 0;
}
for(int i=0;i<k;i++)
{
scanf("%d",&d);
for(int j=0;j<d;j++)
{
scanf("%d",&temp);
a[temp-1] = 1;... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359280/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359280/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>
#include<string.h>
int main() {
int i, j, k;
int m, n;
int f = 0;
int g = 0;
int x[110] = {0};
int a, b, c, d;
scanf("%d %d", &n, &k);
for (i = 0;i < k;i++) {
scanf("%d", &d);
for (j = 0;j < d;j++) {
scanf("%d", &g);
x[g]++;
}
}
for (i = 1;i < n+1;i++) {
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359323/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359323/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 <ctype.h>
#include <string.h>
int main(int argc, char *argv[]){
int People, Kind;
scanf("%d %d", &People, &Kind);
int i,j;
int victim[1001];
int tmp, index;
int gaisha = 0;
for(i = 0; i < 1001; i++){
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359367/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359367/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;
int k;
int d[102];
int a[102][102];
int ans[102];
int i;
int j;
int cnt;
scanf("%d %d\n", &n, &k);
for (i=1; i<=n; i++)
{
ans[i] = 1;
}
for (i=1; i<=n; i++)
{
scanf("%d\n", &d[i]);
for (j=0; j<d[i]; j++)
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359417/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359417/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 i, ii, iii;
int N, K;
int tmp;
int d;
int c[100] = {};
int a =0 ;
scanf("%d %d", &N, &K);
for (i = 0; i < K; i++)
{
scanf("%d", &d);
for (ii = 0; ii < d; ii++)
{
scanf("%d ", &tmp);
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359460/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359460/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(void){
int n,k,x,y,i,j;
int a[101];
for(i=0;i<101;i++){
a[i]=0;
}
scanf("%d %d",&n,&k);
for(j=0;j<k;j++){
scanf("%d",&x);
for(i=0;i<x;i++){
scanf("%d",&y);
a[y]=1;
}
}
x=0;
for(i=1;i<=n;i++)
if(a[i]==0) x++;
printf("... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359503/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359503/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, a;
int i, j;
int cnt[102];
for (i = 0; i < n; i++)
cnt[i] = 0;
for (i = 0; i < k; i++)
{
scanf("%d", &d);
for (j = 0; j < d; j++)
{
scanf("%d", &a);
cnt[a - 1]++;
}
}
int ans = 0;
for (i = 0; i < n; i++)
if (cnt[i] == 0... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359554/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359554/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{
int key;
struct node *next, *prev;
};
typedef struct node *NP;
NP listsearch(int);
void init();
void printlist();
void delenode(NP);
void delfirst();
void dellast();
void delkey(int);
void insert(int);
NP nil;
int main(){
int key, n, i... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359598/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359598/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;
void init(){
nil = malloc(sizeof(struct node));
nil->next = nil;
nil->prev = nil;
}
NodePointer search(int key){
NodePo... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359648/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359648/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 cur = nil->next;
while(cur!=nil&&cur->key!=key){
cur = cur->next;
}
retur... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359691/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359691/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>
#include <stdbool.h>
typedef struct _Node Node;
struct _Node {
int val;
Node *prev;
Node *next;
};
Node *dummy;
Node *newNode(int _val, Node *_prev, Node *_next) {
Node *m = (Node*)malloc(sizeof(Node));
m->val = _val;... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359741/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359741/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,*pre;
};
struct Node *n;
struct Node* lserch(int key){
struct Node *cur=n->next;
while(cur != n && cur->key != key){
cur=cur->next;
}
return cur;
}
void init() {
n=(struct Node *)malloc(sizeof(struct... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359792/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359792/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 r,w,i,j,y=0,f,g,h;
scanf("%d",&r);
int a[r];
char b[12];
for(i=0;i<r;i++){
scanf("%s %d",b,&w);
if(b[0]=='i'){
a[i]=w;
}
else if(b[6]=='F'){
i-=2;r-=2;
}
else if(b[6]=='L'){
i--;r--;y++;
}
else{
i--;r--;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359835/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359835/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 <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
int key;
struct Node *prev, *next;
};
struct Node *nil;
void init() {
nil = (struct Node *)malloc(sizeof(struct Node));
nil->next = nil;
nil->prev = nil;
}
void insert(int key) {
struct Node *x = (struct Node *)malloc... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359886/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359886/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 *prev;
struct Node *next;
} Node;
Node *sentinel;
int size;
Node* search(int keyValue) {
Node *target = sentinel->next;
while (target != sentinel && target->value != keyValue) {
target... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_359929/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_359929/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<math.h>
#include<string.h>
#include<stdlib.h>
#include<limits.h>
#define SORT(a,n) qsort(a,n,sizeof(int),intcmp)
#define s(n) scanf("%d",&n)
#define sc(n) scanf("%c",&n)
#define sl(n) scanf("%I64d",&n)
#define sf(n) ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_35998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_35998/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 <stdlib.h>
#include <string.h>
/*
insert x: 連結リストの先頭にキー x を持つ要素を継ぎ足す
delete x: キー x を持つ最初の要素を連結リストから削除する
deleteFirst: リストの先頭の要素を削除する
deleteLast: リストの末尾の要素を削除する
*/
struct doubleList{
struct doubleList *prev;
int value;
struct doubleList *next;
};
typedef struct doubleList DL;
vo... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360028/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360028/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.doubleList = type {... |
#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 a;
for(a=nil->next;a!=nil;a=a->next){
if(a->key==key)return a;
}
return NULL;
}... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360071/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 key;
struct _Node *next, *prev;
} Node;
Node *nil;
Node *listSearch(int key)
{
Node *cur = nil->next;
while (cur != nil && cur->key != key)
{
cur = cur->next;
}
return cur;
}
void init(void)
{
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360114/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360114/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>
#define N 2000000
struct node{
unsigned int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int key);
void deleteNode(NodePointer t);
void deleteFirst();
void deleteLast();
void de... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360158/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360158/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{
int key;
struct node *next;
struct node *prev;
};
struct node *NIL;
void init(void){
NIL = (struct node *)malloc(sizeof(struct node));
NIL->next = NIL;
NIL->prev = NIL;
}
void insert(int key){
struct node *x;
x = (struct node*)mal... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360200/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360200/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){
/* your code */
NodePointer x;
x = nil->next;
while(x != nil && x->key != key){
x = x-... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360244/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360244/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 cur = nil->next;
while(cur != nil && cur->key != key){
cur = ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360288/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360288/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){
/* your code */
NodePointer cur=nil->next;
while(cur!=nil && cur->key!=key){
cur=cur->ne... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360330/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360330/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 key;
struct _Node *next, *prev;
} Node;
Node *nil;
Node* listSearch(int key) {
Node *cur = nil->next;
while(cur != nil && cur->key != key) {
cur = cur->next;
}
return cur;
}
void init(void) {
nil = (Node *)malloc... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360381/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360381/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){
/* your code */
NodePointer x;
x = nil->next;
while(x != nil && x->key != key){
x = x... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360424/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360424/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 serch = nil->next;
while(serch != nil && serch->key != key){
serch = serch->n... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360468/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360468/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* List(int key){
struct Node *cur=nil->next;
while(cur!=nil && cur->key!=key){
cur=cur->next;
}
return cur;
}
void in(){
nil=(struct Node*)malloc(sizeof(struct Node)... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360510/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360510/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 N;
NodePointer listSearch(int key);
void initialize();
void print();
void deleteNode(NodePointer a);
void deleteFirst();
void deleteLast();
void de... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360554/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360554/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(D,S) \
{ \
if ( (S) > (D) ) \
{ \
(D) = (S); \
} \
}
#define MIN(D,S) \
{ \
if ( (S) < (D) ) \
{ \
(D) = (S); \
} \
}
/** Application main entry point. */
int main (
int argc,
char * argv[ ]
)
{
int n;
scanf ( "%d", &n );
wh... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360598/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360598/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 100005
#define NIL -1
typedef struct{
int p;
int l;
int r;
}node;
node T[MAX];
int n,D[MAX];
void disp(int u){
int i,c;
printf("node %d: parent = %d, depth = %d, ",u,T[u].p,D[u]);
if(T[u].p==NIL)printf("root, ");
else if(T[u].l==NIL)printf("leaf, ");
else{printf("i... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360648/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360648/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 d{
int p;
int d;
int k;
int *key;
}data;
data *tree;
void dataprinter(data out){
puts("-----data-----");
printf("p=%d d=%d k=%d\n",out.p, out.d, out.k);
for(int i=0; i<out.k; i++){
printf("%d ",out.key[i]);
}
printf("\n");
puts("=====data===... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360691/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360691/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.d = type { i32, i32... |
/*ツリー構造*/
#include <stdio.h>
#include <stdlib.h>
#define N 100001
typedef struct node{
int no;
int depth;
int nch;
int *c;
int pa;
} Node;
int main(){
Node a[N];
int n, i, j, num, ch, count=0;
scanf("%d", &n);
for(i=0; i<n; i++){
a[i].pa = -1;
a[i].depth = -2;
}
for(i=0; i<n; i++){
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360741/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360741/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>
typedef unsigned long long ull;
int main() {
int num;
scanf("%d", &num);
while (num--) {
ull a, b, ans = 0, sum = 0;
scanf("%llu%llu", &a, &b);
while (a--) {
ull tem;
scanf("%llu", &tem);
ans += (tem + b - 1) / b;
su... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3608/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3608/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>
#define N 100000
struct Node{
int p;
int l;
int r;
};
struct Node T[N];
int D[N];
int Depth(int x){
int sum = 0;
while(T[x].p != -1){
sum++;
x = T[x].p;
}
return sum;
}
int main(void){
int n,i,j,k,c,s,node;
scanf("%d",&n);
for(i=0;i<n;i++){
T[i].p = T[i].l = T[i... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360864/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360864/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 100000
#define NIL -1
typedef struct{
int p,l,r;
}Node;
Node T[N];
int n, D[N];
void print(int );
int rec(int,int);
int main(){
int i,j,d,v,c,l,root;
scanf("%d",&n);
for(i=0;i<n;i++)
T[i].p = T[i].l = T[i].r = NIL;
for(i=0;i<n;i++){
scanf("%d%d", &v, &d);
for(j=... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_360929/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_360929/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(void) {
int t, n, i, k, mistakes;
char str[55];
scanf("%d", &t);
while(t--)
{
scanf("%d", &n);
scanf("%s", str);
mistakes = 0; k = -1;
for(i = 0; i<n; i++)
{
if(k == -1 && str[i] == ')')
{
mi... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36098/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36098/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>
typedef struct Node{
int parent;
int left;
int right;
}Tree;
Tree T[1000000];
void TreePrint(int);
int main(){
int n, i, j, k ,l, id, child;
scanf("%d",&n);
for(i = 0;i <n;i++){
T[i].parent = T[i].left = T[i].right = -1;
}
for(i = 0;i <n;i++){
scanf("%d%d",&id, &k);
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361029/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361029/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()
{
long long int t, n, x, y, z;
scanf("%lld", &t);
while(t--)
{
scanf("%lld %lld %lld", &x, &y, &n);
if(n%x>=y)
{
z=n/x;
printf("%lld\n", (z*x)+y);
}
else
{
z=n/x;
z--;
printf("%lld\n", (z*x)+y);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36108/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36108/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>
#define MAX 100000
#define NIL -1
typedef struct {
int par;
int left;
int right;
}Node;
Node T[MAX];
int n,A=0,D[MAX];
int rec(int n){
int m=0;
while(1){
n=T[n].par;
if(n==NIL) break;
m++;
}
return m;
}
void print(int n){
int i,c;
printf("node %d: parent = %d, ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361122/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361122/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 OUT -1
struct Node{
int p;
int l;
int r;
};
void depth(int,int);
void print(int);
//using namespace std;
struct Node T[MAX];
int n, A[MAX];
int main(){
int i,j,d,v,c,l,r;
scanf("%d",&n);
for(i = 0; i < n; i++){
T[i].r = OUT;
T[i].l = T[i].r;
T[... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361166/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361166/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>
#define SIZE 100001
enum TYPE{root, node, leaf, null};
char* strtype[] = {"root", "internal node", "leaf"};
typedef struct Vec{
int lenght;
int size;
int maxsize;
int* buff;
}VEC;
typedef struct VecIt{
int i;
VEC* vp;
}VECIT;
struct TREE{
int parent;
int depth;
int ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361209/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361209/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.TREE = type { i32, ... |
#include <stdio.h>
#define MAX 100005
#define NIL -1
typedef struct {int p, l, r;} Node;
Node T[MAX];
int n, D[MAX];
void print(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("le... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361302/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361302/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_struct { int p, l, r; }; /*p: 親(parent), l: 一番左の子(left child), r:右の兄弟(right sibling)*/
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX];
void print(int u) {
int i, c;
printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);
if (T[u].p... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361346/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361346/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_struct = type ... |
#include <stdio.h>
int main(void) {
// your code goes here
int t;
scanf("%d",&t);
int i;
for(i=0;i<t;i++)
{
int n;
scanf("%d",&n);
int count=0;
if(n==1)
{
printf("%d\n",count);
}
while(n!=1)
{
if(n%3!=0)
{
printf("-1\n");
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36139/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36139/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>
#define MAX 100000
typedef struct t{
int p;
int l;
int r;
}tree;
int Depth(int);
void hantei(int,int,int);
tree T[MAX];
int cnt =0;
int main(){
int n,k,i,j,id,c,l,num = 0;
scanf("%d",&n);
for(i = 0;i < n;i++){
T[i].p = -1;
T[i].l = -1;
T[i].r = -1;
}
for(i = 0;i < n;i++... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361432/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361432/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.t = type { i32, i32... |
//
// Created by kota_ on 2019/12/28.
//
#include <stdio.h>
#include <stdlib.h>
typedef struct node{
int id;
struct node *child;
struct node *sibling;
struct node *parent;
}Node;
typedef Node* Nodepointer;
Node make_1node(int id){
Node ret;
ret.id = id;
ret.child = NULL;
ret.sibling ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361476/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361476/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 p, l, r;} Node;
Node T[MAX];
int n, D[MAX];
void print(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("le... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361519/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361519/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_struct{int p, l, r;};
/*p: 親(parent), l: 一番左の子(left child), r:右の兄弟(right sibling)*/
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX];
void print(int u){
int i, c;
printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);
if(T[u].p == ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361562/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361562/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_struct = type ... |
#include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node_struct{int p, l, r;}; /*p: 親(parent), l: 一番左の子(left child), r:右の兄弟(right sibling)*/
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX];
void print(int u){
int i, c;
printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);
if(T[u].p==-1)... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361605/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361605/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_struct = type ... |
#include<stdio.h>
#include<stdlib.h>
#define NIL -1
typedef struct{
int p, l, r;
}Node;
Node T[100000];
int D[100000];
void print(int);
int rec(int, int);
int main()
{
int n, id, deg, c, l, r;
int i, j;
scanf("%d", &n);
for(i=0;i<n;i++)
{
T[i].p = NIL; T[i].l = NIL; T[i].r = NIL;
}
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361656/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361656/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>
#define NMAX 100000
int v[NMAX], put[NMAX];
int main() {
int t, n, i, j, x, min, poz, cop;
long long suma;
scanf ( "%d", &t );
for ( i = 0; i < t; i++ ) {
scanf ( "%d%d", &n, &x );
min = 1000000;
for ( j = 0; j < n; j++ ) {
scanf ( "%d", &v[j] );
c... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3617/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3617/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>
int main(){
char s[51],t[51];
int i,j,z,x,y;
scanf("%s%s",s,t);for(x=0;s[x];x++);for(y=0;t[y];y++);
for(i=x-y;i>=0;i--){
z=0;
for(j=0;j<y;j++)z+=(s[i+j]=='?')+(s[i+j]==t[j]);
if(z==y){for(j=0;j<y;j++)s[i+j]=t[j];for(j=0;j<x;j++)printf("%c",s[j]=='?'?'a':s[j]);return 0;}
}
print... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361742/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361742/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>
int main()
{
int l1,l2,i,j,k,t,m;
char S[100],T[50];
scanf("%s",S);
scanf("%s",T);
l1=strlen(S);
l2=strlen(T);
for(i=l1-1;i>=0;i--)
{
for(j=i,m=0;j<i+l2;j++,m++)
{
if(S[j]=='?'||S[j]==T[m])
continue;
else
break;
}
if(j==i+l2... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361786/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361786/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... |
//set many funcs template
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
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 zt(int a,int b){return max(a,b)-min(a,b);}
int round(... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361829/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361829/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 R=1,C=1,H[2000010]={0};
int N[2000010]={2100000000};
//ヒープに入れる
void hin(int a){
int i=C++;
for(N[R]=a;a>N[H[i/2]];i/=2)H[i]=H[i/2];
H[i]=R++;
}
//ヒープから最小値を取り出す
int hout(){
int rt=H[1],nt=1,i=0,k=H[--C];
while(nt-i){
H[i=nt]=k;
if(i*2 <C&&N[ k ]<N[H[i*2 ]])H... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361872/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361872/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"
@R = dso_local local_unname... |
#include <stdio.h>
#define SIZE 2000000
int main() {
int A[SIZE];
int H=0;
int i, l, largest, tmp, n;
char com[21], buf[20];
buf[19]='\n';
char *p,*c1,*c2;
c1 = com+1;
c2 = com+2;
do {
fgets(com, 20, stdin);
if (*com == 'i') {
n = 0;
p = com+7;
while (*p!='\n') {
n ... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361915/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361915/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 <stdlib.h>
#include <string.h>
#include <math.h>
int heap[2000001];
int last_idx;
void maxHeapify(int node_idx){
int tmp;
int largest = node_idx;
int left_child_idx = 2 * node_idx;
int right_child_idx = 2 * node_idx + 1;
if ( left_child_idx <= last_idx &... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_361980/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_361980/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"
@last_idx = dso_local local... |
#include<stdio.h>
#include<stdlib.h>
typedef unsigned u;
u P[222222],V[222222];
int main()
{
u n,r=1,s=0,i=0,j;
for(scanf("%u",&n);++i<=n;)scanf("%u",P+i);
for(i=-1;++i<n;r^=j)scanf("%u",&j);
for(i=0;++i<=n;)if(!V[i])
for(++s,V[j=i]=1;!V[j=P[j]];V[j]=1);
printf("%u\n",r+(s>1?s:0));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36203/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36203/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 Max 2000000
#define INFTY 1
int heap ;
int A[Max+1];
void MaxHeapify(int);
void swap(int *,int *);
int extract();
void increaseKey(int ,int);
void insert(int);
int main(){
int key;
char com[10];
while(1){
scanf("%s",com);
if(strcmp(com,"end")==0)break;
if(s... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362073/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362073/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 2000010
#define OVERMIN -1
int heap[MAX];
int H = 0;
void swap(int i, int j) {
int buf = heap[i];
heap[i] = heap[j];
heap[j] = buf;
}
void maxHeap(int H, int i) {
int l = 2 * i, r = 2 * i + 1;
int largest = i;
if (l <= H && heap[l] > heap[i])largest = l;
if (r <= H && heap[r] > h... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362145/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362145/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"
@H = dso_local local_unname... |
#include<stdio.h>
#include<string.h>
#include <math.h>
#include <stdlib.h>
#define N 100000
#define MAX 2000000
#define INFTY 1000000
int n, a[MAX+1];
void Heapify(int i)
{
int l, r, largest, tmp;
l = 2*i;
r = 2*i+1;
if(l <= n && a[l] > a[i])
largest = l;
else
largest = i;
if(r <= n && a[r] > a... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362217/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362217/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"
@n = dso_local local_unname... |
#include <stdio.h>
#define SIZE 2000000
int main() {
int A[SIZE];
int H=0;
int i, l, largest, tmp, n;
char com[21], buf[20];
buf[19]='\0';
char *p;
do {
fgets(com, 20, stdin);
if (com[0] == 'i') {
n = 0;
p = com+7;
while (*p!='\n') {
n = n*10+*p-'0';
p++;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362268/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362268/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<string.h>
#define MAX 2000000
#define MIN -1
void maxHeapify(int *,int);
int heapExtractMax(void);
void heapIncreaseKey(int *,int,int);
void insert(int);
int H, a[MAX+1];
int main(){
int n;
char com[20];
while(1){
scanf("%s", com);
if ( com[0] == 'e'&&com[1]=='n' ) break;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362310/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362310/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 MAX 2000000
#define INF 1000
int H, A[MAX+1];
void heap(int i){
int left, right, nodemax;
int temp;
left = 2 * i;
right = 2 * i + 1;
if(left <= H && A[left] > A[i] ){
nodemax = left;
}
else nodemax = i;
if(right <= H && A[right] > A[nodemax]){
nodemax = right;... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362369/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362369/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"
@H = dso_local local_unname... |
#include<stdio.h>
#include<string.h>
#define MAX 2000000
#define INFTY (1<<30)
int H,A[MAX+1];
void maxHeapify(int i){
int l,r,L,x;
l=i*2;
r= 2*i+1;
if(l<=H && A[l]>A[i]) L=l;
else L=i;
if(r<=H && A[r]>A[L]) L=r;
if(L!=i){
x=A[i];
A[i]=A[L];
A[L]=x;
maxHeapify(L);
}
}
int ex... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362411/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362411/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"
@H = dso_local local_unname... |
#include<stdio.h>
#define MAX 2000000000
#define INFTY (1<<30)
void maxHeapify(int);
void insert(int);
void increaseKey(int, int);
int heapExtractMax(void);
int H, A[MAX];
void maxHeapify(int i){
int l, r, large,keep;
l = 2*i;
r = 2*i+1;
if( l <= H && A[l] > A[i] ) large = l;
else large = i;
if( r <= H &... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362462/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362462/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"
@H = dso_local local_unname... |
#include <stdio.h>
#include <stdlib.h>
int H, W;
int A[32][32];
int main(void) {
int i, j, k, l;
int answer = -1;
if (scanf("%d%d", &H, &W) != 2) return 1;
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
if (scanf("%d", &A[i][j]) != 1) return 1;
}
}
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++)... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362505/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362505/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>
int flag[10];
long calc(char s[11],int p,long a,int n){
if(p==n-1)
return a*10+s[p]-'0';
if(flag[p])
return a*10+s[p]-'0'+calc(s,p+1,0,n);
else
return calc(s,p+1,10*a+s[p]-'0',n);
}
long dfs(char s[11],int n,int m){
long ans=0;
if(n-m>1){
flag[m]=0;
a... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362556/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362556/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"
@flag = dso_local local_unn... |
#include<stdio.h>
int main()
{
// freopen("/home/shadhin/Desktop/code/input.txt", "r", stdin);
// freopen("/home/shadhin/Desktop/code/output.txt", "w", stdout);
int n, i, x, input, test;
long long int sum, max, min;
scanf("%d", &test);
while(test--)
{
scanf("%d %d", &n, &x);
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3626/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3626/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>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*((-1*a)-(-1*b));
printf("%d\n",c);
i--;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362642/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362642/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 a[7], b[7];
int i;
for (i=0; i<7; i++) {
scanf("%d %d", &a[i], &b[i]);
}
for (i=0; i<7; i++) {
printf("%d\n", a[i]-b[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362686/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362686/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 a,b,c[7],d;
for(d=0;d<7;d++){
scanf("%d %d",&a,&b);
c[d]=a-b;
}
for(d=0;d<7;d++){
printf("%d\n",c[d]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362729/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362729/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>
#include<string.h>
int main()
{
long int a[30],b[30],c[30];
long int d,e,f,x,y,z;
scanf("%ld %ld",&d,&e);
for(x=0;x<30;x++)
{
a[x]=0;
b[x]=0;
c[x]=0;
}
x=0;
z=d;
y=0;
while(z>0)
{
a[x]=z%3;
x++;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36278/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36278/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 main(){
int a,b;
scanf(" %d %d",&a,&b);
printf("%d\n",2*b-a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362888/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362888/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 g,r;scanf("%d%d",&r,&g);
printf("%d",g*2-r);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362930/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362930/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 rate,goal,pfm;
char str[8];
fgets(str,sizeof(str),stdin);
sscanf(str,"%d",&rate);
fgets(str,sizeof(str),stdin);
sscanf(str,"%d",&goal);
/*(rate+pfm)/2 == goal
pfm == 2goal - rate*/
pfm = 2*goal - rate;
printf("%d",pfm);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_362974/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_362974/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>
int main(){
int r,g,a;
scanf("%d %d",&r,&g);
a=(2*g)-r;
printf("%d\n",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_363016/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_363016/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 na, nb, nc;
int a[1<<20], c1[1<<20], c2[1<<20];
long long b1[1<<20][2], b2[1<<20][2];
int intcmp(const void *x, const void *y)
{
return *(int *) x - *(int *) y;
}
int main()
{
int i, j, k;
long long cc;
scanf("%d%d%d", &na, &nb, &nc);
for ( i = 0; i < na; ++i )
scanf... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36306/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36306/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 main(void){
double now,tgt;
scanf("%lf",&now);
scanf("%lf",&tgt);
printf("%.0lf\n",2*tgt-now);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_363102/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_363102/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 R, G = 0;
scanf("%d", &R);
scanf("%d", &G);
printf("%d\n", 2 * G - R);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_363146/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_363146/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 i;
int n, a, b, c, d;
scanf( "%d", &n );
for ( i = 0; i < 4; i++ ) {
int min1, min2;
scanf( "%d %d %d %d", &a, &b, &c, &d );
min1 = a < b ? a : b;
min2 = c < d ? c : d;
if ( min1 + min2 <= n ) {
printf( "... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36319/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 main(void){
int sum = 0;
int mode = 0;
int current = 0;
int c;
while(1){
c = getchar();
if(c == EOF){break;}
if('0' <= c && c <= '9'){
mode = 1;
current = current * 10 + c - '0';
}else if(mode){
sum += current;
mode = 0;
current = 0;
}
}
printf("%d\n",sum);
ret... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_363254/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_363254/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>
// 内部定数
#define D_VTX_MAX 100000 // 最大頂点数
// 内部構造体 - 辺情報
typedef struct Edge {
int miVFNo; // 頂点 - 元 1~
int miVTNo; // 頂点 - 先 1~
int miLen; // 距離
} Edge;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_363311/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_363311/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.Edge = type { i32, ... |
#include<stdio.h>
int main() {
int m,i,j,money,a,b,c,d;
while(scanf("%d",&money)!=EOF) {
j=-1;
for(i=1;i<=4;i++) {
scanf("%d%d%d%d",&a,&b,&c,&d);
a=a>b?b:a;
c=c>d?d:c;
if(money-a>=c) {
j=i;
m=a;
}
}
if(j!=-1)
printf("%d %d %d\n",j,m,money-m);
else
printf("-1\n");
}
return 0;
... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36337/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36337/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 main()
{
int i,j,n,k,min,sum,ans,a[100001];
scanf("%d %d",&n,&k);
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
j=1;ans=-1;
while(j<=k)
{
sum=0;
for(i=0;i<n;i+=k)
{
sum+=a[(i+j)%(n+1)];
}
if(sum<ans || ans==-1)
{
ans=sum;
min=j;
}
j++;
}
printf("%d\n",min)... | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_36342/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_36342/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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.