ÉèΪÊ×Ò³ ¼ÓÈëÊÕ²Ø

TOP

ÈýάÊ÷×´Êý×éÓÅ»¯²»¶¯ÁË
2013-11-20 14:23:52 À´Ô´: ×÷Õß: ¡¾´ó ÖРС¡¿ ä¯ÀÀ:122´Î
Tags£ºÈýά ÓÅ»¯
    ÈýάÊ÷×´Êý×éÄ£°æ¡£ÓÅ»¯²»¶¯ÁË¡£
    #include <set>
    #include <map>
    #include <stack>
    #include <cmath>
    #include <queue>
    #include <cstdio>
    #include <string>
    #include <vector>
    #include <iomanip>
    #include <cstring>
    #include <iostream>
    #include <algorithm>
    #define Max 2505
    #define FI first
    #define SE second
    #define ll long long
    #define PI acos£¨-1.0£©
    #define inf 0x3fffffff
    #define LL£¨x£© £¨ x ¡¶ 1 £©
    #define bug puts£¨"here"£©
    #define PII pair<int,int>
    #define RR£¨x£© £¨ x ¡¶ 1 | 1 £©
    #define mp£¨a,b£© make_pair£¨a,b£©
    #define mem£¨a,b£© memset£¨a,b,sizeof£¨a£©£©
    #define REP£¨i,s,t£© for£¨ int i = £¨ s £© ; i <= £¨ t £© ; ++ i £©
    using namespace std;
    int n , m ;
    int c[101][101][101] ;
    inline void RD£¨int &ret£© {
    char c;
    do {
    c = getchar£¨£©£»
    } while£¨c < '0' || c > '9'£© ;
    ret = c - '0';
    while£¨£¨c=getchar£¨£©£© >= '0' && c <= '9'£©
    ret = ret * 10 + £¨ c - '0' £©£»
    }
    inline void OT£¨int a£© {
    if£¨a >= 10£©OT£¨a / 10£© ;
    putchar£¨a % 10 + '0'£© ;
    }
    void update£¨int x , int y ,int z£© {
    for £¨int i = x ; i <= n ; i += i & £¨-i£© £©
    for £¨int j = y ; j <= n ; j += j & £¨-j£©£©
    for £¨int k = z ; k <= n ; k += k & £¨-k£©£©
    c[i][j][k] ++ ;
    }
    bool query£¨int x ,int y,int z£© {
    int ans = 0 ;
    for £¨int i = x ; i >= 1 ; i -= i & £¨-i£©£©
    for £¨int j = y ; j >=1 ; j -= j & £¨-j£©£©
    for £¨int k = z ; k >= 1 ; k -= k & £¨-k£©£©
    ans += c[i][j][k] ;
    return ans & 1 ;
    }
    void init£¨£© {
    for £¨int i = 0 ; i <= n ; i ++ £©
    for £¨int j = 0 ; j <= n ; j ++ £©
    for £¨int k = 0 ; k <= n ; k ++ £©
    c[i][j][k] = 0 ;
    }
    int main£¨£© {
    int x , y , z ;
    int xx , yy , zz ;
    int op ;
    while£¨scanf£¨"%d%d",&n,&m£© == 2£© {
    while£¨m -- £© {
    RD£¨op£© ;
    if£¨op & 1£© {
    RD£¨x£© ;RD£¨y£© ;RD£¨z£© ;
    RD£¨xx£© ;RD£¨yy£© ;RD£¨zz£© ;
    update£¨x ,  y ,  z £© ;
    update£¨xx + 1 ,  y ,  z £© ;
    update£¨xx + 1 ,  yy + 1 ,  z £© ;
    update£¨xx + 1 ,  yy + 1 ,  zz + 1 £© ;
    update£¨xx + 1 ,  y ,  zz + 1 £© ;
    update£¨x ,  y ,  zz + 1 £© ;
    update£¨x ,  yy + 1 ,  zz + 1 £© ;
    update£¨x ,  yy + 1 ,  z £© ;
    } else {
    RD£¨x£© ;RD£¨y£© ;RD£¨z£© ;
    OT£¨query£¨x , y , z£©£© ;
    putchar£¨'\n'£© ;
    }
    }
    init£¨£© ;
    }
    return 0 ;
    }

¡¾´ó ÖРС¡¿¡¾´òÓ¡¡¿ ¡¾·±Ìå¡¿¡¾Í¶¸å¡¿¡¾Êղء¿ ¡¾ÍƼö¡¿¡¾¾Ù±¨¡¿¡¾ÆÀÂÛ¡¿ ¡¾¹Ø±Õ¡¿ ¡¾·µ»Ø¶¥²¿¡¿
·ÖÏíµ½: 
ÉÏһƪ£ºPOJ 3974 ×»ØÎÄ×Ö´® ÏÂһƪ£º¶þ²æÊ÷µÄ´´½¨ÓëµÝ¹é±éÀú

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡¡¡Çé:
ÄÚ¡¡¡¡ÈÝ:

¡¤Linuxϵͳ¼ò½é (2025-12-25 21:55:25)
¡¤Linux°²×°MySQL¹ý³Ì (2025-12-25 21:55:22)
¡¤Linuxϵͳ°²×°½Ì³Ì£¨ (2025-12-25 21:55:20)
¡¤HTTP Åc HTTPS µÄ²î„ (2025-12-25 21:19:45)
¡¤ÍøÕ¾°²È«±ØÐ޿ΣºÍ¼ (2025-12-25 21:19:42)