結果
| 問題 |
No.1140 EXPotentiaLLL!
|
| コンテスト | |
| ユーザー |
udonman
|
| 提出日時 | 2020-08-09 18:25:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 430 ms / 2,000 ms |
| コード長 | 1,057 bytes |
| コンパイル時間 | 713 ms |
| コンパイル使用メモリ | 72,804 KB |
| 実行使用メモリ | 23,232 KB |
| 最終ジャッジ日時 | 2024-10-05 06:43:50 |
| 合計ジャッジ時間 | 7,497 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:45:18: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
45 | scanf("%ld",&a);
| ~~^ ~~
| | |
| | long long int*
| long int*
| %lld
main.cpp:46:18: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
46 | scanf("%ld",&p);
| ~~^ ~~
| | |
| | long long int*
| long int*
| %lld
main.cpp:45:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
45 | scanf("%ld",&a);
| ~~~~~^~~~~~~~~~
main.cpp:46:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
46 | scanf("%ld",&p);
| ~~~~~^~~~~~~~~~
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;
int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;
int y[5000003];
int main() {
for(int i = 2; i <= 5000002; i++){
for(int j = 1; j <= 5000002/i; j++){
y[i*j]++;
}
}
int t; cin >> t;
rep(test,t){
ll a,p;
scanf("%ld",&a);
scanf("%ld",&p);
if(y[p] == 1){
if(a % p == 0) printf("%d\n",0);
else printf("%d\n",1);
}else{
printf("%d\n",-1);
}
}
}
udonman