# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9524 | hodduc | Quaternion inverse (kriii2_Q) | C++98 | 0 ms | 1476 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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,-b,-c,-d},
{b,a,-d,c},
{c,d,a,-b},
{d,-c,b,a}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |