Timus Problem 1991 Solution #include <stdio.h> int a[10001]; int main() { int ans=0,ans1=0,k,n,i; scanf("%d %d",&n,&k); for(i=0;i<n;i++){ scanf("%d",&a[i]); } if(a[i]<=k){ ans+=k-a[i]; } else{ ans1+=a[i]-k; } printf("%d %d",ans,ans1); return 0;...
Timus Problem 1991 Solution #include <stdio.h> int a[10001]; int main() { int ans=0,ans1=0,k,n,i; scanf("%d %d",&n,&k); for(i=0;i<n;i++){ scanf("%d",&a[i]); } if(a[i]<=k){ ans+=k-a[i]; } else{ ans1+=a[i]-k; } printf("%d %d",ans,ans1); return 0;...
Timus Problem 2001 Solution #include <iostream> using namespace std; int main() { int a[3]; int b[3]; int sum,m1,m2; scanf("%d %d",a[0],b[0]); if(a[0]<0||b[0]<0||a[0]>10000||b[0]>10000) return(1); sum=a[0]+b[0]; scanf("%d %d",a[1],b[1]);...
#include <stdio.h> int main() { int a,b,c,n,i; for(a=1;a<=100;a++){ for(b=1;b<=100;b++){ if(b!=a){ for(c=1;c<=100;c++){ if( ( c != a && c != b)){ printf("a=%d\tb=%d\tc=%d\n",a,b,c); } }} }} return 0; }...
Timus Problem 1493 Solution #include <stdio.h> int main() { int a,b,i,n,sum1,sum2; sum1=0,sum2=0; for(i=0;i<6;i++){ scanf("%d",&n); sum1+=n; } sum2=sum1+1; if(sum2%2!=1){ printf("Yes"); } else{ printf("No"); } return 0; }...
Solution: #include <stdio.h> int main() { int m,n,sum; while(scanf("%d %d",&m,&n)!=EOF){ if(m != 1 && m==(n%m)){ printf("[:=[first]"); } else printf("[second]=:]"); } return 0; }...
Get an early look at Python 3.14, slated for 2025! Explore expected features, performance boosts, and how it will shape Python development and data science.
The world of AI evolves at lightning speed. Discover why staying informed on the latest AI news, breakthroughs, and industry trends is essential for everyone.
Discover expert strategies and essential resources to ace the IELTS Speaking Test. Learn how to boost your fluency, vocabulary, and confidence for a top score.
Explore Python’s exciting future! Discover anticipated trends, innovations, and what upcoming releases like Python 3.13 and 3.14 mean for developers and data scientists.