Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> int main() { int a,b,i; scanf("%d %d",&a,&b); for(i=a-1;i>0;i--) { printf("%d ",b-i); } printf("%d ",b); for(i=1;i<a;i++) { printf("%d ",b+i); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219979/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219979/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> int main() { int n,i,c1=0,c2=0; scanf("%d",&n); char s[n]; scanf("%s",s); for(i=0;i<n;i++) { if(s[i]=='F'&&s[i+1]=='S') c1++; if(s[i]=='S'&&s[i+1]=='F') c2++; } if(c2>c1) printf("YES"); else printf("NO"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22002/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22002/source.c" target datalayout = "e-m:e-p270: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; int i; scanf("%d %d",&K,&X); for(i=X-K+1;i<=X+K-1;i++){ printf("%d ",i); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220063/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220063/source.c" target datalayout = "e-m:e-p270: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,i,count = 0; scanf("%d %d",&K,&X); i=X-K+1; while(count < 2*K-1){ printf("%d ",i); i++; count++; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220106/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220106/source.c" target datalayout = "e-m:e-p270: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> long long res = 1; long long resp = 1; long long max = 1; int main () { long long x; scanf("%I64d", &x); for (res = 1, max = 1; res <= 10e14; res+= max++) { // x = res; if (x == res) { printf("1\n"); return 0; } if (x < res + max) { printf("%I64d\n",...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22015/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22015/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @res = dso_local local_unname...
/* بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ */ /* رَّبِّ زِدْنِى عِلْمًا */ #include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <ctype.h> #define OUTPUT freopen("myfile.txt","w",stdout); #define INPUT freopen("input.txt","r",stdin); #define PI acos(-1.0) #define MAX 100005 #define MOD ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22020/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22020/source.c" target datalayout = "e-m:e-p270: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> typedef struct Node{ int key; struct Node *right, *left, *parent; }Node; Node *root, *NIL; Node * find(Node *u, int k){ while(u != NIL && k != u->key){ if(k < u->key) u = u->left; else u = u->right; } return u; } void insert(int k){ Node *y = NIL; Node *x =...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220243/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220243/source.c" target datalayout = "e-m:e-p270: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 *right; struct Node *left; struct Node *parent; }; struct Node *root; void inorder(struct Node *); void preorder(struct Node *); struct Node *find(int); void insert(int); int main(){ int n,x; char com[20]; scanf("%d...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220287/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220287/source.c" target datalayout = "e-m:e-p270: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 *right; struct node *left; struct node *parent; int key; }; typedef struct node * Node; Node root; void insert(int k){ Node y=NIL; Node x=root; Node z; z=malloc(sizeof(struct node)); z->key=k; z->left=NIL; z->righ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220337/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220337/source.c" target datalayout = "e-m:e-p270: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 *right; struct node *left; struct node *parent; }; typedef struct node * Tree; Tree root, NIL; int max; Tree treeSearch(Tree u, int k){ while(u != NIL && k != u->key){ if (k < u->key) u = u->left; else u = u->...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220388/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220388/source.c" target datalayout = "e-m:e-p270: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 { int key; struct node *left; struct node *right; struct node *parent; }; typedef struct node* Node; Node root; Node treeSearch(Node x,int k) { if(x == NIL || k == x-> key) return x; if(k < x->key) return treeSearch(x->l...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220438/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220438/source.c" target datalayout = "e-m:e-p270: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 MAX 500001 typedef struct Node { long key; struct Node *p, *l, *r; } Node; Node *root, *NIL; void insert(long k) { Node *y = NIL; Node *x = root; Node *z; z = (Node *)malloc(sizeof(Node)); z->key = k; z->l = z->r = NIL; while...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220481/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220481/source.c" target datalayout = "e-m:e-p270: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 { i64, ...
#include <stdio.h> #include <stdlib.h> #define NIL NULL typedef struct node{ int key; struct node *right; struct node *left; struct node *parent; }*Node; Node root; void insert(int k){ Node y = NIL; Node x = root; Node z; z = malloc(sizeof(struct node)); z->key = k; z->left = NIL; z->right ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220524/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220524/source.c" target datalayout = "e-m:e-p270: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 <stdlib.h> #include <string.h> int main() { int hh,mm; int a; scanf("%d:%d%d",&hh,&mm,&a); mm+=a%60; if(mm>=60) {hh+=1;mm%=60;} hh+=(a/60); if(hh>=24) hh%=24; printf("%02d:%02d\n",hh,mm); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22059/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22059/source.c" target datalayout = "e-m:e-p270: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 treeSearch(Node x, int k){ while(x!=NIL && k!=x->key){ if(k < x->key) x=x->left; else x=x->right; } return ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220632/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220632/source.c" target datalayout = "e-m:e-p270: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,*left,*right; }; struct Node *root, *NIL; void insert(int k){ struct Node *y=NIL; struct Node *x=root; struct Node *z; z=(struct Node *)malloc(sizeof(struct Node)); z->key=k; z->left=NIL; z->right=N...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220683/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220683/source.c" target datalayout = "e-m:e-p270: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 NIL -1 #define TRUE 1 #define FALSE 0 #define MAX 500000 typedef struct{ int parent; int left; int right; int key; }node; void insert(int); int find(int, int); void inorder(int); void preorder(int); int root=-1; node T[MAX]; int main(){ int ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220733/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220733/source.c" target datalayout = "e-m:e-p270: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; Node treeMinimum(Node x){ while (x->left != NIL) { x = x->left; } return x; } Node treeSearch(Node x, int k){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220777/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220777/source.c" target datalayout = "e-m:e-p270: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 <math.h> #include<stdbool.h> int main() { int h,m; scanf("%d:%d",&h,&m); int a; scanf("%d",&a); h=(h+(m+a)/60)%24; m=(m+a)%60; printf("%0.2d:%0.2d",h,m); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22082/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22082/source.c" target datalayout = "e-m:e-p270: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> #include<stdlib.h> struct node { int key; struct node *r,*l,*p; }; struct node *NIL,*root; int a=0,b=0; void insert(int k) { struct node *x=root,*y=NIL,*z; z=(struct node*)malloc(sizeof(struct node)); z->key=k; z->l=NIL; z->r=NIL; while(x!=NIL) { y=x; if(k<x->key) x=x...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220870/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220870/source.c" target datalayout = "e-m:e-p270: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* parent; struct Node* left; struct Node* right; }; typedef struct Node * NodePointer; void insert( NodePointer t , int z){ NodePointer x; if ( t -> key <= z){ if ( t -> right == NULL){ x = (NodePointer) malloc...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220913/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220913/source.c" target datalayout = "e-m:e-p270: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 = NIL; Node treeMinimum(Node); Node treeMaximum(Node); Node treeSearch(Node , int); Node treeSuccessor(Node); void treeDelete(Node)...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220957/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220957/source.c" target datalayout = "e-m:e-p270: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 *right; struct Node *left; struct Node *parent; }; struct Node *root,*NIL; void inorder(struct Node *); void preorder(struct Node *); struct Node *find(struct Node *,int ); void insert(int ); int main(){ int i,n,x...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221006/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221006/source.c" target datalayout = "e-m:e-p270: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> void testcase() { int v, e, max; scanf("%d%d%d", &v, &e, &max); max -= 2; // Why is this question so ill-defined? // Lol /* Trivial case: 1 Hub. If max is negative, laughing my ass off IMPOSSIBLE If there is only 1 vertice POS...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22105/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22105/source.c" target datalayout = "e-m:e-p270: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> #include <stdlib.h> struct Node{ int key; struct Node *right, *left , *parent; }; struct Node *root , *NIL; struct Node * find(struct Node *u , int k) { while( u != NIL && k != u->key) { if( k < u->key)u = u->left; else u = u ->right; } return u; } void insert(int k...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221093/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221093/source.c" target datalayout = "e-m:e-p270: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; 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_221150/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221150/source.c" target datalayout = "e-m:e-p270: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 *rig, *lef, *parent; }; struct Node *root,*NIL; void insert(int); void inorder(struct Node *); struct Node * find(struct Node *,int k); void preorder(struct Node *); int main(){ int n,i,x; char input[6]; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221194/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221194/source.c" target datalayout = "e-m:e-p270: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; Node treeMinimum(Node x){ } Node treeMaximum(Node x){ } Node treeSearch(Node u, int k){ if(u == NIL || k == u->key) return ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221237/source.c" target datalayout = "e-m:e-p270: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 N_MAX 500001 struct node{ int key; struct node *right; struct node *left; struct node *parent; }; typedef struct node *Node; Node root = NULL; int find(int k,Node u) { if( u == NULL ){ return 0; } if( u->key == k ){ retu...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221280/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221280/source.c" target datalayout = "e-m:e-p270: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); printf("%d",N%K); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221330/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221330/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> int main(void) { int N, K, x; scanf("%d %d", &N, &K); x = N - K; if(K==1){ printf("%d\n", 0); } else{ printf("%d\n", x); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221374/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221374/source.c" target datalayout = "e-m:e-p270: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; int i, j, k; scanf("%d %d", &N, &K); if(K == 1){ printf("0"); }else{ printf("%d", N-K); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221417/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221417/source.c" target datalayout = "e-m:e-p270: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> int main(){ int i; int n; scanf("%d\n",&n); int a[n]; for(i=0;i<n;i++)scanf("%d ",&a[i]); int m; scanf("%d\n",&m); int b[m]; for(i=0;i<m;i++)scanf("%d ",&b[i]); int k; if(n>m)k=m; else k=n; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221460/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221460/source.c" target datalayout = "e-m:e-p270: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 BLACK 1 #define WHITE 0 #define inf 1000000 int main(){ int c, n, k, i, j, id, v[100][100], w[100][100], min, d[100], u=0, color[100]; scanf("%d",&n); for(i = 0; i < n; i++){ d[i] = inf; color[i] = WHITE; scanf("%d",&id); scanf("%d",&k); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221525/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221525/source.c" target datalayout = "e-m:e-p270: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 WHITE 0 #define BRACK 1 int **matrix; int *d; int *parent; int *color; void dijkstra(int n){ int mincost; int i,j,u; for(i=0;i<n;i++){ d[i] = INT_MAX; parent[i] = -1; color[i] = WHITE; } d[0] = 0; while(1){ minc...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221569/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221569/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @d = dso_local local_unname...
#include <stdio.h> #define MAX 100 #define MAXVAL 2000000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int main(){ int n, i, j, u, k, v, c, min; int col[MAX], arr[MAX]; scanf("%d", &n); int d[n]; int g[n][n]; for( i=0; i<n; i++){ d[i] = 0; arr[i] = MAXVAL; col[i] = WHITE; for( j=0; j<...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221619/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221619/source.c" target datalayout = "e-m:e-p270: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 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 #define INFTY 1000000 int n,M[MAX][MAX]; void dijkstra(); int main(){ int i,j,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; i < n; i++){ scanf("...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221662/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221662/source.c" target datalayout = "e-m:e-p270: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 1000000 #define WHITE 0 #define BLACK 1 #define N 100 int n; int w[N][N]; void dijkstra(void); int main(){ int i,j; int u,v; int k; int c; scanf("%d",&n); for( i = 0 ; i < n ; i++ ){ for( j = 0 ; j < n ; j++ ){ w[i][j] = INF; }...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221712/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221712/source.c" target datalayout = "e-m:e-p270: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, j, Min, p, q, r, n, w[101][101], key[101], d[101]; scanf("%d", &n); for ( i = 0; i < n; i++ ) { key[i] = 0; d[i] = 200001; for ( j = 0; j < n; j++ ) { w[i][j] = -1; } } for ( i = 0; i < n; i++ ) { scanf("%...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221778/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221778/source.c" target datalayout = "e-m:e-p270: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 100 #define INF 100000000 #define W 0 #define G 1 #define B 2 int color[N],M[N][N],d[N],p[N],n; void dijkstra(){ int i,u,v,min; for(i=0;i<n;i++){ color[i]=W; d[i]=INF; } d[0]=0; color[0]=G; while(1){ min=INF; u=-1; for(i=0;i<n;i++){ if(color[i]!=...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221835/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221835/source.c" target datalayout = "e-m:e-p270: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 (1<<21) #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; void dijkstra() { int minv; int d[MAX],color[MAX]; for(int i=0;i<n;i++) { d[i]=INFTY; color[i]=WHITE; } d[0]=0; color[0]=GRAY; while(1) { minv=INFTY; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221879/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221879/source.c" target datalayout = "e-m:e-p270: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 INFTY (1 << 21) #define SHIRO 0 #define NEZUMI 1 #define KURO 2 #define MAX 100 int n; int M[MAX][MAX]; void Dijkstra(); int main(){ int i, j; int s, t, u, v; scanf("%d",&n); for(i = 0 ; i < n ; i++){ for(j = 0 ; j < n ; j++){ M[i][j] = INFTY; } } for(i =...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221921/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221921/source.c" target datalayout = "e-m:e-p270: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> #define WHITE -1 #define GRAY 0 #define BLACK 1 #define INF 1000000 #define NIL -1 void dijkstra(void); int n,G[100][100]; int main() { int i,id,k,v,c,j; scanf("%d",&n); if(n<1 || n>100) exit(1); for(i=0;i<n;i++){ //辺が入力されていないところをINFにするための処理 for(j=0;j<n;j++){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_221965/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_221965/source.c" target datalayout = "e-m:e-p270: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 100 #define MAX 2000 #define INFTY (1<<21) #define WHITE 0 #define GRAY 1 #define BLACK 2 int A[N][N], n; void dijkstra(){ int i, u, v, minv, sum = 0; int d[N], color[N]; for( i = 0 ; i < n ; i++){ d[i] = INFTY; color[i] = WHITE; } d[0] = 0; color[0] = GRAY; while(1...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222007/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222007/source.c" target datalayout = "e-m:e-p270: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<limits.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[100][100]; void dijkstra(void); int main(){ int i,j,k,c,u,v; 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",&u,&k); for(j=0;j<k;j++){ ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222058/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222058/source.c" target datalayout = "e-m:e-p270: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 100 #define INFTY 100000000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; void dijkstra(){ int minv,i,u,v; 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...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222100/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222100/source.c" target datalayout = "e-m:e-p270: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 1000000 int i, j, n, M[MAX][MAX]; void dijkstra() { int u, v, mincost; int d[MAX], color[MAX]; for (i = 0; i < n; i++) { d[i] = INFNTY; color[i] = WH...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222144/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222144/source.c" target datalayout = "e-m:e-p270: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> #include <stdlib.h> #include <math.h> #define WHITE 0 #define BRACK 1 typedef struct{ int k; int *v,*c; }E; E e[101]; int notend(); int w[101],d[101],co[101],n,dest; int main(){ int u,i,j,wsum=0,min,minj; scanf("%d",&n); for(i = 0; i < n; i++){ w[i] = INFINITY; co[i] = WHITE; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222195/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222195/source.c" target datalayout = "e-m:e-p270: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.E = type { i32, ptr...
#include<stdio.h> #include<stdlib.h> #define N 100001 #define INF 9999999 typedef struct{ int x,y,z; }dis; int n,m[N]; dis d[500000]; void fanc1(int); int main(){ int i,j,a,b,ed=0,w=INF; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&a,&b); for(j=0;j<b;j++){ d[ed].x=a; scanf("%d%d",&d[e...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222238/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222238/source.c" target datalayout = "e-m:e-p270: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.dis = type { i32, i...
#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 i,v,minv; 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; i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222281/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222281/source.c" target datalayout = "e-m:e-p270: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 d for(x=0;x<N;x++){for(y=0;y<N;y++){ int m[10][10],c,x,y,z,N=10; int main(){d m[x][y]=x?m[x-1][y+1]+1:y?m[x][y-1]+y:1;}} for(;scanf("%d",&N),N;){ printf("Case %d:\n",++c); d printf("%3d",(z=x+y)<N?z%2?m[x][y]:m[y][x]:N*N+1-(z%2?m[N-1-x][N-1-y]:m[N-1-y][N-1-x]));}printf("\n");}}}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222324/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222324/source.c" target datalayout = "e-m:e-p270: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> int main(){ int a,b,i;char c[12],d[12],e[12]; scanf("%s%s%d%d%s",c,d,&a,&b,&e); for(i=0;i<12;i++){if(d[i]!=e[i]){printf("%d %d",a-1,b);break;} if(c[i]!=e[i]){printf("%d %d",a,b-1);break;}} }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222375/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222375/source.c" target datalayout = "e-m:e-p270: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[11],t[11],u[11]; int a,b; scanf("%s %s",s,t); scanf("%d%d",&a,&b); scanf("%s",u); if(strcmp(s,u)==0) a-=1; else if(strcmp(t,u)==0) b-=1; printf("%d %d\n",a,b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222425/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222425/source.c" target datalayout = "e-m:e-p270: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[11],t[11],u[11]; int a,b; //gets(s); //gets(t); scanf("%s %s",&s,&t); scanf("%d %d",&a,&b); scanf("%s",&u); // gets(u); // printf("%d %d %s",a,b,u); if(strcmp(u,s)==0) printf("%d %d",a-1,b); else if(strcmp(u,t)==0) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222476/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222476/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> int main() { char s[15],t[15],u[15]; int a,b; scanf("%s %s",s,t); scanf("%d %d",&a,&b); scanf("%s",u); if(strcmp(s,u)==0) a--; else b--; printf("%d %d\n",a,b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222548/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222548/source.c" target datalayout = "e-m:e-p270: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],T[10]; char U[10]; int A = 0,B = 0; scanf("%s %s %d %d %s",S,T,&A,&B,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_222605/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222605/source.c" target datalayout = "e-m:e-p270: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 in[10]; char s1[10],s2[10]; int b1,b2; scanf("%s",s1); scanf("%s",s2); scanf("%d %d",&b1,&b2); scanf("%s",in); if(strcmp(s1,in) == 0)b1--; else if(strcmp(s2,in) == 0)b2--; printf("%d %d\n",b1,b2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222649/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222649/source.c" target datalayout = "e-m:e-p270: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() { unsigned long long int t,n,i,a,b,d; scanf("%llu",&t); while(t--) { a=0; b=0; scanf("%llu",&n); if(n==2) printf("2\n"); else { for(i=1;i<=(n/2)-1;i++) { a=a...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2227/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2227/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr co...
#include<stdio.h> #include<string.h> int main() { char s[20], t[20]; scanf("%s %s", s, t); int a, b; scanf("%d %d", &a, &b); char u[20]; scanf("%s", u); if (strcmp(s, u) == 0) a--; else b--; printf("%d %d\n", a, b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222742/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222742/source.c" target datalayout = "e-m:e-p270: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, S; while(1){ scanf("%d", &n); if(n == 0) break; if(n == 1){ printf("deficient number\n"); continue; } S = 1; for(i = 2; i * i <= n; i++){ if(n % i != 0) continue; S += i; if(i != n / i){ S += n / i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222786/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222786/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define FOR(n) for(int i=0;i<n;i++) #define FORJ(n) for(int j=0;j<n;j++) #define PRN(n) printf("%d\n",n) #define PRF(n) printf("%lf\n",n) #define PRL(n) printf("%lld\n",n) #define PRS(s) printf("%s\n",s) #define PRC(c) printf("%c",c) #define mod 1...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222850/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222850/source.c" target datalayout = "e-m:e-p270: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); printf("%d\n",(1000-N%1000)%1000); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222900/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222900/source.c" target datalayout = "e-m:e-p270: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)n=1000-r; else n=0; printf("%d",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222944/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222944/source.c" target datalayout = "e-m:e-p270: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 m = n/1000; if(n % 1000 == 0) printf("%d", 1000*m-n); else printf("%d", 1000*(m+1)-n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222988/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222988/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> typedef long long ll ; int main() { ll n, i, a, mino=10e9, ans=0, flag=0; scanf("%lld", &n); while(n--) { scanf("%lld", &a); ans+=a; if(a%2!=0) { if(a<mino) { mino=a; flag=1; } ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22303/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22303/source.c" target datalayout = "e-m:e-p270: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; scanf("%d", &n); if (n % 1000 == 0) printf("0\n"); else printf("%d\n", 1000 - (n % 1000)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223073/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223073/source.c" target datalayout = "e-m:e-p270: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); if (n > 0 && n < 10001){ int x = (n + 999) / 1000; int i = x * 1000 - n; printf("%d\n", i); } else { printf("erorr\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223116/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223116/source.c" target datalayout = "e-m:e-p270: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 x[2001]; int y[2001]; int z[2001]; int main() { int a,b; int n,i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%d",&a,&b); if((a-b)>=0) x[(a-b)]=x[(a-b)]+1; if((b-a)>=1) y[(b-a)]=y[(b-a)]+1; if((a+b)>=2) z[a+b]=z[a+b]+1; } long long int sum=0; //printf("%d\n",x[0]); for(i=0;i<=2000;i++) { if(x[i...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22316/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22316/source.c" target datalayout = "e-m:e-p270: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> unsigned long long data[100005]; int main(){ int N; unsigned long long input; unsigned long long minodd=10000000005; unsigned long long sum=0; int oddcount=0; scanf("%d", &N); for(int i=0; i<N; i++){ scanf("%llu", &input); sum += input; if(input%2 == 1){ oddcount++; if(input < mi...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22321/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22321/source.c" target datalayout = "e-m:e-p270: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; scanf("%d",&n); printf("%d",(1000-(n%1000))%1000); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223253/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223253/source.c" target datalayout = "e-m:e-p270: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); while(n>1000) n=n-1000; printf("%d",1000-n); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223310/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223310/source.c" target datalayout = "e-m:e-p270: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 input = 0; scanf("%d", &input); int change = input % 1000; if (change > 0) { change = 1000 - change; printf("%d\n", change); } else { printf("%d\n", change); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223354/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223354/source.c" target datalayout = "e-m:e-p270: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,t; scanf("%d", &n); if(n % 1000 == 0){ printf("0"); } else { t = n / 1000; n = 1000 * (t+1) - n; printf("%d", n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223398/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223398/source.c" target datalayout = "e-m:e-p270: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 <stdbool.h> #include <math.h> int main(void) { int N, R; scanf("%d", &N); if((N % 1000) == 0) { printf("0\n"); } else { printf("%d\n", 1000 - (N % 1000) ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223440/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223440/source.c" target datalayout = "e-m:e-p270: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 n; scanf("%d", &n); int a=n%1000; if(a==0) printf("0"); else printf("%d", 1000-a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223484/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223484/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include <stdio.h> #include <string.h> char input[1025]; int count; char left[16] = "qwertasdfgzxcvb"; char right[12] = "yuiophjklnm"; int check(char a); int main(void) { int i, j, now, tmp, len; scanf("%s",input); while (input[0] != '#') { len = strlen(input); count = 0; now = ch...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223527/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223527/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @left = dso_local local_unn...
#include<stdio.h> int c1,c5,c10,c50,c100,c500; int SUM(); int main(){ int sum; scanf("%d %d %d %d %d %d",&c1,&c5,&c10,&c50,&c100,&c500); c5 *= 5; c10 *= 10; c50 *= 50; c100*=100; c500*=500; sum=SUM(); if(sum>=1000){ printf("1\n"); } else{ printf("0\n"); } return 0; } int SUM(){ int sum=0...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223570/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223570/source.c" target datalayout = "e-m:e-p270: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...
#define _CRT_SECURE_NO_WARNINGS //#define _USE_MATH_DEFINES #include<stdio.h> //#include<stdlib.h> //#include<math.h> //#include<string.h> #define P(type,x) fprintf(stdout,"%"#type"\n",x) int main() { int a, b, c, d, e, f; fscanf(stdin, "%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f); P(d, a + b * 5 + c * 10 + d * 50 + e * 100 + ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223613/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223613/source.c" target datalayout = "e-m:e-p270: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(void) { int c1,c5,c10,c50,c100,c500,A,o,p,f,g,m,k; scanf("%d",&c1); o=c1*1; scanf("%d",&c5); p=c5*5; scanf("%d",&c10); f=c10*10; scanf("%d",&c50); g=c50*50; scanf("%d",&c100); m=c100*100; scanf("%d",&c500); k=c500*500; A=o+p+f+g+m+k; if(A>=1000) printf("%d\n",1); else printf("...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223657/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223657/source.c" target datalayout = "e-m:e-p270: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> int main() { int n; scanf("%i",&n); int arr[n]; int i; long long result = 0; for(i=0;i<n;i++) { scanf("%i",&arr[i]); result += arr[i]; } int min; if(result%2 == 0) printf("%lli",result); ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22370/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22370/source.c" target datalayout = "e-m:e-p270: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 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_223743/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223743/source.c" target datalayout = "e-m:e-p270: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,a; scanf("%d %d %d",&p,&m,&c); a=p+m+c; printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223787/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223787/source.c" target datalayout = "e-m:e-p270: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> #include<string.h> typedef long long int int64; static void printInt(int64 n){ if(n<0){putchar('-');n=-n;} if(n==0){putchar('0');return;} int s[20];int len=0; while(n>0){s[len++]=n%10+'0';n/=10;} while(len>0){putchar(s[--len]);} } static int64 readInt(vo...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22383/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22383/source.c" target datalayout = "e-m:e-p270: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_unnam...
#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; } printf("%d\n", cnt[t[N]]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223880/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223880/source.c" target datalayout = "e-m:e-p270: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,coin; scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f); while((a!=0)||(b!=0)||(c!=0)||(d!=0)||(e!=0)||(f!=0)) { coin=100; coin=coin+a*90; coin=coin+b*60; coin=coin+c*7; coin=coin+d*2; coin=coin+e*3; coin=coin-(f-a*5-b*3)*3; coin=coin-(a*5+b*3)*2; pri...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223967/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223967/source.c" target datalayout = "e-m:e-p270: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, m, s, a, b, c, d, e, sum; while (1){ scanf("%d",&n); if (n == 0) break; m = 1000 - n; s = m /500; a = m % 500 / 100; b = m % 500 % 100 /50; c = m % 500 % 100 % 50 /10; d = m % 500 % 100 % 50 % 10 /5; e = m % 500 % 100 % 50 % 10 % 5 / 1; ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224016/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224016/source.c" target datalayout = "e-m:e-p270: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> typedef struct pair_struct { unsigned int x; unsigned int y; } pair; char is_smaller_than(unsigned int num, pair compare) { return (compare.x >= num) && (compare.y >= num); } char is_bigger_than(unsigned int num, pair compare) { return (num >= compare.x) && (num >= compar...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22406/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22406/source.c" target datalayout = "e-m:e-p270: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.pair_struct = type { ...
#include<stdio.h> int n,a; int main(){ scanf("%d",&n); while(n!=0){ a=0;n=1000-n; a+=n/500; n=n%500; a+=n/100; n=n%100; a+=n/50; n=n%50; a+=n/10; n=n%10; a+=n/5; n=n%5; a+=n/1; printf("%d\n",a); scanf("%d",&n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224102/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224102/source.c" target datalayout = "e-m:e-p270: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 paid; int recieved; int coin_num = 0; while(1){ scanf("%d",&paid); if(paid==0)break; coin_num = 0; recieved = 1000 - paid; coin_num += recieved / 500; coin_num += recieved % 500 / 100; coin_num += recieved % 500 % 100 / 50; coi...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224153/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224153/source.c" target datalayout = "e-m:e-p270: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%d%d", &a, &b, &c); if(a + b == c || b + c == a || a + c == b){ printf("Yes"); }else{ printf("No"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224197/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224197/source.c" target datalayout = "e-m:e-p270: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 w1,w2,h1,h2; scanf("%d%d%d%d",&w1,&h1,&w2,&h2); printf("%d\n",2*w1+2*(h1+h2)+4); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22424/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22424/source.c" target datalayout = "e-m:e-p270: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,c; scanf("%d%d%d",&a,&b,&c); if((a+b==c)||(a+c==b)||(b+c==a)) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224283/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224283/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_add...
#include<stdio.h> #include<string.h> #include<math.h> #define FOR(n) for(int i = 0;i < n;i++) #define PRN(n) printf("%d\n",n) #define PRS(s) printf("%s\n",s) int main(void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a+b==c||b+c==a||c+a==b){ PRS("Yes"); }else{ PRS("No"); } return 0; } /* scanf("%d",&...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224326/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224326/source.c" target datalayout = "e-m:e-p270: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(int argc, char **argv) { int n; int s1, s2; int cur1, cur2; int idx; int count; int min_cur, max_pre; scanf("%d", &n); cur1 = cur2 = 0; count = 1; for (idx = 0; idx < n; idx++) { scanf("%d %d", &s1, &s2); if (cur1 =...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22437/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22437/source.c" target datalayout = "e-m:e-p270: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 pack[3]; scanf("%d%d%d", &pack[0], &pack[1], &pack[2]); if (pack[0] == pack[1] + pack[2] || pack[1] == pack[0] + pack[2] || pack[2] == pack[1] + pack[0]) printf("Yes\n"); else printf("No\n"); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224412/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224412/source.c" target datalayout = "e-m:e-p270: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 %d %d", &a, &b, &c); if(a == b + c || b == c + a || c == a + b){ printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224456/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224456/source.c" target datalayout = "e-m:e-p270: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 int t; scanf("%lld",&t); while(t--) { long long int t,a[100],sum=0,count=0,n,i; scanf("%lld",&n); for(i=1;i<=n;i++) { a[i]=pow(2,i); } sum=sum+a[n]; for(i=1;i<=n/2-1;i++) ...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2245/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2245/source.c" target datalayout = "e-m:e-p270: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 <float.h> #include <inttypes.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <math.h> #ifdef __cplusplus #include <bits/stdc++.h> #endif #define getchar getchar_unlocked #define putchar pu...
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224542/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224542/source.c" target datalayout = "e-m:e-p270: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._IO_FILE = type { i...
#include <stdio.h> int main(void) { int A, B, C; scanf("%d%d%d",&A,&B,&C); if (A < C && C < B || B < C && C < A) { printf("Yes"); } else { printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224593/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224593/source.c" target datalayout = "e-m:e-p270: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,t,s=0,i; scanf("%d%d%d",&a,&b,&c); if(a>b){ t = a; a = b; b = t; } for(i=a;i<=b;i++){ if(c==i) s++; } if(s==1) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224636/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224636/source.c" target datalayout = "e-m:e-p270: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...