F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_20613676_28928.cpp:3:25: error: stray '#' in program
     using namespace std;#define mod 1000000007int t;long long mod_pow(int a,int n,int p){    long long ret=1;    long long A=a;    while(n){        if (n & 1)            ret=(ret*A)%p;        A=(A*A)%p;        n>>=1;    }    return ret;}int main(){    scanf("%d",&t);    while( t -- ){        char str[808];        scanf("%s",str);        int len = strlen(str);        int unknown = 0, r_num = 0;        for(int i = 0; i < len; i ++){            if(str[i] == '?') unknown ++;            else if(str[i] == 'R') r_num ++;        }        long long unbea = (r_num == 0);         for(int i = 0; i < len; i ++){            if(str[i] == 'R' || str[i] == '?'){                int x = (str[i] == 'R');                unbea = (unbea + (x == r_num) ) % mod;                 for(int dis = 1; dis + i < len; dis += 2){                    int y = x;                    for(int sta = i + dis; sta < len; sta += dis){                        y += (str[sta] == 'R');                        if(str[sta] == 'G') break;                        unbea = (unbea + (y == r_num) )% mod;                    }                }            }        }        printf("%I64d\n",mod_pow(2,unknown,mod) - unbea);    }    return 0;}
                         ^
0_0_20613676_28928.cpp:3:26: error: 'define' does not name a type
     using namespace std;#define mod 1000000007int t;long long mod_pow(int a,int n,int p){    long long ret=1;    long long A=a;    while(n){        if (n & 1)            ret=(ret*A)%p;        A=(A*A)%p;        n>>=1;    }    return ret;}int main(){    scanf("%d",&t);    while( t -- ){        char str[808];        scanf("%s",str);        int len = strlen(str);        int unknown = 0, r_num = 0;        for(int i = 0; i < len; i ++){            if(str[i] == '?') unknown ++;            else if(str[i] == 'R') r_num ++;        }        long long unbea = (r_num == 0);         for(int i = 0; i < len; i ++){            if(str[i] == 'R' || str[i] == '?'){                int x = (str[i] == 'R');                unbea = (unbea + (x == r_num) ) % mod;                 for(int dis = 1; dis + i < len; dis += 2){                    int y = x;                    for(int sta = i + dis; sta < len; sta += dis){                        y += (str[sta] == 'R');                        if(str[sta] == 'G') break;                        unbea = (unbea + (y == r_num) )% mod;                    }                }            }        }        printf("%I64d\n",mod_pow(2,unknown,mod) - unbea);    }    return 0;}
                          ^
0_0_20613676_28928.cpp: In function 'int main()':
0_0_20613676_28928.cpp:3:265: error: 't' was not declared in this scope
     using namespace std;#define mod 1000000007int t;long long mod_pow(int a,int n,int p){    long long ret=1;    long long A=a;    while(n){        if (n & 1)            ret=(ret*A)%p;        A=(A*A)%p;        n>>=1;    }    return ret;}int main(){    scanf("%d",&t);    while( t -- ){        char str[808];        scanf("%s",str);        int len = strlen(str);        int unknown = 0, r_num = 0;        for(int i = 0; i < len; i ++){            if(str[i] == '?') unknown ++;            else if(str[i] == 'R') r_num ++;        }        long long unbea = (r_num == 0);         for(int i = 0; i < len; i ++){            if(str[i] == 'R' || str[i] == '?'){                int x = (str[i] == 'R');                unbea = (unbea + (x == r_num) ) % mod;                 for(int dis = 1; dis + i < len; dis += 2){                    int y = x;                    for(int sta = i + dis; sta < len; sta += dis){                        y += (str[sta] == 'R');                        if(str[sta] == 'G') break;                        unbea = (unbea + (y == r_num) )% mod;                    }                }            }        }        printf("%I64d\n",mod_pow(2,unknown,mod) - unbea);    }    return 0;}
                                                                                                                                                                                                                                                                         ^
0_0_20613676_28928.cpp:3:744: error: 'mod' was not declared in this scope
     using namespace std;#define mod 1000000007int t;long long mod_pow(int a,int n,int p){    long long ret=1;    long long A=a;    while(n){        if (n & 1)            ret=(ret*A)%p;        A=(A*A)%p;        n>>=1;    }    return ret;}int main(){    scanf("%d",&t);    while( t -- ){        char str[808];        scanf("%s",str);        int len = strlen(str);        int unknown = 0, r_num = 0;        for(int i = 0; i < len; i ++){            if(str[i] == '?') unknown ++;            else if(str[i] == 'R') r_num ++;        }        long long unbea = (r_num == 0);         for(int i = 0; i < len; i ++){            if(str[i] == 'R' || str[i] == '?'){                int x = (str[i] == 'R');                unbea = (unbea + (x == r_num) ) % mod;                 for(int dis = 1; dis + i < len; dis += 2){                    int y = x;                    for(int sta = i + dis; sta < len; sta += dis){                        y += (str[sta] == 'R');                        if(str[sta] == 'G') break;                        unbea = (unbea + (y == r_num) )% mod;                    }                }            }        }        printf("%I64d\n",mod_pow(2,unknown,mod) - unbea);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ^
0_0_20613676_28928.cpp:3:1164: error: 'mod' was not declared in this scope
     using namespace std;#define mod 1000000007int t;long long mod_pow(int a,int n,int p){    long long ret=1;    long long A=a;    while(n){        if (n & 1)            ret=(ret*A)%p;        A=(A*A)%p;        n>>=1;    }    return ret;}int main(){    scanf("%d",&t);    while( t -- ){        char str[808];        scanf("%s",str);        int len = strlen(str);        int unknown = 0, r_num = 0;        for(int i = 0; i < len; i ++){            if(str[i] == '?') unknown ++;            else if(str[i] == 'R') r_num ++;        }        long long unbea = (r_num == 0);         for(int i = 0; i < len; i ++){            if(str[i] == 'R' || str[i] == '?'){                int x = (str[i] == 'R');                unbea = (unbea + (x == r_num) ) % mod;                 for(int dis = 1; dis + i < len; dis += 2){                    int y = x;                    for(int sta = i + dis; sta < len; sta += dis){                        y += (str[sta] == 'R');                        if(str[sta] == 'G') break;                        unbea = (unbea + (y == r_num) )% mod;                    }                }            }        }        printf("%I64d\n",mod_pow(2,unknown,mod) - unbea);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-26 05:55:18, Gzip enabled