結果

問題 No.896 友達以上恋人未満
ユーザー milanis48663220milanis48663220
提出日時 2019-09-27 23:28:31
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 675 bytes
コンパイル時間 1,328 ms
コンパイル使用メモリ 55,288 KB
実行使用メモリ 265,652 KB
最終ジャッジ日時 2023-10-25 06:48:38
合計ジャッジ時間 8,416 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

long z[1<<24];
long cnt[1<<24];
int x[1000], y[1000], a[1000], b[1000];

int main(){
    int M, N, mx, my, ax, ay, MOD;
    cin >> M >> N >> mx >> my >> ax >> ay >> MOD;
    for(int i = 0; i < M; i++){
        cin >> x[i] >> y[i] >> a[i] >> b[i];
        z[x[i]] += y[i];
    }
    int xp = x[M-1];
    int yp = y[M-1];
    for(int i = M; i < N; i++){
        long X, Y;
        X = xp*mx+ax;
        Y = yp*my+ay;
        X %= MOD;
        Y %= MOD;
        z[X] += Y;
        xp = X;
        yp = Y;
    }
    for(int i = 1; i < MOD; i++){
        for(int j = 1; i*j < MOD; j++){
            cnt[i] += z[i*j];
        }
    }
}   
0