提出 #52665747


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    for(int i=0;i<t;i++){
        long long n,m,k,c;
        cin>>n>>m>>k;
        if(m==k+1 && n==k)cout<<0<<endl;
        else{
            if(n<m)c=n;
            else c=n-(n-m)/(m-k)*(m-k)-m+k;
            if(c%4==0)cout<<6<<endl;
            else if(c%4==1)cout<<2<<endl;
            else if(c%4==2)cout<<4<<endl;
            else cout<<8<<endl;
        }
    }
}

提出情報

提出日時
問題 B - Simple Math 4
ユーザ iwzk
言語 C++ 20 (gcc 12.2)
得点 0
コード長 469 Byte
結果 WA
実行時間 219 ms
メモリ 3616 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 400
結果
AC × 1
AC × 4
WA × 5
セット名 テストケース
Sample example_00.txt
All example_00.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 1 ms 3608 KiB
test_00.txt AC 215 ms 3484 KiB
test_01.txt AC 216 ms 3520 KiB
test_02.txt AC 219 ms 3536 KiB
test_03.txt WA 159 ms 3488 KiB
test_04.txt WA 157 ms 3536 KiB
test_05.txt WA 158 ms 3488 KiB
test_06.txt WA 216 ms 3456 KiB
test_07.txt WA 215 ms 3616 KiB