結果
問題 |
No.1200 お菓子配り-3
|
ユーザー |
![]() |
提出日時 | 2020-08-28 22:05:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 729 bytes |
コンパイル時間 | 2,469 ms |
コンパイル使用メモリ | 193,692 KB |
最終ジャッジ日時 | 2025-01-13 17:40:58 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 27 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0;i<n;i++) using namespace std; int main(){ int s; cin >> s; vector<int> ans(s); rep(ii,s){ long long x,y; cin >> x >> y; long long t = x+y; int tmpans = 0; if(x==y) tmpans++; for(int i = 3;i<sqrt(t)+1;i++){ if(t%i==0){ long long a = i-1; long long b = x/a; long long c = x%a; if(y == (c*a+b)) tmpans++; a = (t/i)-1; b = x/a; c = x%a; if(y == (c*a+b)) tmpans++; } } ans[ii]=tmpans; } rep(i,s) cout << ans[i] << endl; }