Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int main(void) { int a,b,c,s,i,h,n; while(scanf("%d%d%d",&a,&b,&c) , a != 0){ s = 0; for(i = 1;i <= a;i++){ scanf("%d\n",&n); if(i == b) h = n; s+=n; } if(h)printf("%d\n",(s*(100-c))/h); else printf("0\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219327/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219327/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 ssslate[1000010],tenpaman[1000410],indexmazikawaii[1000210]; int c(const void*p,const void*q){ if(tenpaman[*(int*)p]<tenpaman[*(int*)q]){ return -1; } return 1; } int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++)scanf("%d%d",ssslate+i,tenpaman+i); for(int i=0;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219378/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219378/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" @tenpaman = dso_local globa...
#include <stdio.h> int main(void) { char num[4]; scanf("%s", num); if(num[0] == num[2]) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219435/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219435/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(void){ char N[2]; scanf("%s",&N); if(N[0] ==N[2]) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219486/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219486/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",&a); b = a/100; c = a % 10; if(b == c) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219529/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219529/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,n,sum=0; while (scanf("%d",&x)!=EOF) { n=x; while (x!= 0) { sum=sum*10+x%10; x /=10; } if (n==sum) printf("Yes\n"); else printf("No\n"); sum=0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219572/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219572/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> int arr[100005]; int cmp(const void * a,const void *b) { return *(int *)b - *(int *)a; } int maxx(int a,int b) { if (a>=b) return a; else return b; } int main() { int n,i,j; int s=0; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21963/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21963/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 n; int reverse = 0; int remaind; int tmp; scanf("%d", &n); tmp = n; while(tmp!=0) { remaind = tmp % 10; reverse = reverse * 10 + remaind; tmp /= 10; } if( reverse == n) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219673/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 w,h; int R=1,C=1,H[2000010],N[2000010]; //評価関数(いまはMIN) int hyouka(int a,int b){ if(C<b)return 1; if(C<a||b==0)return 0; return N[H[a]]<N[H[b]]?1:0; } //挿入関数 void hin(int a){ int i=C++; for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2]; H[i]=R++; } //取り出す関数 int hout(){ int rt=H[1],i,j=2,...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219716/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219716/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> int main() { int n; scanf("%d", &n); int i; char temp[103]; int s=0; int f=0; scanf("%s", temp); char curr = temp[0]; for (i=1;i<n;i++) { if (curr!=temp[i]) { //printf("%c %c\n", curr, temp); if (temp[i]=='S') { //printf("h1"); s++; } else { //printf("h...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21976/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21976/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 ...
/* AUTHOR: AKASH JAIN * EMAIL: akash19jain@gmail.com * ID: akash19jain * DATE: 08-03-2020 17:39:15 */ // #include<algorithm> // #include <bits/stdc++.h> // using namespace std; #include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<ctype.h> #define SC1(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219802/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219802/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" @INF = dso_local local_unna...
#include <stdio.h> int main(void) { int k,x,i,c; scanf("%d%d",&k,&x); for(i=x-(k-1),c=0;c<2*k-1;i++,c++){ printf("%d ",i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219846/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219846/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; char days[105]; int i; int fs=0; int sf=0; scanf("%d",&n); scanf("%s",&days); for(i=1;i<n;i++) { if((days[i-1]=='F')&(days[i]=='S')) fs++ ; if((days[i-1]=='S')&(days[i]=='F')) sf++ ; } if(sf>fs) { printf("YES\n"); }else{ printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21989/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21989/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 k,x; scanf("%d%d",&k,&x); for(int i=x-k+1;i<=x+k-1;i++) printf("%d ",i); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219932/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219932/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,k,i; scanf("%d %d",&k,&x); for(i=1;i<=2*k-1;i++) printf("%d ",x-k+i); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219976/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219976/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 K, X; scanf("%d %d", &K, &X); // X-K+1 -- X+K-1 for (int i = 0; i < 2 * K - 1; i++) { printf("%d ", X - K + 1 + i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220017/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 k; int x; int min; int max; int i; scanf("%d",&k); scanf("%d",&x); min = x - k + 1; max = k + x - 1; for (i = min;i <= max;i++){ printf("%d ",i); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220060/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220060/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 k,x,i; int large,small; scanf("%d %d",&x,&k); x --; if(k+x >1000000){ large = 1000000; }else{ large = k+x; } if(k-x < -1000000){ small = -1000000; }else{ small = k-x; } for(i= 0;small<=large;small++){ printf("%d ",small); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220103/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220103/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 k,x,m; scanf("%d%d",&k,&x); m=x-(k-1); for(int i=1; i<=k*2-1; i++){ printf("%d\t",m); m++; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220147/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220147/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 //Ver.20190820 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #include<assert.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220190/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.sd = type { i32, i3...
#include<stdio.h> int main(){ int L,n; scanf("%d%d",&L,&n); int ans=0; for(int i=0;i<n;i++){ int a,b; scanf("%d%d",&a,&b); ans-=a*b; } if(ans>0)printf("1\n1 %d\n",ans); else if(ans<0)printf("1\n-1 %d\n",-ans); else puts("0"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220240/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220240/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> struct node{ struct node *right; struct node *left; struct node *parent; int key; }; typedef struct node * Node; #define NIL NULL Node root; Node treeSearch(Node u, int k){ if( u == NIL || k == u->key ) return u; if( k < u->key ) return treeSearch(u->left, k); el...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220284/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220284/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> struct node{ struct node *right; struct node *left; struct node *p; int key; }; typedef struct node * Node; #define NIL NULL Node root; Node treeSearch(Node u, int k){ if(u == NIL || k == u->key) return u; if(k < u->key) return treeSearch(u->left,k); else ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220327/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220327/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> struct node{ struct node *right; struct node *left; struct node *parent; int key; }; typedef struct node * Node; #define NIL NULL Node root; Node treeSearch(Node u, int k){ while(u != NIL){ if(u->key > k) u = u->left; else if(u->key < k) u = u->right; else...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220370/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220370/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> typedef struct node{ int key; struct node *l, *r, *par; }Node; Node *NIL, *root; Node* find(Node *u,int k){ while(u!= NIL && k!= u->key){ if(k < u->key)u=u->l; else u = u->r; } return u; } void insert(int k){ Node *x=root; Node *y=NIL; N...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220413/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220413/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> struct node{ int key; struct node *r; struct node *l; struct node *p; }; typedef struct node * Node; #define NIL NULL Node root; Node treeSearch(Node u, int k){ if(u == NIL || u->key == k){ return u; } else if(u->key > k){ return treeSearch(u->l,k); } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220457/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220457/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> int main() { char s; int h,m,a,a1,a2; while(scanf("%d%c%d",&h,&s,&m)!=EOF) { scanf("%d",&a); a1=a/60; a2=a%60; h+=a1; m+=a2; if(m/60>0) {h++;} m=m%60; h=h%24; if(h>=0&...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22050/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22050/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> struct node{ struct node *right; struct node *left; struct node *parent; int key; }; typedef struct node * Node; #define NIL NULL Node root; Node treeMinimum(Node x){ while(x->left != NIL) x = x->left; return x; } Node treeMaximum(Node x){ while(x->right != NIL...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220543/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220543/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{ int key; struct Node *parent; struct Node *left; struct Node *right; }; struct Node *root,*NIL; void insert(int ); void preorder(struct Node *); void inorder(struct Node *); struct Node *find(struct Node *, int); int main(){ int su...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220594/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220594/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> struct node{ struct node *right; struct node *left; struct node *parent; int key; }; typedef struct node * Node; #define NIL NULL Node root; void insert(int k){ Node y = NIL; Node x = root; Node z; z = malloc(sizeof(struct node)); z->key = k; z->left = NI...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220637/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220637/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> struct node{ int key; struct node *l, *r, *p; }; typedef struct node *Node; Node NIL, root; Node find(Node u,int k){ if(u==NIL||u->key==k)return u; if(u->key>k)find(u->l,k); else find(u->r,k); } void insert(int k){ Node y=NIL; Node x=root; Node z; z=malloc(sizeo...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220680/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220680/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 NIL NULL struct node{ struct node *p; struct node *r; struct node *l; int key; }; typedef struct node * Node; Node root; void insert(int v){ Node y=NIL; Node x=root; Node c; c=malloc(sizeof(struct node)); c->key=v; c->l=NIL; c->r=NIL; while(x!=NIL){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220723/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220723/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> #define NIL -1 #define MAX 500000 int root = NIL; int key[MAX]; int left[MAX]; int right[MAX]; //int T[MAX]; int p[MAX]; void tree_insert(int z){ int y = NIL; int x = root; while(x!=NIL){ y = x; if(key[z] < key[x])x = left[x]; else x = right[x]; } p[z] = y; if(y == NIL)root = z...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220767/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220767/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" @root = dso_local local_unn...
#include <stdio.h> #include <stdlib.h> int main() { int h; char c; int m; int a; scanf("%d%c%d", &h,&c,&m); scanf("%d", &a); int hours_passed, minutes_passed; hours_passed=a/60; minutes_passed=a%60; int m1=m+minutes_passed; if(m1>=60) { m1-=60; h+=1; } int h1=(h+hours_passed)%24; if...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22081/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22081/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> struct node{ struct node *right; struct node *left; struct node *parent; int key; }; typedef struct node *Node; #define NIL NULL Node root; Node treeMinimum(Node x){ while(x->left != NIL){ x=x->right; } return x; } Node treeSearch(Node u, int k){ if(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220853/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> typedef struct node{ int key; struct node *left,*right,*parent; }node; typedef struct node* Node; Node root,NIL; void insert(int k){ Node y = NIL; Node x = root; Node z; z = (Node)malloc(sizeof(node)); z->key = k; z->left = NIL; z->right = N...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220903/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220903/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 *right, *left, *p; }; typedef struct node Node; Node *NIL, *T; void insert(Node *z){ Node *y = NIL; Node *x = T; while(x != NIL){ y = x; if(z->key < x->key){ x = x->left; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220954/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220954/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> struct node{ int key; struct node *p; struct node *l; struct node *r; }; typedef struct node *NodePointer; NodePointer r,NIL; NodePointer find(NodePointer x,int k) { while(x != NIL && k != x->key) { if(k < x->key) { x = x->l; } else { x ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220998/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220998/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> // nCr % mod function // Using Fermat's Little theorem: a^(p-2) = a^(-1) (mod p) #define _1e9plus7 1000000007 long long f[200001]; long long fac(long long n, long long mod) { return f[n]; } // Calculate base ^ pow % mod long long modPower(long long base, int pow, int mod) { long long re...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22104/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22104/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_unnamed_...
#include <stdio.h> #include <stdlib.h> struct node { struct node *right; int key; struct node *left; }; typedef struct node * NodePointer; void init(void); NodePointer makenode(int); void insert(int,NodePointer); void preorder(NodePointer); void inorder(NodePointer); int find(int,NodePointer); NodePointer head...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221083/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221083/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> struct node{ struct node *right; struct node *left; struct node *parent; int key; }; typedef struct node * Node; #define NIL NULL Node root; Node treeMinimum(Node x){ while(1){ if(x->right==NIL)break; x=x->left; } return x; } Node treeMaximum(Node x){ whi...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221126/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221126/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> int main() { int it; scanf("%d\n",&it); while(it--){ long long int n; scanf("%lld\n",&n); long long int ans=1; for(long long int i=3;i<=2*n;i++) ans = ((ans%1000000007)*(i%1000000007))%1000000007; printf("%lld\n",ans); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22117/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22117/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> struct node{ struct node *right; struct node *left; struct node *parent; int key; }; typedef struct node * Node; #define NIL NULL Node root; Node treeMinimum(Node x){ while(x->left!=NIL){ x=x->left; } return x; } Node treeMaximum(Node x){ while(x->right!=NIL)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221212/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221212/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> #define LEN 7 struct node{ int key; struct node *parent, *left, *right; }; typedef struct node node; typedef struct node * nodepointer; void insert(int); void inorder(nodepointer); void preorder(nodepointer); nodepointer find(int); nodepointer root; int main(){ int n, k; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221256/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221256/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 n, k; scanf("%d %d", &n, &k); if(k > 1) printf("%d\n", n-k); else printf("0\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221306/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221306/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 s; scanf("%d",&s); while(s--){ int b; scanf("%d",&b); long long int f=1; for(int h=3;h<=2*b;h++){ f=(f*h)%1000000007; } printf("%d",f); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22135/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22135/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 n,k; scanf("%d %d",&n,&k); if(k==1){ printf("0\n"); return 0; } printf("%d\n",n-k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221393/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221393/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,ball; scanf("%d %d",&ball,&n); if(n==1){ printf("0\n"); return 0; }else{ printf("%d\n",ball-n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221436/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221436/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> long long find_factorial(long long n) { long long factorial=1; for(long long i=3;i<=n;i++) { factorial=(factorial*i)%1000000007; } return factorial%1000000007; } int main() { long long num, fact; long long m; scanf("%lld",&m); while(m--) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22148/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22148/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 101 static const int INF = (1 << 21); int n; int d[MAX],key1[MAX],key2[MAX],G[MAX][MAX]; void SingleSourceShortestPathI(void){ int i,j; int min,youso; for(i = 0;i < n;i++){ d[i] = INF; key1[i] = 0; key2[i] = -1; } d[0] = 0; while(1){ min = INF; youso =...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221537/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221537/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 global i32 0...
#include <stdio.h> #define MAX 100 #define INFTY 200000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,a[MAX][MAX]; void dijkstra(){ int minv,i,v,u; int d[MAX],color[MAX]; for(i=0;i<n;i++){ d[i] = INFTY; color[i] = WHITE; } d[0] = 0; color[0] = GRAY; while(1){ minv = INFTY; u = -1; for(i = 0;...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221601/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221601/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 global i32 0...
#include <stdio.h> #define MAX 101 #define INF 10000000 #define NIL -1 #define WHITE 0 #define BLACK 1 int n; int Graph[MAX][MAX]; void prim(void); int main(){ int i, j, k, u, v, w; scanf("%d", &n); for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ Graph[i][j] = INF; } } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221652/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221652/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 N 100000 #define inf 2000000 #define WHITE 1 #define BLACK 2 void dij(); int n,u,e,v,c[100][N],d[N],pi[N],color[N]; int main(){ int i,k,j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ c[i][j]=inf;}} for(i=0;i<n;i++){ scanf("%d%d",&e,&k); for(j=0;j<k;j++){...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221696/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221696/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 <limits.h> #define MAX 100 #define INF 1000000 #define WHITE 0 #define BLACK 1 #define NIL -1 int color[MAX], d[MAX], M[MAX][MAX]; int main() { int n,i,j,k,u,v,c,min; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ M[i][j]...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221739/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221739/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 ALDS1_12_B Single Source Shortest Path I // 2018.5.1 bal4u #include <stdio.h> #include <stdlib.h> #include <string.h> #define QMAX 15000 typedef struct { int t, s; } QUE; QUE que[QMAX]; int qsize; #define PARENT(i) ((i)>>1) #define LEFT(i) ((i)<<1) #define RIGHT(i) (((i)<<1)+1) void min_heapify(int i) {...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221797/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221797/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.QUE = type { i32, i...
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { long long int n,k; scanf("%lld%lld",&n,&k); if((k%2)==1) printf("1"); else { int c=0; while((k>0)&&((k%2)==0)) { c++; k/=2; } printf("%d",c+1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22184/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22184/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 INFTY = (1<<21); int main(){ int n,i,j,M[100][100],k, c, u,o,m,doo[100],v[100]; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ M[i][j]=INFTY; } } for(i=0;i<n;i++){ scanf("%d%d",&u,&k); for(j=0;j<k;j++){ scanf("%d%d",&o,&c); M[u][o]=c; } } f...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221883/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221883/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" @INFTY = dso_local local_un...
#include<stdio.h> #define NN 0 #define BB -1 static const int MAX = 1005; static const int INFTY = (1<<21); int n; int main(){ int minv; int i, j, k, c, u, v; int M[MAX][MAX]; int d[MAX], col[MAX]; scanf("%d", &n); for ( i = 0; i< n; i++ ){ for ( j = 0; j < n; j++ ){ M[i][j] = INFTY; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221926/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221926/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 SIZE 100005 int main() { int n, a, b; char s[SIZE]; scanf("%d %d %d", &n, &a, &b); scanf("%s", &s); printf("%d", (s[a - 1] == s[b - 1]) ? (0) : (1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22197/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22197/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 100 #define INFTY (1 << 21) #define W 0 #define G 1 #define B 2 int i, j, v, n, M[MAX][MAX]; int main() { int k, c, u, v; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { M[i][j] = INFTY; } } for (i = 0; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222011/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 INF 10000000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int M[100][100]; void dijkstra(int n) { int i, u, minv, d[100], color[100]; for (i = 0; i < n; i++) { d[i] = INF; color[i] = WHITE; } d[0] = 0; while (1) { minv = INF; u = -1; for (i = 0; i < n; i++) { if (minv >...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222055/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" @M = dso_local local_unname...
#include <stdio.h> #define MAX 100 #define INFTY (1<<21) #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; void dijkstra(){ int minv,i,v,u; int d[MAX],color[MAX]; for(i=0 ; i<n ; i++){ d[i]=INFTY; color[i]=WHITE; } d[0]=0; color[0]=GRAY; while(1){ minv=INFTY; u=-1; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222099/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222099/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 global i32 0...
#include <stdio.h> #include <stdlib.h> #include <math.h> #define MAX 100 #define WHITE 0 #define BLACK 1 #define GRAY 2 #define INFNTY 10000000 int i, j, n ,M[MAX][MAX]; void dijkstra() { int u2, v2, minv; int d[MAX], color[MAX]; for (i = 0; i < n; i++) { d[i] = INFNTY; color[i] = WHITE; } d[0] = 0; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222149/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222149/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" @i = dso_local local_unname...
#include<stdio.h> #define MAX 100 #define INF 1e8 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; void dijkstra(){ int color[MAX],d[MAX],p[MAX],min,u; int i,j,v; for(i=0;i<n;i++){ color[i] = WHITE; d[i] = INF; } d[0] = 0; p[0] = -1; while(1){ min = INF; for(i=0;i<n;i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222192/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222192/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 global i32 0...
#include<stdio.h> #define DATA 100000000 #define max 100 void SSSP(int,int); int num; int size[max]; int change[max][max]; int cost[max][max]; int dist[max]; int main(){ int i,j,u; scanf("%d",&num); for(i = 0;i < num;i++){ scanf("%d",&u); scanf("%d",&size[u]); for(j = 0;j < size[u];j++){ s...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222235/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222235/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 <limits.h> int n,M[100][100]; void dijkstra(); int main(){ int i,j,w,id,id2,k; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++)M[i][j]=INT_MAX; } for(i=0;i<n;i++){ scanf("%d %d",&id,&k); for(j=0;j<k;j++){ scanf("%d %d",&id2,&w); M[id][id2]=w; } } d...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222279/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222279/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 map[10][10],count; int x,y,N=10; int main(){ while(scanf("%d",&N)*N){ for(x=0;x<10;x++){ for(y=0;y<10;y++){ map[x][y]=x?map[x-1][y+1]+1:y?map[x][y-1]+y:1; } } printf("Case %d:\n",++count); for(x=0;x<N;x++){ for(y=0;y<N;y++){ if(x+y<N){ if((x+y)%2){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222321/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222321/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 global i32 1...
#include <stdio.h> #include <string.h> int main(){ char s[11] = {0}; char t[11] = {0}; char u[11] = {0}; int n, a, b; scanf("%s %s", s, t); scanf("%d %d", &a, &b); scanf("%s", u); if( strcmp(s, u)==0 ){ printf("%d %d\n", a-1, b); } else if( strcmp(t, u)==0...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222394/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222394/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> #define STRING_SIZE 15 int main() { char inputS[STRING_SIZE], inputT[STRING_SIZE], inputU[STRING_SIZE]; int redBallsNumber, blueBallsNumber; scanf("%s""%s", &inputS, &inputT); scanf("%d""%d", &redBallsNumber, &blueBallsNumber); scanf("%s", &inputU); i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222437/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222437/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(void) { char S[256]; char T[256]; scanf("%s %S", S, T); int A, B; scanf("%d %d", &A, &B); char U[256]; scanf("%s", U); if (strcmp(U, S) == 0) printf("%d %d\n", A - 1, B); else printf("%d %d\n", A, B - 1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222480/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222480/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() { char s[10+1]={}, t[10+1]={}, u[10+1]={}; int a, b; scanf("%s %s",s,t); scanf("%d %d",&a,&b); scanf("%s",u); /*比較処理及び演算処理.開始*/ if(strcmp(u,s) == 0) a--; else if(strcmp(u,t) == 0) b--; /*比較処理及び演算処理.終了*/ printf("%d %d \n...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222530/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222530/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 NUM 10 int main(){ int a,b; char s[NUM],t[NUM],u[NUM]; scanf("%s",s); scanf("%s",t); scanf("%d",&a); scanf("%d",&b); scanf("%s",u); if(strcmp(s,u) == 0){ a--; } else if(strcmp(t,u) == 0){ b--; } printf("%d %d\n",a,b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222574/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222574/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...
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *********...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222624/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222624/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 A, B; char S[20], T[20], U[20]; scanf("%s %s", S, T); scanf("%d %d", &A ,&B); scanf("%s",U); if((strcmp(U,S)) == 0){ A--; } else{ B--; } printf("%d %d", A, B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222682/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222682/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(void) { char s[32], t[32], u[32]; int a, b; scanf("%s%s", s, t); scanf("%d%d", &a, &b); scanf("%s", u); if (strcmp(s, u) == 0) printf("%d %d", a - 1, b); if (strcmp(t, u) == 0) printf("%d %d", a, b - 1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222725/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222725/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> /** Application main entry point. */ int main ( int argc, char * argv[ ] ) { int i; for ( ; ; ) { int n; int s = 0; scanf ( "%d", &n ); if ( !n ) break ; for ( i = 1; i * i <= n; ++i ) { if ( i * i == n && !( n % i ) ) { s += i; }...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222776/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222776/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 swap( int* a, int* b ) { int t = *a; *a = *b; *b = t; } int main() { int y1, m1, d1, y2, m2, d2; scanf("%d %d %d %d %d %d", &y1, &m1, &d1, &y2, &m2, &d2 ); if ( y1 > y2 || (y1 == y2 && (m1 > m2 || (m1 == m2 && d1 > d2))) ) { swap( &y1, &y2 ); swap( &m1, &m2 ); swap( &d1, &d2 );...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222848/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222848/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 N; scanf("%d",&N); if (N%1000 != 0) printf("%d",((N/1000)+1)*1000-N); if (N%1000 == 0) printf("%d",0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222891/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222891/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",&n); printf("%d",(1000-n%1000)%1000); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222934/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222934/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; scanf("%d",&n); int k=n%1000; if(k==0) printf("%d",k); else printf("%d",1000-k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222978/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222978/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<limits.h> int main(){ int n,i,x,y; int arr1[5001]={0},arr2[5001]={0},arr3[5001]={0}; long long int pairs=0; scanf("%d",&n); for(i=0;i<n;++i){ scanf("%d %d",&x,&y); arr1[x+y]+=1; int temp=(x-y); if(temp>=0){ arr2[temp]+=1; } else{ temp*=-1; arr3[temp]+=1; } } for(...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22302/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22302/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 price, change; scanf("%d", &price); change = (1000 - price % 1000) % 1000; printf("%d", change); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223063/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223063/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 total; scanf("%d", &total); while (total > 0) { total -= 1000; } printf("%d", -total); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223106/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223106/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() { long long int min=10000000000; long long int sum=0; int n; long long int a; int count=0; scanf("%d",&n); int i; for(i=0;i<n;i++) { scanf("%lld",&a); sum+=a; if(a%2!=0) { count++; if(a<min) min=a; } } if(count%2==0) printf("%lld\n",sum); else printf("%lld\n",sum-min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22315/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22315/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; scanf("%d",&a); if (a%1000!=0) { printf("%d\n",1000-(a%1000)); } else { printf("0\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223193/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223193/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 cash; if (!(scanf("%d", &n))) return (0); cash = 0; while (cash < n) cash += 1000; printf("%d\n", cash - n); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223236/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223236/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> int main() { long long i,num,temp; long long arr[100005],sum=0,min=1000000007; scanf("%lli",&num); for(i=0;i<num;i++) { scanf("%lli",&arr[i]); sum=sum+arr[i]; if((arr[i]<min)&&((arr[i]%2)==1)) min=arr[i]; } if(sum%2==1) printf("%lli\n",sum-min); else printf("%lli\...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22328/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22328/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 = 0; scanf("%d", &N); int i = 0; for (i = 1; i < 11; i++) { if ((i * 1000) >= N) { printf("%d", (i * 1000) - N); break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223322/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223322/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,r; scanf("%d",&n); r=n%1000; if(r!=0) { printf("%d\n",(1000-r)); } else { printf("0\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223366/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223366/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; scanf("%d",&n); n=n%1000; if(n!=0){n=1000-n;} printf("%d\n",n); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223416/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223416/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 int n, num[100010], ans=0, minodd=999999999; scanf("%I64d", &n); if(n==0){ printf("0\n"); } int i; for(i=0; i<n; ++i){ scanf("%I64d", &num[i]); if(num[i]%2 && num[i]<minodd) minodd=num[i]; ans+=num[i]; } if(ans%2){ printf("%I64d\n", ans-m...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22351/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22351/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 c1,c5,c10,c50,c100,c500,sum; scanf("%d",&c1); scanf("%d",&c5); scanf("%d",&c10); scanf("%d",&c50); scanf("%d",&c100); scanf("%d",&c500); sum=c1*1+c5*5+c10*10+c50*50+c100*100+c500*500; if(sum>=1000) printf("1\n"); else printf("0\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223560/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223560/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,d,e,f,x; scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f); x=a*1+b*5+c*10+d*50+e*100+f*500; if(x>=1000){ printf("1\n"); } else{ printf("0\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223603/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223603/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 c1,c5,c10,c50,c100,c500,x,y; scanf("%d %d %d %d",&c1,&c5,&c10,&c50); scanf("%d %d",&c100,&c500); x=c1*1+c5*5+c10*10+c50*50+c100*100+c500*500; if(x>=1000){ printf("1\n"); } else{ printf("0\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223661/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223661/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 p,m,c; scanf("%d %d %d",&p,&m,&c); printf("%d\n",p+m+c); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223704/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223704/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 p,m,c,k; scanf("%d %d %d",&p,&m,&c); k=p+m+c; printf("%d\n",k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223755/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223755/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; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); printf("%d\n",a+b+c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223799/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223799/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...
// // problemA.c // ADSWeek01 // // Created by Yuta Nemoto on 2019/04/08. // Copyright © 2019 Yuta Nemoto. All rights reserved. // #include <stdio.h> void initialize(int[]); double length(int, int, int, int); double sqrt(double); double absolute(double); int main(int argc, const char * argv[]) { // Coun...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223841/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223841/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 0386: Transporter // 2019.2.20 bal4u #include <stdio.h> #include <stdlib.h> #define M 1000000007 char s[100002], t[100002]; int cnt[128]; int main() { int i, N; scanf("%d%s%s", &N, s, t); cnt[s[0]] = 1; for (N--, i = 1; i < N; i++) { cnt[s[i]] += cnt[t[i]]; if (cnt[s[i]] >= M) cnt[s[i]] -= M; } p...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223885/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223885/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 prev[ 200000 + 1 ] ,next[ 200000 + 1 ] ; int main() { int n ,m ,q ; int a , r ,p = 0 ; int i ,j ; scanf( "%d %d %d", &n , &m , &q ) ; for( i = 0 ; i < n ; i++ ) { prev[ i ] = ( i - 1 + n ) % n ; next[ i ] = ( i + 1 ) % n ; } for( i = 0 ; i < m ; i++ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223979/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223979/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...