Submission #1733576


Source Code Expand

Copy
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int f(int a,int r){
	return (int)sqrt(r*r-a*a);
}
signed main(){
	int k;cin>>k;
	int ans=0;
	rep(i,200/k){
		int a=min(f(abs(100-i*k),100),f(abs(100-(i+1)*k),100));
		bool flag=false;
		if((200/k)%2==1){
			flag=true;
			a-=k/2;
		}
		ans+=(a/k)*2;
		if(flag&&i!=0&&i!=200/k-1)ans++;
	}
	int ans2=0;
	rep(i,300/k){
		int a=min(f(abs(150-i*k),150),f(abs(150-(i+1)*k),150));
		bool flag=false;
		if((300/k)%2==1){
			flag=true;
			a-=k/2;
		}
		ans2+=(a/k)*2;
		if(flag&&i!=0&&i!=300/k-1)ans2++;
	}
	cout<<ans<<' '<<ans2<<endl;
}

Submission Info

Submission Time
Task A - 正方形のチップ2
User autumn_eel
Language C++14 (GCC 5.4.1)
Score 300
Code Size 795 Byte
Status
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_0.txt, example_1.txt, example_2.txt
All 300 / 300 example_0.txt, example_1.txt, example_2.txt, test_10.txt, test_20.txt, test_25.txt, test_4.txt
Case Name Status Exec Time Memory
example_0.txt 1 ms 256 KB
example_1.txt 1 ms 256 KB
example_2.txt 1 ms 256 KB
test_10.txt 1 ms 256 KB
test_20.txt 1 ms 256 KB
test_25.txt 1 ms 256 KB
test_4.txt 1 ms 256 KB