結果

問題 No.166 マス埋めゲーム
ユーザー Rp7rfRp7rf
提出日時 2015-03-20 09:07:36
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 1,134 ms
コンパイル使用メモリ 70,016 KB
実行使用メモリ 11,484 KB
最終ジャッジ日時 2023-09-11 09:03:58
合計ジャッジ時間 4,777 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,804 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 3 ms
4,376 KB
testcase_10 AC 16 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 768 ms
4,376 KB
testcase_13 AC 199 ms
4,376 KB
testcase_14 WA -
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  ll h,w,n,k;
  cin>>h>>w>>n>>k;
  int ans = 0;
  for(int i = 0 ; i < h ; i ++){
    ans = (ans + w) % n;
  }
  if(ans==0)ans+=n;
  cout<<((ans==k)?"YES":"NO")<<endl;
}
0