結果

問題 No.1200 お菓子配り-3
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2020-07-19 21:20:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 799 bytes
コンパイル時間 1,750 ms
コンパイル使用メモリ 164,740 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 22:34:29
合計ジャッジ時間 18,100 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 4 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 14 ms
5,376 KB
testcase_08 AC 14 ms
5,376 KB
testcase_09 AC 12 ms
5,376 KB
testcase_10 AC 12 ms
5,376 KB
testcase_11 AC 12 ms
5,376 KB
testcase_12 AC 105 ms
5,376 KB
testcase_13 AC 107 ms
5,376 KB
testcase_14 AC 108 ms
5,376 KB
testcase_15 AC 110 ms
5,376 KB
testcase_16 AC 107 ms
5,376 KB
testcase_17 AC 389 ms
5,376 KB
testcase_18 AC 556 ms
5,376 KB
testcase_19 AC 128 ms
5,376 KB
testcase_20 AC 1,072 ms
5,376 KB
testcase_21 AC 1,066 ms
5,376 KB
testcase_22 AC 1,260 ms
5,376 KB
testcase_23 AC 1,074 ms
5,376 KB
testcase_24 AC 1,045 ms
5,376 KB
testcase_25 AC 1,048 ms
5,376 KB
testcase_26 AC 1,063 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 846 ms
5,376 KB
testcase_29 AC 2,346 ms
5,376 KB
testcase_30 AC 2,351 ms
5,376 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int ss(long long x,long long y){
    long long n,m;
  n=x+y;
  m=x-y;
  long long z=0;
  long long ans=0;
  for(int i=1;m>=i*i;i++){
    if(m%i==0){
      if(n%(i+2)==0){
       if((m/i)%2==(n/(i+2))%2&&(m/i)<=(n/(i+2))){
         ans++;
         
       }
      }
      if(i!=m/i){
        z=m/i;
        if(n%(z+2)==0){
          if((m/z)%2==(n/(z+2))%2&&(m/z)<=(n/(z+2))){
            ans++;
            
          }
        }
      }
    }
  }
  return ans;
}
int main() {
 int s;
  cin>>s;
  vector<int> x(s);
  vector<int> y(s);
  for(int i=0;i<s;i++){
    cin>>x.at(i);
    cin>>y.at(i);
  }
  for(int i=0;i<s;i++){
    if(x.at(i)<y.at(i)){
      swap(x.at(i),y.at(i));
    }
  }
  for(int i=0;i<s;i++){
    cout<<ss(x.at(i),y.at(i))<<endl;
  }
}
0