結果

問題 No.1200 お菓子配り-3
ユーザー tailstails
提出日時 2020-08-28 22:32:23
言語 cLay
(20240104-1)
結果
AC  
実行時間 88 ms / 4,000 ms
コード長 457 bytes
コンパイル時間 8,352 ms
コンパイル使用メモリ 220,832 KB
実行使用メモリ 10,664 KB
最終ジャッジ日時 2023-09-19 01:03:30
合計ジャッジ時間 13,156 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
10,504 KB
testcase_01 AC 10 ms
10,480 KB
testcase_02 AC 10 ms
10,504 KB
testcase_03 AC 10 ms
10,408 KB
testcase_04 AC 10 ms
10,480 KB
testcase_05 AC 10 ms
10,504 KB
testcase_06 AC 10 ms
10,640 KB
testcase_07 AC 10 ms
10,616 KB
testcase_08 AC 10 ms
10,480 KB
testcase_09 AC 10 ms
10,444 KB
testcase_10 AC 11 ms
10,516 KB
testcase_11 AC 10 ms
10,576 KB
testcase_12 AC 13 ms
10,468 KB
testcase_13 AC 14 ms
10,580 KB
testcase_14 AC 14 ms
10,664 KB
testcase_15 AC 13 ms
10,576 KB
testcase_16 AC 13 ms
10,412 KB
testcase_17 AC 20 ms
10,480 KB
testcase_18 AC 25 ms
10,504 KB
testcase_19 AC 13 ms
10,480 KB
testcase_20 AC 38 ms
10,496 KB
testcase_21 AC 38 ms
10,492 KB
testcase_22 AC 44 ms
10,476 KB
testcase_23 AC 37 ms
10,468 KB
testcase_24 AC 37 ms
10,468 KB
testcase_25 AC 37 ms
10,496 KB
testcase_26 AC 37 ms
10,500 KB
testcase_27 AC 10 ms
10,576 KB
testcase_28 AC 88 ms
10,660 KB
testcase_29 AC 42 ms
10,472 KB
testcase_30 AC 41 ms
10,476 KB
testcase_31 AC 10 ms
10,472 KB
testcase_32 AC 10 ms
10,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll s,x,y,z;
ll da[1000],dn;
{
	rd(s);
	rep(s){
		z=0;
		rd(x,y);
		dn=Divisor(x+y,da);
		rep[da](a,dn){
			if(a==2){
				if(x==y){
					// x+y == 2(b+c)
					if((x+y)%2==0){
						z+=(x+y)/2-1;
					}
				}
			}
			if(a>2){
				if((x-y)%(a-2)==0){
					ll btasuc = (x+y)/a;
					ll bhikuc = (x-y)/(a-2);
					if((btasuc+bhikuc)%2==0){
						ll b=(btasuc+bhikuc)/2;
						ll c=(btasuc-bhikuc)/2;
					    if(b>0&&c>0)++z;
					}
				}
			}
		}
		wt(z);
	}
}
0