Submission #9552

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
95522014-09-28 07:11:03hodducQuaternion inverse (kriii2_Q)C++98
0 / 4
0 ms1476 KiB
#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}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...