# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
9552 | hodduc | Quaternion inverse (kriii2_Q) | C++98 | 0 ms | 1476 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
int rev[100000];
int M, T;
int vis[4];
int ord[4];
int mult(int x, int e)
{
if(e == 1) return x;
long long tmp = mult(x, e>>1);
tmp = (tmp * tmp) % M;
if (e & 1) tmp = (tmp * x) % M;
return (int)tmp;
}
int main()
{
scanf("%d %d", &M, &T);
rev[1] = 1;
for(int i = 2; i < M; i++)
rev[i] = mult(i, M-2);
int a, b, c, d;
while(T--){
scanf("%d %d %d %d", &a, &b, &c, &d);
long long f[4][4] = {
{a,M-b,M-c,M-d},
{b,a,M-d,c},
{c,d,a,M-b},
{d,M-c,b,a}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |