Submission #1792421
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; typedef pair<int,P> P1; typedef pair<P,P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define mod 1000000007 #define fi first #define sc second #define rep(i,x) for(int i=0;i<x;i++) #define repn(i,x) for(int i=1;i<=x;i++) #define SORT(x) sort(x.begin(),x.end()) #define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end()) #define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) #define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) map<int,int>mm; string M; bool sm = 1; int main(){ cin>>M; for(int i=-256;i<=256;i++){ int a = i; for(int j=M.size()-1;j>=0;j--){ if(M[j] == '-') a *= -1; else { if(a==0) a = 1; else a = 0; } } mm[i] = a; // if(abs(i)<=10)cout<<a<<endl; if(i != a) sm = 0; } if(sm){ puts(""); return 0; } for(int ii=1;;ii++){ for(int j=0;j<(1<<ii);j++){ string ret = ""; int x = j; rep(k,ii){ if(x%2 == 0) ret.pb('-'); else ret.pb('!'); x /= 2; } for(int i=-256;i<=256;i++){ int a = i; for(int j=ret.size()-1;j>=0;j--){ if(ret[j] == '-') a *= -1; else { if(a==0) a = 1; else a = 0; } } if(mm[i] != a) goto bad; } cout<<ret<<endl; return 0; bad:; } } }
Submission Info
Submission Time | |
---|---|
Task | E - ショートコーディング |
User | IH19980412 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 1418 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt |
All | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt, 01-24.txt, 01-25.txt, 01-26.txt, 01-27.txt, 01-28.txt, 01-29.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 1 ms | 256 KB |
01-02.txt | AC | 1 ms | 256 KB |
01-03.txt | AC | 1 ms | 256 KB |
01-04.txt | AC | 1 ms | 256 KB |
01-05.txt | AC | 1 ms | 256 KB |
01-06.txt | AC | 1 ms | 256 KB |
01-07.txt | AC | 1 ms | 256 KB |
01-08.txt | AC | 2 ms | 256 KB |
01-09.txt | AC | 2 ms | 256 KB |
01-10.txt | AC | 2 ms | 256 KB |
01-11.txt | AC | 2 ms | 256 KB |
01-12.txt | AC | 1 ms | 256 KB |
01-13.txt | AC | 1 ms | 256 KB |
01-14.txt | AC | 1 ms | 256 KB |
01-15.txt | AC | 1 ms | 256 KB |
01-16.txt | AC | 1 ms | 256 KB |
01-17.txt | AC | 1 ms | 256 KB |
01-18.txt | AC | 1 ms | 256 KB |
01-19.txt | AC | 1 ms | 256 KB |
01-20.txt | AC | 1 ms | 256 KB |
01-21.txt | AC | 1 ms | 256 KB |
01-22.txt | AC | 1 ms | 256 KB |
01-23.txt | AC | 1 ms | 256 KB |
01-24.txt | AC | 1 ms | 256 KB |
01-25.txt | AC | 1 ms | 256 KB |
01-26.txt | AC | 1 ms | 256 KB |
01-27.txt | AC | 1 ms | 256 KB |
01-28.txt | AC | 2 ms | 256 KB |
01-29.txt | AC | 2 ms | 256 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |
sample-03.txt | AC | 1 ms | 256 KB |