結果
| 問題 |
No.982 Add
|
| コンテスト | |
| ユーザー |
nikutto_
|
| 提出日時 | 2020-02-12 18:17:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 379 bytes |
| コンパイル時間 | 1,656 ms |
| コンパイル使用メモリ | 172,408 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 02:06:28 |
| 合計ジャッジ時間 | 2,517 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 16 WA * 7 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(__gcd(a,b)>1){
cout<<-1<<endl;
}
set<int> s;
for(int x=0;x<=b;x++){
for(int y=0;y<=a;y++){
int v=a*x+b*y;
if(1<=v && v<=a*b){
s.insert(v);
}
}
}
cout<<a*b-s.size()<<endl;
return 0;
}
nikutto_