[Codeforces] [606A] Magic Spheres

Problem Description

Loading...

Problem Analysis

Thoughts on first attempting this problem:【Algorithm】An Algorithm Is a Way of Thinking

An English comprehension problem
I misread the statement — I thought it asked whether the first set of numbers could be transformed into the second set
But it only needs to be greater than or equal to the second one -.-
So that’s why I kept getting WA
My English is the real weak spot
And once I understood it…
This problem is so trivial…

No wonder everyone was getting AC so fast

cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include<stdio.h>
int main() {
	int a,b,c,x,y,z;
	while(scanf("%d %d %d",&a,&b,&c)!=EOF) {
		scanf("%d %d %d",&x,&y,&z) ;
		int sum1=0;
		int sum2=0;
		if(a>x)
			sum1+=(a-x)/2;
		else
			sum2+=x-a;
		if(b>y)
			sum1+=(b-y)/2;
		else
			sum2+=y-b;
		if(c>z)
			sum1+=(c-z)/2;
		else
			sum2+=z-c;
		if(sum1<sum2)
			printf("No\n");
		else
			printf("Yes\n");
	}
	return 0;
}

So I decided to cram on English -.-.

Problem link:【Codeforces】[606A]Magic Spheres

This post is licensed under CC BY-NC-SA 4.0. If it helped, or if you have anything to say, the comment box below is open.
Page views —
Unique visitors —

Loading...