結果
| 問題 | 
                            No.166 マス埋めゲーム
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Rp7rf
                         | 
                    
| 提出日時 | 2015-03-19 23:57:03 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 702 bytes | 
| コンパイル時間 | 623 ms | 
| コンパイル使用メモリ | 70,656 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-06-28 23:28:30 | 
| 合計ジャッジ時間 | 4,441 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 12 WA * 1 TLE * 1 -- * 6 | 
ソースコード
#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;
  }
  cout<<((ans==k||(n==k&&ans==0))?"YES":"NO")<<endl;
}
            
            
            
        
            
Rp7rf