{"comment":{"url":"https://api.github.com/repos/sizaif/Sizaif/comments/25954240","html_url":"https://github.com/sizaif/Sizaif/commit/3f6d5d7769daa4c76f53e914f47444b893593bc2#commitcomment-25954240","id":25954240,"user":{"login":"sizaif","id":32588265,"avatar_url":"https://avatars0.githubusercontent.com/u/32588265?v=4","gravatar_id":"","url":"https://api.github.com/users/sizaif","html_url":"https://github.com/sizaif","followers_url":"https://api.github.com/users/sizaif/followers","following_url":"https://api.github.com/users/sizaif/following{/other_user}","gists_url":"https://api.github.com/users/sizaif/gists{/gist_id}","starred_url":"https://api.github.com/users/sizaif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sizaif/subscriptions","organizations_url":"https://api.github.com/users/sizaif/orgs","repos_url":"https://api.github.com/users/sizaif/repos","events_url":"https://api.github.com/users/sizaif/events{/privacy}","received_events_url":"https://api.github.com/users/sizaif/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"3f6d5d7769daa4c76f53e914f47444b893593bc2","created_at":"2017-11-30T13:34:49Z","updated_at":"2017-11-30T13:34:49Z","author_association":"OWNER","body":"#include <bits/stdc++.h>\r\n#include <iostream>\r\n#include <stdio.h>\r\n#include <algorithm>\r\n#include <cmath>\r\n#include <math.h>\r\n#include <cstring>\r\n#include <string>\r\n#include <queue>\r\n#include <deque>\r\n#include <stack>\r\n#include <stdlib.h>\r\n#include <list>\r\n#include <map>\r\n#include <set>\r\n#include <bitset>\r\n#include <vector>\r\n#define mem(a,b) memset(a,b,sizeof(a))\r\n#define findx(x,b,n) lower_bound(b+1,b+1+n,x)-b\r\n#define FIN      freopen(\"input.txt\",\"r\",stdin)\r\n#define FOUT     freopen(\"output.txt\",\"w\",stdout)\r\n#define lson rt << 1, l, mid\r\n#define rson rt << 1|1, mid + 1, r\r\n#define  FI(n) IO::read(n)\r\n#define  Be IO::begin()\r\n\r\nusing namespace std;\r\ntypedef long long ll;\r\nconst double PI=acos(-1);\r\nconst int INF=0x3f3f3f3f;\r\nconst double esp=1e-6;\r\nconst int maxn=1e6+5;\r\nconst int MAXN=10025;\r\nconst int MOD=1e9+7;\r\nconst int mod=1e9+7;\r\nint dir[5][2]={0,1,0,-1,1,0,-1,0};\r\n\r\nnamespace IO {\r\n\tconst int MT = 5e7;\r\n\tchar buf[MT]; int c,sz;\r\n\tvoid begin(){\r\n\t\tc = 0;\r\n\t\tsz = fread(buf, 1, MT, stdin);//Ò»´ÎÐÔÊäÈë\r\n\t}\r\n\ttemplate<class T>\r\n\tinline bool read(T &t){\r\n\t\twhile( c < sz && buf[c] != '-' && ( buf[c]<'0' || buf[c] >'9')) c++;\r\n\t\tif( c>=sz) return false;\r\n\t\tbool flag = 0; if( buf[c]== '-') flag = 1,c++;\r\n\t\tfor( t=0; c<=sz && '0' <=buf[c] && buf[c] <= '9'; c++ ) t= t*10 + buf[c]-'0';\r\n\t\tif(flag) t=-t;\r\n\t\treturn true;\r\n\t}\r\n}\r\nll inv[maxn*2];\r\ninline void ex_gcd(ll a,ll b,ll &d,ll &x,ll &y){if(!b){ x=1; y=0; d=a; }else{ ex_gcd(b,a%b,d,y,x); y-=x*(a/b);};}\r\ninline ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}\r\ninline ll exgcd(ll a,ll b,ll &x,ll &y){if(!b){x=1;y=0;return a;}ll ans=exgcd(b,a%b,x,y);ll temp=x;x=y;y=temp-a/b*y;return ans;}\r\ninline ll lcm(ll a,ll b){ return b/gcd(a,b)*a;}\r\ninline ll qpow(ll x,ll n){ll res=1;for(;n;n>>=1){if(n&1)res=(res*x)%MOD;x=(x*x)%MOD;}return res;}\r\ninline ll inv_exgcd(ll a,ll n){ll d,x,y;ex_gcd(a,n,d,x,y);return d==1?(x+n)%n:-1;}\r\ninline ll inv1(ll b){return b==1?1:(MOD-MOD/b)*inv1(MOD%b)%MOD;}\r\ninline ll inv2(ll b){return qpow(b,MOD-2);}\r\n\r\n\r\nstruct node{\r\n    int x,y;\r\n    node(int x,int y):x(x),y(y){}  // ¹¹Ôìº¯Êý\r\n\r\n    bool operator < (const node& z) const  // ÖØÔØÔËËã·û\r\n    {\r\n        return x<z.x || x==z.x&&y<z.y;\r\n    }\r\n};\r\n\r\n\r\n\r\nint main()\r\n{\r\n    int n,m;\r\n    while(~scanf(\"%d %d\",&n,&m))\r\n    {\r\n        getchar();\r\n        int a[n][m];\r\n        char str[100];\r\n        string s[MAXN][15];\r\n        map<string,int>mp;\r\n        int k=1;\r\n        for(int i=0;i<n;i++)\r\n        {\r\n            gets(str);\r\n            int len=strlen(str);\r\n            int col=0;\r\n            for(int j=0;j<len;j++)\r\n            {\r\n                if(str[j]==',')\r\n                {\r\n                   // cout<<s[i][col]<<endl;\r\n                    if(!mp[s[i][col]])\r\n                    {\r\n                        mp[s[i][col]]=k;\r\n                        a[i][col]=k++;\r\n                        //cout<<mp[s[i][col]]<<endl;\r\n                    }\r\n                    else\r\n                        a[i][col]=mp[s[i][col]];\r\n                    col++;\r\n                }\r\n                else\r\n                    s[i][col].push_back(str[j]);\r\n            }\r\n            if(!mp[s[i][col]])\r\n            {\r\n            \tmp[s[i][col]]=k;\r\n            \ta[i][col]=k++;\r\n\t\t\t}\r\n\t\t\telse  a[i][col]=mp[s[i][col]];\r\n        }\r\n        int flag=1;\r\n        for(int i=0;i<m&&flag;i++)\r\n        {\r\n            for(int j=i+1;j<m&&flag;j++)\r\n            {\r\n                map<node,int> date;\r\n                for(int ij=0;ij<n&&flag;ij++)\r\n                {\r\n                    node z(a[ij][i],a[ij][j]);\r\n                    if(date[z])\r\n                    {\r\n                        flag=0;\r\n                        printf(\"No\\n\");\r\n                        printf(\"%d %d\\n\",date[z],ij+1);\r\n                        printf(\"%d %d\\n\",i+1,j+1);\r\n                    }\r\n                    else\r\n                        date[z]=ij+1;\r\n\r\n                    if(!flag)\r\n                        break;\r\n                }\r\n                if(!flag)\r\n                    break;\r\n            }\r\n            if(!flag)\r\n                break;\r\n\r\n        }\r\n        if(flag)\r\n                printf(\"YES\\n\");\r\n    }\r\n    return 0;\r\n}"}}
{"actor":{"display_login":"sizaif"}}