# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
8845 | gs13068 | Quaternion inverse (kriii2_Q) | C++98 | 564 ms | 1088 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<cstdio>
long long a[4][5];
long long t[4];
long long f(long long x,long long y,long long z)
{
if(y==0)return 1;
if(y&1)return f(x,y-1,z)*x%z;
long long t=f(x,y>>1,z);
return t*t%z;
}
int main()
{
int n,m;
scanf("%d%d",&n,&m);
while(m--)
{
int i,j,k,l,tt;
for(i=0;i<4;i++)scanf("%lld",&t[i]);
a[0][0]=t[0];
a[0][1]=-t[1];
a[0][2]=-t[2];
a[0][3]=-t[3];
a[0][4]=1;
a[1][0]=t[1];
a[1][1]=t[0];
a[1][2]=-t[3];
a[1][3]=t[2];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |